/// <summary>
        /// 開始進行班級分類
        /// </summary>
        public void 班級分類(Dictionary <string, string> dic)
        {
            foreach (OnlineStudent each in StudentDic.Values)
            {
                if (infoDic.ContainsKey(each.ClassName))
                {
                    infoDic[each.ClassName].StudentList.Add(each);

                    if (each.VolunteerList.Count > 0)
                    {
                        infoDic[each.ClassName].SelectCount++; //已選填人數
                    }

                    if (each.原有社團 != null)
                    {
                        infoDic[each.ClassName].NumberOfParticipants++; //ClubJoin不為null,社團參與人數+1

                        if (each.原有社團.IsLock)
                        {
                            infoDic[each.ClassName].LockNumber++; //社團鎖定人數
                        }
                    }
                }
                else
                {
                    ClassRowInfo info = new ClassRowInfo();

                    info.School       = GetSchoolName(dic, each.School);
                    info.ClassName    = each.ClassName;    //班級名稱
                    info.GradeYear    = each.GradeYear;    //年級
                    info.DisplayOrder = each.DisplayOrder; //班級排序
                    info.TeacherName  = each.TeacherName;  //老師
                    info.StudentList.Add(each);

                    if (each.VolunteerList.Count > 0)
                    {
                        info.SelectCount++; //已選填人數
                    }

                    if (each.原有社團 != null)
                    {
                        info.NumberOfParticipants++; //ClubJoin不為null,社團參與人數+1

                        if (each.原有社團.IsLock)
                        {
                            info.LockNumber++; //社團鎖定人數
                        }
                    }

                    infoDic.Add(each.ClassName, info);
                }
            }
        }
Exemplo n.º 2
0
        private int SortRowList(ClassRowInfo cri1, ClassRowInfo cri2)
        {
            string name1 = cri1.GradeYear.PadLeft(3, '0');

            name1 += cri1.School.PadLeft(30, '0');
            name1 += cri1.ClassName.PadLeft(10, '0');

            string name2 = cri2.GradeYear.PadLeft(3, '0');

            name2 += cri2.School.PadLeft(30, '0');
            name2 += cri2.ClassName.PadLeft(10, '0');

            return(name1.CompareTo(name2));
        }
Exemplo n.º 3
0
 private void toolStripMenuItem2_Click(object sender, EventArgs e)
 {
     //開啟學生的志願序相關資料畫面
     if (dataGridViewX1.SelectedRows.Count == 1)
     {
         foreach (DataGridViewRow row in dataGridViewX1.SelectedRows)
         {
             ClassRowInfo         rowData = (ClassRowInfo)row.DataBoundItem;
             VolunteerStudentForm vsf     = new VolunteerStudentForm(rowData);
             vsf.ShowDialog();
             break;
         }
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// 班級排序
        /// </summary>
        private int SortClassIndex(ClassRowInfo class1, ClassRowInfo class2)
        {
            string aaa1 = class1.GradeYear.PadLeft(2, '0');

            aaa1 += class1.DisplayOrder.PadLeft(3, '0');
            aaa1 += class1.ClassName.PadLeft(10, '0');

            string bbb1 = class2.GradeYear.PadLeft(2, '0');

            bbb1 += class2.DisplayOrder.PadLeft(3, '0');
            bbb1 += class2.ClassName.PadLeft(10, '0');

            return(aaa1.CompareTo(bbb1));
        }
Exemplo n.º 5
0
 private void dataGridViewX1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex != -1 && e.ColumnIndex != -1)
     {
         //開啟學生的志願序相關資料畫面
         if (dataGridViewX1.SelectedRows.Count == 1)
         {
             foreach (DataGridViewRow row in dataGridViewX1.SelectedRows)
             {
                 ClassRowInfo         rowData = (ClassRowInfo)row.DataBoundItem;
                 VolunteerStudentForm vsf     = new VolunteerStudentForm(rowData);
                 vsf.ShowDialog();
                 break;
             }
         }
     }
 }
Exemplo n.º 6
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            if (dataGridViewX1.SelectedRows.Count < 1)
            {
                MsgBox.Show("請選擇班級後開始分配作業!!");
                return;
            }

            this.Text        = "社團志願分配(跨部別) 開始志願分配...";
            btnStart.Enabled = false;

            //開始志願分配作業
            //學生清單

            List <ClassRowInfo> RowDataList = new List <ClassRowInfo>();

            foreach (DataGridViewRow row in dataGridViewX1.SelectedRows)
            {
                ClassRowInfo rowData = (ClassRowInfo)row.DataBoundItem;
                RowDataList.Add(rowData);
            }

            BGW_Run.RunWorkerAsync(RowDataList);
        }
        public VolunteerStudentForm(ClassRowInfo VolRow)
        {
            InitializeComponent();

            _VolRow = VolRow;
        }