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