public GroupLeader() { InitializeComponent(); int schoolYear; if (!int.TryParse(School.DefaultSchoolYear, out schoolYear)) { schoolYear = 97; } for (int i = schoolYear; i > schoolYear - 3; i--) { cboSchoolYear.Items.Add(i); } cboSchoolYear.Text = schoolYear.ToString(); cboSemester.Items.Add(1); cboSemester.Items.Add(2); cboSemester.Text = School.DefaultSemester; //取出該學年度學期之社團 InitialGroupComboBox(cboSchoolYear.Text, cboSemester.Text); _mappingItems = ActivityRecordDAL.GetActivityRecordMappingItems("社團幹部"); _initialized = true; RecorverSchoolYear = cboSchoolYear.Text; RecorverSemester = cboSemester.Text; RecorverIndex = cboGroup.SelectedIndex; ChangeSelection(); }
public SchoolLeader() { InitializeComponent(); int schoolYear; if (!int.TryParse(School.DefaultSchoolYear, out schoolYear)) { schoolYear = 97; } for (int i = schoolYear; i > schoolYear - 3; i--) { cboSchoolYear.Items.Add(i); } cboSchoolYear.Text = schoolYear.ToString(); cboSemester.Items.Add(1); cboSemester.Items.Add(2); cboSemester.Text = School.DefaultSemester; _mappingItems = ActivityRecordDAL.GetActivityRecordMappingItems("學校幹部"); _initialized = true; RecorverSchoolYear = cboSchoolYear.Text; RecorverSemester = cboSemester.Text; ChangeSelection(); }
private void cboType_SelectedIndexChanged(object sender, EventArgs e) { dgEditor.Rows.Clear(); foreach (MappingItem item in ActivityRecordDAL.GetActivityRecordMappingItems(cboType.Text)) { if (item.Type != cboType.Text) { continue; } int rowIndex = dgEditor.Rows.Add(); dgEditor.Rows[rowIndex].Cells["細項"].Value = item.Item; dgEditor.Rows[rowIndex].Cells["數量"].Value = item.Count; } }
public ClassLeader() { InitializeComponent(); _mappingItems = ActivityRecordDAL.GetActivityRecordMappingItems("班級幹部"); int schoolYear; if (!int.TryParse(School.DefaultSchoolYear, out schoolYear)) { schoolYear = 97; } for (int i = schoolYear; i > schoolYear - 3; i--) { cboSchoolYear.Items.Add(i); } cboSchoolYear.Text = schoolYear.ToString(); RecorverSchoolYear = cboSchoolYear.Text; cboSemester.Items.Add(1); cboSemester.Items.Add(2); cboSemester.Text = School.DefaultSemester == "2" ? "2" : "1"; RecorverSemester = cboSemester.Text; foreach (ClassRecord cr in Class.Instance.Items) { cboClass.Items.Add(cr.Name); } if (cboClass.Items.Count > 0) { cboClass.SelectedIndex = 0; RecorverIndex = 0; } _initialized = true; ChangeSelection(); }