예제 #1
0
        public void AddFee(FillFee fee, BusiLog busiLog)
        {
            using (SqlConnection conn = ConnectionPool.BorrowConnection())
            {
                //conn.Open();

                SqlTransaction trans = conn.BeginTransaction();
                try
                {
                    SqlHelper.ExecuteNonQuery(trans, CommandType.Text, "update tbMebCompanyPrepay set cnnPrepayFee = cnnPrepayFee+" + fee.cnnFillFee.ToString() + " where cnvcCompanyID='" + fee.cnvcCompanyID.ToString() + "'");
                    FillFeeAccess.AddFee(trans, fee);
                    BusiLogAccess.AddBusiLog(trans, busiLog);
                    trans.Commit();
                }
                catch (SqlException sex)
                {
                    trans.Rollback();
                    throw sex;
                }
                catch (Exception ex)
                {
                    trans.Rollback();
                    throw ex;
                }
                finally
                {
                    ConnectionPool.ReturnConnection(conn);
                }
            }
        }
예제 #2
0
        public void AddCompany(MebCompanyPrepay company, FillFee fee, BusiLog busiLog)
        {
            using (SqlConnection conn = ConnectionPool.BorrowConnection())
            {
                //conn.Open();

                SqlTransaction trans = conn.BeginTransaction();
                try
                {
                    MebCompanyPrepayAccess.AddCompany(trans, company);
                    FillFeeAccess.AddFee(trans, fee);
                    BusiLogAccess.AddBusiLog(trans, busiLog);
                    trans.Commit();
                }
                catch (SqlException sex)
                {
                    trans.Rollback();
                    throw sex;
                }
                catch (Exception ex)
                {
                    trans.Rollback();
                    throw ex;
                }
                finally
                {
                    ConnectionPool.ReturnConnection(conn);
                }
            }
        }