public void SaveChanges() { if (!ValidateForm()) { return; } custodianBindingSource.EndEdit(); _custodian = (Custodian)custodianBindingSource.DataSource; _custodian.Status = true; if (_newmode) { _context.Custodians.AddObject(_custodian); } try { _context.SaveChanges(); _newmode = false; this.Close(); var cutodiandetail = new CustodianDetail(); cutodiandetail.ShowObject(_custodian); cutodiandetail.ShowDialog(); } catch (Exception ex) { ViewHelper.ShowErrorMessage("Error occured while saving the current custodian information.", ex); } }
public void OpenSelectedItem() { if (_Custodian != null) { var custdetail = new CustodianDetail(); custdetail.ShowObject(_Custodian); custdetail.ShowDialog(); } }