Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected override void BeforeUpdate()
- {
- base.BeforeUpdate();
- LibMessageList libMessageList = new LibMessageList();
- #region 檢查B表
- foreach (DataRow dataRowB in base.Tables[1].Rows)
- {
- if (dataRowB.RowState != DataRowState.Deleted)
- {
- if (LibSysUtils.ToByte(dataRowB["ReservedKind"]) > 0)
- {
- if (LibSysUtils.ToDecimal(dataRowB["ReservedMoney"]) > LibSysUtils.ToDecimal(dataRowB["OrderMoney"]))
- {
- string errMessage = string.Format("序號{0}:[申請保留金額]:不允許大於[未結案請(採)購金額]!", dataRowB["RowNo"]);
- LibMessageInfo libMessageInfo = new LibMessageInfo(LibMessageKind.Error, errMessage, "201587", string.Empty);
- libMessageList.Add(libMessageInfo);
- }
- }
- if (LibSysUtils.ToDecimal(dataRowB["ReservedMoney"]) != LibSysUtils.ToDecimal(dataRowB["PeriodDetailTotal"]))
- {
- string errMessage = string.Format("序號{0}:[申請保留金額]需等於[分期明細加總金額]!", dataRowB["RowNo"]);
- LibMessageInfo libMessageInfo = new LibMessageInfo(LibMessageKind.Error, errMessage, "201587", string.Empty);
- libMessageList.Add(libMessageInfo);
- }
- if (LibSysUtils.ToDecimal(dataRowB["ReservedMoney"]) != LibSysUtils.ToDecimal(dataRowB["TransInYearTotal"]))
- {
- string errMessage = string.Format("序號{0}:[申請保留金額]需等於[保留轉入年度明細加總金額]!", dataRowB["RowNo"]);
- LibMessageInfo libMessageInfo = new LibMessageInfo(LibMessageKind.Error, errMessage, "201587", string.Empty);
- libMessageList.Add(libMessageInfo);
- }
- }
- }
- #endregion 檢查B表
- if (libMessageList.Count> 0)
- {
- LibMessageException.Throw(libMessageList);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement