protected override Boolean WfDisplayMode() { vw_zinvt001 masterModel = null; try { if (DrMaster != null && DrMaster.RowState != DataRowState.Detached) { masterModel = DrMaster.ToItem <vw_zinvt001>(); WfSetDocPicture("", masterModel.igaconf, "", pbxDoc); if ((FormEditMode == YREditType.新增 || FormEditMode == YREditType.修改)) { if (BaaModel == null || GlobalFn.varIsNull(BaaModel.baa04)) { WfShowErrorMsg("未設定本國幣別,請先設定!"); } BekModel = BoBas.OfGetBekModel(BaaModel.baa04); if (BekModel == null) { WfShowErrorMsg(string.Format("未設定此幣別{0},於幣別基本資料檔,請先設定!", BaaModel.baa04)); } } } else { WfSetDocPicture("", "", "", pbxDoc); } if (FormEditMode == YREditType.NA) { WfSetControlsReadOnlyRecursion(this, true); } else { WfSetControlsReadOnlyRecursion(this, false); //先全開 WfSetControlReadonly(uGridMaster, true); //主表grid不可編輯 WfSetControlsReadOnlyRecursion(ute_iga01.Parent, true); WfSetControlsReadOnlyRecursion(ute_igaconu.Parent, true); //明細先全開,並交由 WfSetDetailDisplayMode處理 } return(true); } catch (Exception ex) { throw ex; } }
//回傳值 true.通過驗證 false.未通過驗證,會把值還原 protected override bool WfItemCheck(object sender, ItemCheckInfo e) { int iChkCnts = 0; vw_zinvt001 masterModel = null; vw_zinvt001s detailModel = null; List <vw_zinvt001s> detailList = null; bab_tb l_bab = null; UltraGrid uGrid = null; try { masterModel = DrMaster.ToItem <vw_zinvt001>(); #region 單身-pick vw_zinvt001s if (e.Row.Table.Prefix.ToLower() == "vw_zinvt001s") { uGrid = sender as UltraGrid; detailModel = e.Row.ToItem <vw_zinvt001s>(); detailList = e.Row.Table.ToList <vw_zinvt001s>(); l_bab = BoBas.OfGetBabModel(masterModel.iga01); switch (e.Column.ToLower()) { case "igb07": //異動成本 if (GlobalFn.varIsNull(e.Value)) { return(true); } if (detailModel.igb07 < 0) { WfShowErrorMsg("單價不可小於0!"); return(false); } //依幣別檔設定單價小數 e.Row[e.Column] = GlobalFn.Round(detailModel.igb07, BekModel.bek03); WfSetDetailAmt(e.Row); break; } } #endregion return(true); } catch (Exception ex) { throw ex; } }
protected override bool WfFormCheck() { vw_zinvt001 masterModel = null; vw_zinvt001s detailModel = null; bab_tb babModel = null; UltraGrid uGrid; string msg; Control chkControl; string chkColName; int iChkDetailTab; Result result; try { masterModel = DrMaster.ToItem <vw_zinvt001>(); if (!GlobalFn.varIsNull(masterModel.iga01)) { babModel = BoBas.OfGetBabModel(GlobalFn.isNullRet(masterModel.iga01, "")); } #region 單身資料檢查 iChkDetailTab = 0; uGrid = TabDetailList[iChkDetailTab].UGrid; foreach (DataRow drTemp in TabDetailList[iChkDetailTab].DtSource.Rows) { if (drTemp.RowState == DataRowState.Unchanged) { continue; } detailModel = drTemp.ToItem <vw_zinvt001s>(); } #endregion return(true); } catch (Exception ex) { throw ex; } }
protected override bool WfPreInUpdateModeCheck() { Result result; vw_zinvt001 masterModel = null; try { masterModel = DrMaster.ToItem <vw_zinvt001>(); BaaTbModel = BoBas.OfGetBaaModel(); //檢查日期區間是否可修改 result = BoBas.OfChkBaa02Baa03(Convert.ToDateTime(masterModel.iga02), BaaModel); if (result.Success == false) { WfShowBottomStatusMsg(result.Message); return(false); } return(true); } catch (Exception ex) { throw ex; } }
protected override bool WfAfterFormCheck() { string iga01New, errMsg; vw_zinvt001 masterModel = null; try { masterModel = DrMaster.ToItem <vw_zinvt001>(); if (FormEditMode == YREditType.新增) { iga01New = ""; errMsg = ""; if (BoBas.OfGetAutoNo(masterModel.iga01, ModuleType.stp, (DateTime)masterModel.iga02, out iga01New, out errMsg) == false) { WfShowErrorMsg(errMsg); return(false); } DrMaster["iga01"] = iga01New; } //填入系統資訊 if (DrMaster.RowState != DataRowState.Unchanged) { if (DrMaster.RowState == DataRowState.Added) { DrMaster["igasecu"] = LoginInfo.UserNo; DrMaster["igasecg"] = LoginInfo.GroupNo; DrMaster["igacreu"] = LoginInfo.UserNo; DrMaster["igacreg"] = LoginInfo.DeptNo; DrMaster["igacred"] = Now; } else if (DrMaster.RowState == DataRowState.Modified) { DrMaster["igamodu"] = LoginInfo.UserNo; DrMaster["igamodg"] = LoginInfo.DeptNo; DrMaster["igamodd"] = Now; } } foreach (DataRow drDetail in TabDetailList[0].DtSource.Rows) { if (drDetail.RowState != DataRowState.Unchanged) { if (drDetail.RowState == DataRowState.Added) { drDetail["igbcreu"] = LoginInfo.UserNo; drDetail["igbcreg"] = LoginInfo.DeptNo; drDetail["igbcred"] = Now; } else if (drDetail.RowState == DataRowState.Modified) { drDetail["igbmodu"] = LoginInfo.UserNo; drDetail["igbmodg"] = LoginInfo.DeptNo; drDetail["igbmodd"] = Now; } } } WfSetDetailPK(); return(true); } catch (Exception ex) { throw ex; } }