private void EditEntity(object entity) { var Name = Name_tb.Text; if (string.IsNullOrEmpty(Name)) { MessageBox.Show("Поле заполнено некорретно."); return; } (entity as Entity).Edit(Name); EditEnded?.Invoke(entity); this.Close(); }
private void EditClient(object client) { var fName = CFName_tb.Text; var lName = CLName_tb.Text; if (string.IsNullOrEmpty(fName) || string.IsNullOrEmpty(lName)) { MessageBox.Show("Поля заполнены некорретно."); return; } (client as Client).Edit(fName, lName); EditEnded?.Invoke(client); this.Close(); }
private void EditEmployee(object empl) { var fName = EFName_tb.Text; var lName = ELName_tb.Text; var phoneText = Phone_mtb.Text; var phone = GetInt(phoneText); if (string.IsNullOrEmpty(fName) || string.IsNullOrEmpty(lName) || phone.ToString().Length < 11) { MessageBox.Show("Поля заполнены некорретно."); return; } (empl as Employee).Edit(fName, lName, phone); EditEnded?.Invoke(empl); this.Close(); }
private void OnEditEnded(bool clearCheck, CoordViewType viewType) { try { Properties.Settings.Default.ClearCheck = clearCheck; Properties.Settings.Default.CoordView = viewType; Properties.Settings.Default.Save(); EditEnded?.Invoke(this, EventArgs.Empty); Service.Close(); } catch { MessageBox.Show( "Не удалось выполнить операцию", "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error ); return; } }
private void OnEditEnded(string val) { EditEnded?.Invoke(val); }
// Invoke the EditEnded event protected virtual void OnEditEnded(EventArgs e) { EditEnded?.Invoke(this, e); }
protected void RaiseEditEnded() { EditEnded?.Invoke(this, EventArgs.Empty); }