Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.94 KB | None | 0 0
  1. protected override void BeforeUpdate()
  2. {
  3.     base.BeforeUpdate();
  4.     LibMessageList libMessageList = new LibMessageList();
  5.     #region 檢查B表
  6.     foreach (DataRow dataRowB in base.Tables[1].Rows)
  7.     {
  8.         if (dataRowB.RowState != DataRowState.Deleted)
  9.         {
  10.             if (LibSysUtils.ToByte(dataRowB["ReservedKind"]) > 0)
  11.             {
  12.                 if (LibSysUtils.ToDecimal(dataRowB["ReservedMoney"]) > LibSysUtils.ToDecimal(dataRowB["OrderMoney"]))
  13.                 {
  14.                     string errMessage = string.Format("序號{0}:[申請保留金額]:不允許大於[未結案請(採)購金額]!", dataRowB["RowNo"]);
  15.                     LibMessageInfo libMessageInfo = new LibMessageInfo(LibMessageKind.Error, errMessage, "201587", string.Empty);
  16.                     libMessageList.Add(libMessageInfo);
  17.                 }
  18.             }
  19.             if (LibSysUtils.ToDecimal(dataRowB["ReservedMoney"]) != LibSysUtils.ToDecimal(dataRowB["PeriodDetailTotal"]))
  20.             {
  21.                 string errMessage = string.Format("序號{0}:[申請保留金額]需等於[分期明細加總金額]!", dataRowB["RowNo"]);
  22.                 LibMessageInfo libMessageInfo = new LibMessageInfo(LibMessageKind.Error, errMessage, "201587", string.Empty);
  23.                 libMessageList.Add(libMessageInfo);
  24.             }
  25.             if (LibSysUtils.ToDecimal(dataRowB["ReservedMoney"]) != LibSysUtils.ToDecimal(dataRowB["TransInYearTotal"]))
  26.             {
  27.                 string errMessage = string.Format("序號{0}:[申請保留金額]需等於[保留轉入年度明細加總金額]!", dataRowB["RowNo"]);
  28.                 LibMessageInfo libMessageInfo = new LibMessageInfo(LibMessageKind.Error, errMessage, "201587", string.Empty);
  29.                 libMessageList.Add(libMessageInfo);
  30.             }
  31.         }
  32.     }
  33.     #endregion 檢查B表
  34.     if (libMessageList.Count> 0)
  35.     {
  36.         LibMessageException.Throw(libMessageList);
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement