コード例 #1
0
        private void btnAddSubject_Click(object sender, EventArgs e)
        {
            subjects = new Subjects();
            getNewData();

            #region AddOrUpdateLogix
            int     index;
            Boolean flag = Helper.checkSubjectExist(subjects, out index);
            if (flag)
            {
                Subjects.subjects[index].subjectMark = subjects.subjectMark;
                Subjects.subjects[index].subjectName = subjects.subjectName;
            }
            else
            {
                Subjects.addSubject(subjects);
            }
            #endregion
        }
コード例 #2
0
        private void btnSubjectDelete_Click(object sender, EventArgs e)
        {
            int index;

            Helper.checkSubjectExist(subjects, out index);

            try
            {
                Subjects.removeSubject(index);
            }
            catch (IndexOutOfRangeException ex)
            {
                MessageBox.Show(ex.Message);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #3
0
 /// <summary>
 /// Adding new Subject to subjects collection
 /// </summary>
 /// <param name="subj">Subjects refrence</param>
 public static void addSubject(Subjects subj)
 {
     subjects.Add(subj);
 }
コード例 #4
0
 private void btnRefresh_Click(object sender, EventArgs e)
 {
     cmbSubjects.DataSource = Subjects.getSubjectNames();
 }