Пример #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();
 }