• 大小: 71KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-09
  • 语言: C#
  • 标签: c#  分组  抽签  

资源简介

环境为vs2005,可用于随机分组 抽签 摇奖,很有效,代码容易理解,可帮助学习。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace DrawGroupAssistant
{
    public partial class Form1 : Form
    {
        private Input oInput;
        private InputGroup oInputGroup;
        private string InfoRecei;
        private string GroupNameRecei;
        private int GroupQualRecei;
        private Dictionary iDicPar;

        public Form1()
        {
            InitializeComponent();
        }

        private void btnAddPar_Click(object sender EventArgs e)
        {
            oInput = new Input();
            oInput.SendMessage += new Input.delShowMessage(this.AcceptMessage);
            oInput.Owner = this;
            oInput.Show();
            this.Enabled = false;
        }

        private void btnDelPar_Click(object sender EventArgs e)
        {
            int rowindex;
            try
            {
                rowindex = this.dgvParticipant.SelectedCells[0].RowIndex;
                this.dgvParticipant.Rows.RemoveAt(rowindex);
                UpdateParID();
            }
            catch
            {
                MessageBox.Show(“未选定要删除的人员“);
            }
        }

        private void btnAddGroup_Click(object sender EventArgs e)
        {
            oInputGroup = new InputGroup();
            oInputGroup.SendMessage +=new InputGroup.delShowMessage(this.AcceptGroupMessage);
            oInputGroup.Owner = this;
            oInputGroup.Show();
            this.Enabled = false;
        }

        private void btnDelGroup_Click(object sender EventArgs e)
        {
            int rowindex;
            try
            {
                rowindex = this.dgvGroup.SelectedCells[0].RowIndex;
                this.dgvGroup.Rows.RemoveAt(rowindex);
            }
            catch
            {
                MessageBox.Show(“未选定要删除的组别“);
            }
        }

        private void AcceptMessage(string strMessage)
        {
            InfoRecei = strMessage;
            this.dgvParticipant.Rows.Add(1);
            this.dgvParticipant.Rows[this.dgvParticipant.Rows.Count - 1].Cells[1].Value = InfoRecei;
            UpdateParID();
        }

        private void AcceptGroupMessage(string strMessage int intQual)
        {
            GroupNameRecei = strMessage;
            GroupQualRecei = intQual;
            this.dgvGroup.Rows.Add(1);
            this.dgvGroup.Rows[this.dgvGroup.Rows.Count - 1].Cells[0].Value = strMessage;
            this.dgvGroup.Rows[this.dgvGroup.Rows.Count - 1].Cells[1].Value = intQual.ToString();

        }

        private void UpdateParID()
        {
            foreach (DataGridViewRow row in this.dgvParticipant.Rows)
            {
                row.Cells[0].Value = (row.Index + 1).ToString();
            }
        }

        private void btnDraw_Click(objec

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       5612  2009-03-03 17:01  DrawGroupAssistant\DrawGroupAssistant\Properties\Resources.resx

     文件        249  2009-03-03 17:01  DrawGroupAssistant\DrawGroupAssistant\Properties\Settings.settings

     文件       1190  2009-03-03 17:01  DrawGroupAssistant\DrawGroupAssistant\Properties\AssemblyInfo.cs

     文件       2890  2009-03-03 17:01  DrawGroupAssistant\DrawGroupAssistant\Properties\Resources.Designer.cs

     文件       1101  2009-03-03 17:01  DrawGroupAssistant\DrawGroupAssistant\Properties\Settings.Designer.cs

     文件       5296  2009-03-03 22:29  DrawGroupAssistant\DrawGroupAssistant\Form1.cs

     文件       1257  2009-03-04 10:36  DrawGroupAssistant\DrawGroupAssistant\Input.cs

     文件       5814  2009-03-04 10:36  DrawGroupAssistant\DrawGroupAssistant\Input.resx

     文件       3946  2009-03-03 20:42  DrawGroupAssistant\DrawGroupAssistant\DrawGroupAssistant.csproj

     文件       5632  2005-11-11 22:25  DrawGroupAssistant\DrawGroupAssistant\bin\Debug\DrawGroupAssistant.vshost.exe

     文件      36864  2009-03-04 10:36  DrawGroupAssistant\DrawGroupAssistant\bin\Debug\DrawGroupAssistant.exe

     文件      44544  2009-03-04 10:36  DrawGroupAssistant\DrawGroupAssistant\bin\Debug\DrawGroupAssistant.pdb

     文件       9353  2009-03-04 10:37  DrawGroupAssistant\DrawGroupAssistant\bin\Debug\分组抽签助手.rar

     文件       4252  2009-03-03 22:28  DrawGroupAssistant\DrawGroupAssistant\obj\Debug\DrawGroupAssistant.Form1.resources

     文件        180  2009-03-04 10:36  DrawGroupAssistant\DrawGroupAssistant\obj\Debug\DrawGroupAssistant.Input.resources

     文件        180  2009-03-04 10:36  DrawGroupAssistant\DrawGroupAssistant\obj\Debug\DrawGroupAssistant.InputGroup.resources

     文件        180  2009-03-03 20:42  DrawGroupAssistant\DrawGroupAssistant\obj\Debug\DrawGroupAssistant.Properties.Resources.resources

     文件      36864  2009-03-04 10:36  DrawGroupAssistant\DrawGroupAssistant\obj\Debug\DrawGroupAssistant.exe

     文件      44544  2009-03-04 10:36  DrawGroupAssistant\DrawGroupAssistant\obj\Debug\DrawGroupAssistant.pdb

     文件        963  2009-03-04 10:36  DrawGroupAssistant\DrawGroupAssistant\obj\Debug\DrawGroupAssistant.csproj.GenerateResource.Cache

     文件        442  2009-07-17 10:35  DrawGroupAssistant\DrawGroupAssistant\obj\DrawGroupAssistant.csproj.FileList.txt

     文件       1542  2009-12-07 15:09  DrawGroupAssistant\DrawGroupAssistant\obj\DrawGroupAssistant.csproj.FileListAbsolute.txt

     文件       1548  2009-03-04 10:36  DrawGroupAssistant\DrawGroupAssistant\InputGroup.cs

     文件       5125  2009-03-04 10:36  DrawGroupAssistant\DrawGroupAssistant\InputGroup.Designer.cs

     文件       5814  2009-03-04 10:36  DrawGroupAssistant\DrawGroupAssistant\InputGroup.resx

     文件       3694  2009-03-04 10:36  DrawGroupAssistant\DrawGroupAssistant\Input.Designer.cs

     文件      13586  2009-03-03 22:21  DrawGroupAssistant\DrawGroupAssistant\Form1.resx

     文件      14617  2009-03-03 22:21  DrawGroupAssistant\DrawGroupAssistant\Form1.Designer.cs

     文件        477  2009-03-03 17:01  DrawGroupAssistant\DrawGroupAssistant\Program.cs

     文件        943  2009-03-03 17:01  DrawGroupAssistant\DrawGroupAssistant.sln

............此处省略13个文件信息

评论

共有 条评论