示例#1
0
 private void NewBarItem_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (Odd_EvenCB.SelectedIndex > 0 && Morning_AfternoonCB.SelectedIndex > 0)
     {
         string oddeven          = (Odd_EvenCB.SelectedIndex == 1) ? "Neparni" : "Parni";
         string morningafternoon = (Morning_AfternoonCB.SelectedIndex == 1) ? "Jutro" : "Posljepodne";
         working_time                   = new Working_time();
         working_time.Odd_Even          = oddeven;
         working_time.Morning_Afternoon = morningafternoon;
         if (!_DB.InsertWorkingDay(working_time))
         {
             XtraMessageBox.Show("Element is not added!");
         }
         _working_time = _DB.GetWorkingTime();
         WorkingTimeGridControl.DataSource = _working_time;
         Odd_EvenCB.SelectedIndex          = 0;
         Morning_AfternoonCB.SelectedIndex = 0;
     }
     else
     {
         XtraMessageBox.Show("All fields should be filled!");
     }
 }