protected override bool ValidateInput() { PageCheckManager manager = new PageCheckManager(); manager.Add(new LengthCheck(this.lblNGCodeEdit, this.txtErrorCode, 65535, true)); manager.Add(new LengthCheck(this.lblReworkOPCodeEdit, this.txtReworkOPCode, 40, true)); if (!manager.Check()) { WebInfoPublish.Publish(this, manager.CheckMessage, this.languageComponent1); return(false); } if (this.txtReworkRoute.Text.Trim().Length != 0) { BenQGuru.eMES.BaseSetting.BaseModelFacade baseModelFacade = new BenQGuru.eMES.BaseSetting.BaseModelFacade(this.DataProvider); object route2op = baseModelFacade.GetRoute2Operation(this.txtReworkRoute.Text.ToUpper(), this.txtReworkOPCode.Text.ToUpper()); if (route2op == null) { WebInfoPublish.Publish(this, "$Error_RouteHasNoOperations", this.languageComponent1); return(false); } } return(true); }
protected override void UpdateDomainObject(object domainObject) { if (_facade == null) { _facade = new TSModelFacadeFactory(base.DataProvider).CreateTSModelFacade(); } if (((ErrorCodeItem2Route)domainObject).RouteCode.ToUpper() != "TS" && ((ErrorCodeItem2Route)domainObject).RouteCode.Trim().Length > 0) { //检查途程是不是和产品挂起来了 BenQGuru.eMES.MOModel.ItemFacade itemFacade = new BenQGuru.eMES.MOModel.ItemFacade(this.DataProvider); object ir = itemFacade.GetItem2Route(((ErrorCodeItem2Route)domainObject).ItemCode, ((ErrorCodeItem2Route)domainObject).RouteCode, ((ErrorCodeItem2Route)domainObject).OrganizationID.ToString()); if (ir == null) { throw new Exception("$Error_ItemRoute_NotExist"); } } if (((ErrorCodeItem2Route)domainObject).RouteCode.Trim().Length > 0) { BenQGuru.eMES.BaseSetting.BaseModelFacade baseModelFacade = new BenQGuru.eMES.BaseSetting.BaseModelFacade(this.DataProvider); object route2op = baseModelFacade.GetRoute2Operation(((ErrorCodeItem2Route)domainObject).RouteCode.ToUpper(), ((ErrorCodeItem2Route)domainObject).OPCode.ToUpper()); if (route2op == null) { throw new Exception("$Error_RouteHasNoOperations"); } } this._facade.UpdateErrorCodeItem2Route((ErrorCodeItem2Route)domainObject); }