Beispiel #1
0
 /// <summary>
 /// 合同罚款处理
 /// </summary>
 /// <param name="listContract"></param>
 /// <param name="nOpStaffId"></param>
 /// <param name="strOpStaffName"></param>
 /// <param name="strErrText"></param>
 /// <returns></returns>
 public bool FineContracts(List<Contract> listContract, long nOpStaffId, string strOpStaffName, out string strErrText)
 {
     strErrText = string.Empty;
     try
     {
         using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required, new TimeSpan(2, 0, 0)))
         {
             using (ContractDAO dao = new ContractDAO())
             {
                 //修改合同罚款金额数据
                 foreach (Contract contract in listContract)
                 {
                     if (!dao.UpdateContractFineAmount(contract.Id, contract.FineAmount, nOpStaffId, strOpStaffName, out strErrText))
                     {
                         return false;
                     }
                 }
             }
             transScope.Complete();
         }
         return true;
     }
     catch (Exception e)
     {
         strErrText = e.Message;
         return false;
     }
 }