Esempio n. 1
0
        /// <summary>
        /// 审核补扣款
        /// </summary>
        /// <param name="info">扣补款对象</param>
        public static bool UpdateInfoTran(DeductModel info)
        {
            using (SqlConnection conn = new SqlConnection(DBHelper.connString))
            {
                conn.Open();
                SqlTransaction tran = conn.BeginTransaction();
                try
                {
                    if (DeductDAL.UpdateDeduct(info, tran) <= 0)
                    {
                        tran.Rollback();
                        return(false);
                    }
                    if (!ReleaseDAL.UpdateDeductOut(tran, info.Number, info.IsDeduct, info.DeductMoney))
                    {
                        tran.Rollback();
                        return(false);
                    }
                    DirectionEnum de = DirectionEnum.AccountsIncreased;
                    if (info.IsDeduct == 0)
                    {
                        de = DirectionEnum.AccountReduced;
                    }
                    string remark = "";
                    if (info.IsDeduct == 0)
                    {
                        remark = "008021~【" + info.Number + "】~000153~" + info.ExpectNum + "~008022";
                        D_AccountDAL.AddAccountWithdraw1(info.Number, info.DeductMoney, D_AccountSftype.MemberType, D_Sftype.BounsAccount, D_AccountKmtype.AddMoneycut, de, remark, tran);
                    }
                    else
                    {
                        remark = "008021~【" + info.Number + "】~000153~" + info.ExpectNum + "~008023";
                        D_AccountDAL.AddAccountWithdraw1(info.Number, info.DeductMoney, D_AccountSftype.MemberType, D_Sftype.BounsAccount, D_AccountKmtype.AddMoneyget, de, remark, tran);
                    }

                    tran.Commit();
                    return(true);
                }
                catch
                {
                    tran.Rollback();
                    return(false);
                }
                finally
                {
                    conn.Close();
                    conn.Dispose();
                }
            }
        }
Esempio n. 2
0
 /// <summary>
 /// 审核补扣款
 /// </summary>
 /// <param name="info">扣补款对象</param>
 public static bool UpdateInfoTranBD(DeductModel info)
 {
     using (SqlConnection conn = new SqlConnection(DBHelper.connString))
     {
         conn.Open();
         SqlTransaction tran = conn.BeginTransaction();
         try
         {
             if (DeductDAL.UpdateDeduct(info, tran) <= 0)
             {
                 tran.Rollback();
                 return(false);
             }
             if (!ReleaseDAL.UpdateDeductOutBD(tran, info.Number, info.IsDeduct, info.Actype, info.DeductMoney))
             {
                 tran.Rollback();
                 return(false);
             }
             DirectionEnum   de     = DirectionEnum.AccountReduced;
             D_AccountKmtype km     = D_AccountKmtype.AddMoneycut;
             string          remark = "管理员协助扣款" + info.DeductMoney.ToString();
             if (info.IsDeduct == 1)
             {
                 de     = DirectionEnum.AccountsIncreased;
                 km     = D_AccountKmtype.AddMoneyget;
                 remark = "管理员协助补款" + info.DeductMoney.ToString();
             }
             D_AccountDAL.AddAccountWithdraw1(info.Number, info.DeductMoney, D_AccountSftype.MemberType, D_Sftype.BounsAccount, km, de, remark, tran);
             tran.Commit();
             return(true);
         }
         catch
         {
             tran.Rollback();
             return(false);
         }
         finally
         {
             conn.Close();
             conn.Dispose();
         }
     }
 }
Esempio n. 3
0
    private bool GetAudit(DeductModel info)
    {
        bool bl = false;

        using (SqlConnection conn = new SqlConnection(DBHelper.connString))
        {
            conn.Open();
            SqlTransaction tran = conn.BeginTransaction();
            try
            {
                if (DeductDAL.UpdateDeduct(info, tran) <= 0)
                {
                    tran.Rollback();
                    return(false);
                }
                string p = "pointEin =pointEin +" + info.DeductMoney;
                if (info.IsDeduct == 0)
                {
                    p = "pointEout =pointEout +" + info.DeductMoney;
                }

                int r = DBHelper.ExecuteNonQuery(tran, "update  memberinfo  set  " + p + "  where  number='" + info.Number + "'");
                if (r == 0)
                {
                    tran.Rollback(); return(false);
                }
                //对账单
                string          rem  = "扣款";
                D_AccountKmtype dakm = D_AccountKmtype.AddMoneycut;
                DirectionEnum   dem  = DirectionEnum.AccountReduced;
                if (info.IsDeduct == 0)
                {
                    dakm = D_AccountKmtype.AddMoneycut;
                }
                else if (info.IsDeduct == 1)
                {
                    dakm = D_AccountKmtype.AddMoneyget; dem = DirectionEnum.AccountsIncreased; rem = "补款";
                }

                int c = D_AccountDAL.AddAccount("E", info.Number, info.DeductMoney, D_AccountSftype.MemberType, dakm, dem, "管理员添加" + rem + " " + info.DeductMoney, tran);
                if (c == 0)
                {
                    tran.Rollback();
                    return(false);
                }
                tran.Commit();
                return(true);
            }
            catch
            {
                tran.Rollback();
                return(false);
            }
            finally
            {
                conn.Close();
                conn.Dispose();
            }
        }


        return(bl);
    }