private void Update(object sender, RoutedEventArgs e) { if (string.IsNullOrEmpty(_currentClassification.Description)) { MessageWindow.ShowAlertMessage("Classification Name must not be empty!"); return; } if (_currentClassification.ClassificationId == 0) { _currentClassification.Create(); return; } _currentClassification.Update(); }
private void btnAdd_Click(object sender, RoutedEventArgs e) { var item = Classification.FindByName(_newItem.Description); if (item == null) { var result = _newItem.Create(); if (result.Success) { DialogResult = true; Close(); } else { MessageWindow.ShowAlertMessage(result.Message); } } else { MessageWindow.ShowNotifyMessage("Classification already exists!"); } }