private bool JudgeMoByCode(string mocode) { BenQGuru.eMES.MOModel.MOFacade _mofacade = new BenQGuru.eMES.MOModel.MOFacade(base.DataProvider); if (_mofacade.GetMO(mocode) != null) { return(true); } return(false); }
protected override object GetEditObject() { if (_Facade == null) { _Facade = new MaterialFacade(base.DataProvider); } if (_MoFacade == null) { _MoFacade = new MOFacade(base.DataProvider); } DBDateTime dBDateTime = FormatHelper.GetNowDBDateTime(this.DataProvider); object objMo = _MoFacade.GetMO(FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtMOEdit.Text))); WorkPlan workPlan = (WorkPlan)this._Facade.GetWorkPlan(FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtBigSSCodeGroup.Text)), FormatHelper.TODateInt(FormatHelper.CleanString(this.dateDateFrom.Date_String)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtMOEdit.Text)), Convert.ToDecimal(FormatHelper.CleanString(this.txtMOSeqEdit.Text))); if (workPlan == null) { workPlan = _Facade.CreateNewWorkPlan(); workPlan.PlanDate = FormatHelper.TODateInt(FormatHelper.CleanString(this.dateDateFrom.Date_String)); workPlan.BigSSCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtBigSSCodeGroup.Text)); workPlan.MoCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtMOEdit.Text)); workPlan.MoSeq = Convert.ToDecimal(FormatHelper.CleanString(this.txtMOSeqEdit.Text)); workPlan.ItemCode = ((BenQGuru.eMES.Domain.MOModel.MO)objMo).ItemCode; workPlan.ActQty = 0; workPlan.MaterialQty = 0; workPlan.ActionStatus = WorkPlanActionStatus.WorkPlanActionStatus_Init; workPlan.MaterialStatus = MaterialWarningStatus.MaterialWarningStatus_No; } workPlan.PlanSeq = int.Parse(FormatHelper.CleanString(this.txtMactureSeq.Text)); workPlan.PlanQty = decimal.Parse(FormatHelper.CleanString(this.txtPlanInQTYEdit.Text)); workPlan.PlanStartTime = FormatHelper.TOTimeInt(this.timeFrom.Text); workPlan.MaintainUser = this.GetUserCode(); workPlan.MaintainDate = dBDateTime.DBDate; workPlan.MaintainTime = dBDateTime.DBTime; return(workPlan); }
private object GetEditObject(GridRecord row) { if (_facade == null) { _facade = new MOFacade(base.DataProvider); } //object obj = _facade.GetMO( row.Cells[2].Text.ToString() ); object obj = _facade.GetMO(row.Items.FindItemByKey("Mo_MOCode").Text); if (obj != null) { return(obj); } return(null); }
private bool ValidateInput() { PageCheckManager manager = new PageCheckManager(); manager.Add(new LengthCheck(this.lblResourceCodeEdit, this.txtResourceCodeEdit, 40, true)); if (this.drpMOGetTypeEdit.SelectedValue == Resource2MOGetType.Static) { manager.Add(new LengthCheck(this.lblMOCodeEdit, this.txtMOCodeEdit, 40, true)); } else if (this.drpMOGetTypeEdit.SelectedValue == Resource2MOGetType.GetFromRCard) { manager.Add(new DecimalCheck(this.lblMORCardStartIndexEdit, this.txtMORCardStartIndexEdit, 1, decimal.MaxValue, true)); manager.Add(new DecimalCheck(this.lblMOLendthRCardEdit, this.txtMOLendthEdit, 1, decimal.MaxValue, true)); } if (!manager.Check()) { WebInfoPublish.Publish(this, manager.CheckMessage, languageComponent1); return(false); } // 检查资源正确性 BenQGuru.eMES.BaseSetting.BaseModelFacade modelFacade = new BaseModelFacade(this.DataProvider); object objTmp = modelFacade.GetResource(this.txtResourceCodeEdit.Text.ToUpper().Trim()); if (objTmp == null) { ExceptionManager.Raise(this.GetType(), "$Error_Resource_Not_Exist"); return(false); } // 检查工单正确性 if (this.drpMOGetTypeEdit.SelectedValue == Resource2MOGetType.Static) { if (_moFacade == null) { _moFacade = new MOFacade(this.DataProvider); } objTmp = _moFacade.GetMO(this.txtMOCodeEdit.Text.ToUpper().Trim()); if (objTmp == null) { ExceptionManager.Raise(this.GetType(), "$Error_Input_MoCode"); return(false); } } return(true); }