private void btn_add_Click(object sender, EventArgs e)
 {
     if (cb_day.Text == String.Empty || cb_pairNum.Text == String.Empty || cb_weekType.Text == String.Empty || cb_subject.Text == String.Empty || cb_group.Text == String.Empty || tb_room.Text == String.Empty)
     {
         MessageBox.Show("Заповніть всі поля атрибутів пари!", "Повідомлення", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         return;
     }
     DayOfWeek day = ParseDayOfWeek(cb_day.Text);
     TypeOfPair pairType = ParsePairType(cb_pairNum.Text);
     TypeOfWeek weekType = ParseWeekType(cb_weekType.Text);
     Group gr = _groups[cb_group.SelectedIndex];
     Subject subj = _subjects[cb_subject.SelectedIndex];
     int room = Int32.Parse(tb_room.Text);
     StudingTheSubject sts = new StudingTheSubject(subj.Id, gr.Id, _teacher.Id, day, weekType, pairType, room);
     try
     {
         _proxy.AddPair(sts);
         ClearPairDetails();
         LoadPairs();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Ejemplo n.º 2
0
 public void AttendStudent(Student student, bool presence, StudingTheSubject pair)
 {
     try
     {
         student.Attend(presence, pair);
     }
     catch (Exception ex)
     {
         throw new FaultException(ex.Message);
     }
 }
Ejemplo n.º 3
0
 public int EditPair(StudingTheSubject pair, string[] newvalues)
 {
     try
     {
         return pair.Edit(newvalues);
     }
     catch (Exception ex)
     {
         throw new FaultException(ex.Message);
     }
 }
Ejemplo n.º 4
0
 public int DeletePair(StudingTheSubject pair)
 {
     try
     {
         return pair.Delete();
     }
     catch (Exception ex)
     {
         throw new FaultException(ex.Message);
     }
 }
Ejemplo n.º 5
0
 public int AddPair(StudingTheSubject pair)
 {
     try
     {
         return StudingTheSubject.CreateNew(pair);
     }
     catch (Exception ex)
     {
         throw new FaultException(ex.Message);
     }
 }