private void Save() { try { if (isFormLoaded && _standard != null) { if (_standard.Name.Length < 10 || _standard.Name.Length > 100) { MessageBox.Show("Standart Name character should be between 10 and 100."); return; } if (_id == -1) { schoolMan.AddStandard(_standard); } else { schoolMan.UpdateStandard(_standard); } } MessageBox.Show("Save Operation succeed."); btnSave.Enabled = false; btnCancel.Text = "Close"; return; } catch (Exception ex) { Logger.LogException(ex); MessageBox.Show("Save Operation failed."); } }