Beispiel #1
0
 private void NewBarItem_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (!string.IsNullOrWhiteSpace(NamteTE.Text) && DateMC.SelectionStart != null && DateMC.SelectionStart > DateTime.Now)
     {
         nonworkingdays      = new NonWorkingDays();
         nonworkingdays.Date = DateMC.SelectionStart;
         nonworkingdays.Name = NamteTE.Text;
         if (!_DB.InsertNonWorkingDays(nonworkingdays))
         {
             XtraMessageBox.Show("Element is not added!");
         }
         _nonWorkingdays = _DB.GetNonWorkingDays();
         NonWorkingDaysGridControl.DataSource = _nonWorkingdays;
         NamteTE.Text          = string.Empty;
         DateMC.SelectionStart = DateTime.Now;
     }
     else
     {
         XtraMessageBox.Show("All fields should be filled!");
     }
 }