Пример #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();
                }
            }
        }
Пример #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();
         }
     }
 }
Пример #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);
    }
Пример #4
0
 /// <summary>
 /// 添加扣款或补款信息
 /// </summary>
 /// <param name="info">扣补款对象</param>
 public static void AddInfo(DeductModel info)
 {
     DeductDAL.AddInfo(info);
 }
Пример #5
0
 /// <summary>
 /// 编号是否存在
 /// </summary>
 /// <param name="number">编号</param>
 /// <returns></returns>
 public static bool IsExist(string number)
 {
     return(DeductDAL.IsExist(number));
 }
Пример #6
0
 /// <summary>
 /// 扣款原因
 /// </summary>
 /// <param name="expectnum">期数</param>
 /// <param name="number">编号</param>
 /// <returns></returns>
 public static object Reason(int expectnum, string number, int id)
 {
     return(DeductDAL.Reason(expectnum, number, id));
 }
Пример #7
0
 /// <summary>
 /// 删除记录差异
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public static int DelBonusDifference(int id)
 {
     return(DeductDAL.DelBonusDifference(id));
 }
Пример #8
0
 /// <summary>
 /// 获得记录差异信息
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public static BonusDifferenceModel GetBonusDifference(int id)
 {
     return(DeductDAL.GetBonusDifference(id));
 }
Пример #9
0
 /// <summary>
 /// 判断是否已经删除计算差异
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public static bool isDelBonusDifference(int id)
 {
     return(DeductDAL.isDelBonusDifference(id));
 }
Пример #10
0
        /// <summary>
        /// 获取扣补款信息
        /// </summary>
        /// <param name="expct"></param>
        /// <param name="deduct"></param>
        /// <param name="mark"></param>
        /// <param name="search"></param>
        /// <returns></returns>
        public static DataTable GetMember(int expct, int deduct, string mark, string search)
        {
            DeductDAL deductdal = new DeductDAL();

            return(deductdal.GetMember(expct, deduct, mark, search));
        }
Пример #11
0
 /// <summary>
 /// 根据期数和编号查询扣补款信息
 /// </summary>
 /// <param name="expectnum">期数</param>
 /// <param name="number">编号</param>
 /// <returns></returns>
 public static DeductModel GetDeductInfo(int expectnum, string number)
 {
     return(DeductDAL.GetDeductInfo(expectnum, number));
 }
Пример #12
0
 /// <summary>
 /// 根据编号获取会员信息
 /// </summary>
 /// <param name="number">编号</param>
 /// <returns></returns>
 public static MemberInfoModel GetMemberInfo(string number)
 {
     return(DeductDAL.GetMemberInfo(number));
 }
Пример #13
0
 public static bool AddDeduct(DeductModel info)
 {
     return(DeductDAL.AddInfo(info));
 }