private void Save() { if (AtMng.DB.Legislation.HasErrors || AtMng.DB.Provision.HasErrors) { UIHelper.TableHasErrorsOnSaveMessBox(AtMng.DB); } else { try { SaveRtfValues(); legislationBindingSource.EndEdit(); provisionBindingSource.EndEdit(); atLogic.BusinessProcess bp = AtMng.GetBP(); bp.AddForUpdate(AtMng.GetLegislation()); bp.AddForUpdate(AtMng.GetProvision()); bp.Update(); setEditMode(false); SetRTFValues(false); } catch (Exception x) { throw x; } } }
public fLegislation(Form f) : base(f) { InitializeComponent(); AtMng.GetLegislation().Load(); AtMng.GetProvision().Load(); legislationBindingSource.DataMember = AtMng.DB.Legislation.TableName; provisionBindingSource.DataMember = AtMng.DB.Provision.TableName; provisionBindingSource.DataSource = AtMng.DB; legislationBindingSource.DataSource = AtMng.DB; legislationBindingSource.CurrentChanged += new EventHandler(legislationBindingSource_CurrentChanged); provisionBindingSource.CurrentChanged += new EventHandler(provisionBindingSource_CurrentChanged); }
private void Delete() { try { //not called if (UIHelper.ConfirmDelete()) { CurrentRow().Delete(); legislationBindingSource.EndEdit(); atLogic.BusinessProcess bp = AtMng.GetBP(); bp.AddForUpdate(AtMng.GetLegislation()); bp.AddForUpdate(AtMng.GetProvision()); bp.Update(); } } catch (Exception x) { throw x; } }
private void New() { appDB.LegislationRow legr = (appDB.LegislationRow)AtMng.GetLegislation().Add(null); legislationBindingSource.Position = legislationBindingSource.Find("LegislationId", legr.LegislationId); }