Ejemplo n.º 1
0
        /// <summary>
        /// 审核分页申请记录
        /// </summary>
        /// <param name="source"></param>
        /// <param name="e"></param>
        protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            long   ID       = Convert.ToInt64(e.CommandArgument); //ID
            string filename = "";

            lgk.BLL.tb_systemMoney   sy     = new lgk.BLL.tb_systemMoney();
            lgk.Model.tb_systemMoney system = sy.GetModel(1);

            if (e.CommandName.Equals("Open"))        //确认
            {
                string        sql1 = "update  tb_takeMoney1 set Flag=1  where   ID= '" + ID + "'";
                SqlConnection conn = new SqlConnection(sconn);
                conn.Open();
                SqlCommand cmd   = new SqlCommand(sql1, conn);
                int        reInt = cmd.ExecuteNonQuery();
                conn.Close();
                if (reInt >= 1)
                {
                    MessageBox.MyShow(this, "操作成功!");
                    BindData();
                    return;
                }
                else
                {
                    MessageBox.MyShow(this, "数据不存在!");
                    return;
                }
            }
            if (e.CommandName.Equals("Remove"))        //删除
            {
                //加入流水账表

                string        sql1 = "delete from tb_takeMoney1 where ID= '" + ID + "'";
                SqlConnection conn = new SqlConnection(sconn);
                conn.Open();
                SqlCommand cmd   = new SqlCommand(sql1, conn);
                int        reInt = cmd.ExecuteNonQuery();
                conn.Close();

                if (reInt > 0)
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('取消成功!');window.location.href='TakeMoney.aspx';", true);        //取消成功
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('取消失败!');", true);        //取消失败
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 审核分页申请记录
        /// </summary>
        /// <param name="source"></param>
        /// <param name="e"></param>
        protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            long   ID       = Convert.ToInt64(e.CommandArgument); //ID
            string filename = "";

            lgk.Model.tb_takeMoney cModel = takeBLL.GetModel(ID);
            lgk.BLL.tb_systemMoney sy     = new lgk.BLL.tb_systemMoney();
            //lgk.BLL.tb_rechargeable dotx = new lgk.BLL.tb_rechargeable();
            lgk.Model.tb_systemMoney system = sy.GetModel(1);
            if (cModel == null)
            {
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('该记录已删除,无法再进行此操作!');window.location.href='TakeMoney.aspx';", true);
            }
            else
            {
                if (cModel.Flag == 1)
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('该记录已审核,无法再进行此操作!');window.location.href='TakeMoney.aspx';", true);
                }
                else
                {
                    lgk.Model.tb_user user = userBLL.GetModel(Convert.ToInt32(cModel.UserID));
                    if (e.CommandName.Equals("Open"))//确认
                    {
                        cModel.Flag    = 1;
                        cModel.Take006 = DateTime.Now;
                        if (takeBLL.Update(cModel) && UpdateSystemAccount("MoneyAccount", Convert.ToDecimal(cModel.RealityMoney), 0) > 0)
                        {
                            if (cModel.Take001 == 6)
                            {
                                user.Batch = 0;
                                userBLL.Update(user);
                            }

                            //发送短信通知
                            string content = GetLanguage("MessageTakeMoneyOK").Replace("{username}", user.UserCode).Replace("{time}", Convert.ToDateTime(cModel.TakeTime).ToString("yyyy年MM月dd日HH时mm分")).Replace("{timeEn}", Convert.ToDateTime(cModel.TakeTime).ToString("yyyy/MM/dd HH:mm"));
                            SendMessage(Convert.ToInt32(cModel.UserID), user.PhoneNum, content);
                            ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('操作成功!');", true);//window.location.href='TakeMoney.aspx';
                            BindData();
                        }
                    }
                    if (e.CommandName.Equals("Remove"))//删除
                    {
                        //加入流水账表
                        lgk.Model.tb_journal model = new lgk.Model.tb_journal();
                        lgk.Model.tb_user    users = userBLL.GetModel(cModel.UserID);
                        model.UserID    = cModel.UserID;
                        model.Remark    = "取消提现";
                        model.InAmount  = cModel.TakeMoney;
                        model.OutAmount = 0;
                        if (cModel.Take001 == 1)
                        {
                            model.BalanceAmount = user.Emoney + cModel.TakeMoney;
                            filename            = "emoney";
                            // model.Journal02 = 2;//奖励分
                            model.JournalType = 1;
                        }
                        if (cModel.Take001 == 2)
                        {
                            model.BalanceAmount = user.BonusAccount + cModel.TakeMoney;
                            filename            = "BonusAccount";
                            //  users.Emoney = users.Emoney + cModel.RealityMoney + cModel.TakePoundage;
                            //   users.StockMoney = users.BonusAccount + cModel.TakeMoney + cModel.TakePoundage;
                            //  model.Journal02 = 4; //原始积分
                            model.JournalType = 2;
                        }
                        //if (cModel.Take001 == 3)
                        //{
                        //    model.BalanceAmount = user.StockMoney + cModel.TakeMoney + cModel.TakePoundage;
                        //    filename = "StockMoney";
                        //    //users.BonusAccount = users.BonusAccount + cModel.TakeMoney + cModel.TakePoundage;
                        //    model.Journal02 = cModel.Take001;
                        //}
                        //if (cModel.Take001 == 4)
                        //{
                        //    model.BalanceAmount = user.ShopAccount + cModel.TakeMoney + cModel.TakePoundage;
                        //    filename = "ShopAccount";
                        //    users.Emoney = users.Emoney + cModel.RealityMoney;
                        //    users.BonusAccount = users.BonusAccount + cModel.TakeMoney + cModel.TakePoundage;
                        //    model.Journal02 = cModel.Take001;
                        //}
                        //if (cModel.Take001 == 5)
                        //{
                        //    model.BalanceAmount = user.GLmoney + cModel.TakeMoney + cModel.TakePoundage;
                        //    filename = "GLmoney";
                        //    users.BonusAccount = users.BonusAccount + cModel.TakeMoney + cModel.TakePoundage;
                        //    model.Journal02 = cModel.Take001;
                        //}
                        //if (cModel.Take001 == 6)
                        //{
                        //    model.BalanceAmount = user.RegMoney + cModel.TakeMoney + cModel.TakePoundage;
                        //    filename = "RegMoney";
                        //    users.Batch = 0;
                        //    model.Journal02 = cModel.Take001;
                        //}
                        model.JournalDate = DateTime.Now;

                        model.Journal01 = cModel.UserID;
                        if (journalBLL.Add(model) > 0 && userBLL.Update(users) && UpdateAccount(filename, user.UserID, cModel.TakeMoney, 1) > 0 && takeBLL.Delete(ID))
                        {
                            MessageBox.MyShow(this, "取消成功");
                            BindData();
                        }
                        else
                        {
                            MessageBox.MyShow(this, "取消失败");
                        }
                    }
                }
            }
        }
Ejemplo n.º 3
0
        protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            int ID = Convert.ToInt32(e.CommandArgument); //ID

            lgk.Model.tb_takeMoney   takeMoneyInfo = takeBLL.GetModel(ID);
            lgk.BLL.tb_systemMoney   sy            = new lgk.BLL.tb_systemMoney();
            lgk.Model.tb_systemMoney system        = sy.GetModel(1);
            if (takeMoneyInfo == null)
            {
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('该记录已删除,无法再进行此操作!');window.location.href='TakeMoney.aspx';", true);
            }
            else
            {
                if (takeMoneyInfo.Flag == 1)
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('该记录已审核,无法再进行此操作!');window.location.href='TakeMoney.aspx';", true);
                }
                else
                {
                    lgk.Model.tb_Stock stockInfo = stockBLL.GetModel("UserID=" + takeMoneyInfo.UserID);
                    lgk.Model.tb_user  userInfo  = userBLL.GetModel(Convert.ToInt32(takeMoneyInfo.UserID));
                    decimal            dProfit   = stockInfo.Number * (getParamAmount("shares5") - stockInfo.Price);

                    if (e.CommandName.Equals("Open"))//确认
                    {
                        takeMoneyInfo.Flag    = 1;
                        takeMoneyInfo.Take006 = DateTime.Now;
                        if (takeBLL.Update(takeMoneyInfo) && UpdateSystemAccount("MoneyAccount", Convert.ToDecimal(takeMoneyInfo.RealityMoney), 0) > 0)
                        {
                            //发送短信通知
                            string content = GetLanguage("MessageTakeMoneyOK").Replace("{username}", userInfo.UserCode).Replace("{time}", Convert.ToDateTime(takeMoneyInfo.TakeTime).ToString("yyyy年MM月dd日HH时mm分")).Replace("{timeEn}", Convert.ToDateTime(takeMoneyInfo.TakeTime).ToString("yyyy/MM/dd HH:mm"));
                            SendMessage(Convert.ToInt32(takeMoneyInfo.UserID), userInfo.PhoneNum, content);
                            ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('操作成功!');window.location.href='TakeMoney.aspx';", true);
                        }
                    }
                    if (e.CommandName.Equals("Remove"))//删除
                    {
                        //加入流水账表
                        lgk.Model.tb_journal model = new lgk.Model.tb_journal();
                        model.UserID        = takeMoneyInfo.UserID;
                        model.Remark        = "取消提现";
                        model.InAmount      = takeMoneyInfo.TakeMoney;
                        model.OutAmount     = 0;
                        model.BalanceAmount = dProfit + takeMoneyInfo.TakeMoney;
                        model.JournalDate   = DateTime.Now;
                        model.JournalType   = 1;
                        model.Journal01     = takeMoneyInfo.UserID;

                        bool bFalg = stockBLL.UpdateStockNumber(stockInfo.StockID, Convert.ToDecimal(takeMoneyInfo.TakeMoney), getParamAmount("shares5"), 1);

                        if (journalBLL.Add(model) > 0 && bFalg && takeBLL.Delete(ID))
                        {
                            MessageBox.MyShow(this, "取消成功");
                            BindData();
                        }
                        else
                        {
                            MessageBox.MyShow(this, "取消失败");
                        }
                    }
                }
            }
        }