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