protected override object GetEditObject() { if (facade == null) { facade = new InventoryFacade(base.DataProvider); } InvFormula invFormula = this.facade.CreateNewInvFormula(); invFormula.FormulaCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtFormulaCodeEdit.Text, 40)); invFormula.FormulaDesc = FormatHelper.CleanString(this.txtFormulaDescriptionEdit.Text, 100); invFormula.MaintainUser = this.GetUserCode(); return(invFormula); }
protected override void UpdateDomainObject(object domainObject) { if (facade == null) { facade = new InventoryFacade(base.DataProvider); } DBDateTime dateTime = FormatHelper.GetNowDBDateTime(this.DataProvider); InvFormula invFormula = domainObject as InvFormula; invFormula.MaintainUser = this.GetUserCode(); invFormula.MaintainDate = dateTime.DBDate; invFormula.MaintainTime = dateTime.DBTime; this.facade.UpdateInvFormula(invFormula); }
protected override void AddDomainObject(object domainObject) { if (facade == null) { facade = new InventoryFacade(base.DataProvider); } DBDateTime dateTime = FormatHelper.GetNowDBDateTime(this.DataProvider); InvFormula invFormula = domainObject as InvFormula; object obj = this.facade.GetInvFormula(invFormula.FormulaCode); if (obj != null) { ExceptionManager.Raise(this.GetType(), "$Error_Primary_Key_Overlap"); } invFormula.MaintainUser = this.GetUserCode(); invFormula.MaintainDate = dateTime.DBDate; invFormula.MaintainTime = dateTime.DBTime; this.facade.AddInvFormula(invFormula); }