/// <summary> /// 部门代码存在Check /// </summary> private void ruleDepartExit_CustomValidationMethod(object sender, CustomValidationEventArgs e) { CheckSection check = new CheckSection(); e.IsValid = false; this.lblDepartNM.Text = ""; if (!String.IsNullOrEmpty(this.txtDepart.Text)) { TSectionMs vo = check.Check01Vo(this.txtCompany.Text, this.txtDepart.Text); if (vo != null && !String.IsNullOrEmpty(vo.Id.ISectionCd)) { e.IsValid = true; this.lblDepartNM.Text = vo.ISectionDesc; } } else { e.IsValid = true; } }
/// <summary> /// 根据EntityVo的值给画面上的控件赋值 /// </summary> private void SetVoToForm(TFactoryMs facVo) { #region this.txtAbbreviation.Text = facVo.IFacArgDesc; this.txtName.Text = facVo.IFacDesc; this.txtPinyin.Text = facVo.IFacDescKana; this.txtZipCD.Text = facVo.IMailNo; this.cbbCountry.Selectedvalue = facVo.ICountryCd; this.txtAddress1.Text = facVo.IAddress1; this.txtAddress2.Text = facVo.IAddress2; this.txtAddress3.Text = facVo.IAddress3; this.txtTel.Text = facVo.ITel; this.txtFax.Text = facVo.IFaxNo; this.cbbLanguage.Selectedvalue = facVo.ILanguageCd; this.cbbTimezone.Selectedvalue = facVo.ITimezoneCd; this.txtBase.Text = facVo.IBaseCd; this.txtDepart.Text = facVo.ISectionCd; CheckSection secCheck = new CheckSection(); TSectionMs secVo = secCheck.Check01Vo(this.txtCompany.Text, facVo.ISectionCd); if (secVo != null && !String.IsNullOrEmpty(secVo.Id.ISectionCd)) { this.lblDepartNM.Text = secVo.ISectionDesc; } else { this.lblDepartNM.Text = ""; } this.cbbChange.Selectedvalue = facVo.IEgChgCls; this.txtAutoPeriod.Text = facVo.IMrpPeriod.ToString(); this.txtStockPeriod.Text = facVo.IAlcPeriod.ToString(); this.txtArrange.Text = facVo.IPoCreatePeriod.ToString(); this.cbbSafe.Selectedvalue = facVo.ISafeStockCls; this.cbbRate.Selectedvalue = facVo.IRateCls; this.cbbPlan.Selectedvalue = facVo.IPlanCrtCls; this.cbbCost.Selectedvalue = facVo.IRsltCstCalcCls; this.cbbDecide.Selectedvalue = facVo.IPoCreateCls; #endregion }