示例#1
0
        //撤销挂卖订单
        public bool SellCancel(long userid, long orderid, out string message)
        {
            var user = userBLL.GetModel(userid);

            if (user.IsLock == 1)
            {
                message = "账户已冻结,撤销挂卖订单失败";
                return(false);
            }
            var cashsellinfo = cashsellBLL.GetModel(orderid);

            if (cashsellinfo == null)
            {
                message = "订单不存在";
                return(false);
            }
            if (cashsellinfo.IsSell == -1)
            {
                message = "订单已撤销,请勿重复操作";
                return(false);
            }
            else if (cashsellinfo.IsSell == 1)
            {
                message = "订单已完成,无法撤销";
                return(false);
            }
            else if (cashsellinfo.IsSell == 0)
            {
                int    SurplusNum = cashsellinfo.Number - cashsellinfo.SaleNum;
                string strRemark  = "卖家已撤销订单[" + cashsellinfo.OrderCode + "]的挂卖,返还剩余云图[" + SurplusNum + "]";
                //修改订单状态
                cashsellinfo.IsUndo = 1;
                cashsellinfo.IsSell = -1;
                cashsellBLL.Update(cashsellinfo);

                int iJtype = (int)Library.AccountType.云图;                                            //币种
                UpdateAccount("BonusAccount", userid, SurplusNum, iJtype);                           //终止交易,将云图返还卖家
                SetAccount(userid, Convert.ToDecimal(SurplusNum * 1.00), strRemark, userid, iJtype); //插入流水

                lgk.Model.SysLog log       = new lgk.Model.SysLog();                                 //日志
                lgk.BLL.SysLog   syslogBLL = new lgk.BLL.SysLog();
                log.LogMsg    = strRemark;
                log.LogType   = 24;                                 //
                log.LogLeve   = 0;                                  //
                log.LogDate   = DateTime.Now;
                log.LogCode   = "卖家已撤销订单";                          //
                log.IsDeleted = 0;
                log.Log1      = cashsellinfo.CashsellID.ToString(); //用户UserID
                log.Log2      = "";                                 // BrowserHelper.UserHostIP(this.Page);
                log.Log3      = "";                                 //BrowserHelper.UserHostName();
                log.Log4      = "";
                syslogBLL.Add(log);

                message = "撤销成功!";
                return(true);
            }

            message = "该订单不能撤销";
            return(false);
        }
示例#2
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (RegValidate())
            {
                var m_user = userBLL.GetModel(getID());
                //  m_user.BankAccount = this.txtBankAccount.Value.Trim();// "銀行賬號";
                //   m_user.BankAccountUser = this.txtBankAccountUser.Value.Trim();// "開户姓名";
                //   m_user.BankName = this.dropBank.SelectedValue;// "開户銀行";
                //    m_user.BankBranch = this.txtBankBranch.Value.Trim();// "支行名稱";
                //   m_user.BankInProvince = dropProvince.SelectedItem.Text;// "銀行所在省份";
                // m_user.BankInCity = DropDownList1.SelectedItem.Text;// "銀行所在城市";
                if (m_user.UserCode != this.txtUserCode.Value.Trim())
                {
                    var UserCode = this.txtUserCode.Value.Trim();
                    MySQL(string.Format(" update tb_user set RecommendCode = '" + UserCode + "',ParentCode== '" + UserCode + "' where UserCode = '" + m_user.UserCode + "' ")); //修改推荐人
                    MySQL(string.Format(" update tb_user set User006 = '" + UserCode + "' where UserCode = '" + m_user.UserCode + "' "));                                       //修改服务中心
                    MySQL(string.Format(" update tb_agent set AgentCode = '" + UserCode + "' where UserCode = '" + m_user.UserCode + "' "));                                    //修改报单中心数据

                    m_user.UserCode = UserCode;
                }

                m_user.NiceName = this.txtNickName.Value.Trim(); // "姓名";
                m_user.TrueName = this.txtTrueName.Value.Trim(); // "姓名";
                m_user.IdenCode = this.txtIdenCode.Value.Trim(); // "身份证號";
                //   m_user.PhoneNum = this.txtPhoneNum.Value;// "手机號碼";
                //   m_user.QQnumer = txtQQnumer.Value.Trim();//QQ
                //    m_user.Email = txtEmail.Value.Trim();//电子邮箱
                //m_user.SafetyCodeQuestion = DropDownList4.SelectedItem.Text;
                //m_user.SafetyCodeAnswer = DropDownList5.SelectedItem.Text;
                //   m_user.Address = txtAddress.Value;//聯系地址
                //  m_user.Email = txtEmail.Value;//郵編號碼
                //     m_user.User006 = txtQQnumer.Value;//QQ號碼
                // m_user.User010 = txtAlipay.Value.Trim(); //支付宝
                if (userBLL.Update(m_user))
                {
                    string ip = Page.Request.UserHostAddress;

                    lgk.Model.SysLog log       = new lgk.Model.SysLog();//日志
                    lgk.BLL.SysLog   syslogBLL = new lgk.BLL.SysLog();
                    log.LogMsg    = "";
                    log.LogType   = 11;                  //后台修改会员资料
                    log.LogLeve   = 0;                   //
                    log.LogDate   = DateTime.Now;
                    log.LogCode   = "后台修改会员资料";          //后台修改会员资料
                    log.IsDeleted = 0;
                    log.Log1      = LoginAdmin.UserName; //用户UserID
                    log.Log2      = ip;                  //
                    log.Log3      = m_user.UserID.ToString();
                    log.Log4      = "";
                    syslogBLL.Add(log);

                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('修改资料成功!');", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('修改资料失败!');", true);
                }
                ShowInfo();
            }
        }
示例#3
0
        //撤销挂卖订单
        public bool SellOrderCancel(long userid, long orderid, out string message)
        {
            string strWhere     = "UserID=" + userid + " and CashsellID = " + orderid;
            var    dt           = cashsellBLL.GetOrderList(strWhere);
            var    cashsellinfo = SellTableToList(dt.Tables[0]).FirstOrDefault();

            if (cashsellinfo == null)
            {
                message = "订单不存在";
                return(false);
            }
            var user = userBLL.GetModel(userid);

            if (user.IsLock == 1)
            {
                message = "账户已冻结,撤销挂卖订单失败";
                return(false);
            }
            if (cashsellinfo.Status.Equals("0"))
            {
                //  lgk.Model.Cashsell cashsellInfo = cashsellBLL.GetOrderList(cashorderInfo.CashbuyID);
                decimal dAccount   = decimal.Parse(cashsellinfo.Total);     // * cashorderInfo.;//每件数量*件数
                decimal dFactorage = decimal.Parse(cashsellinfo.TotalBond); //
                //decimal dFactorage = cashbuyInfo.Number * getParamAmount("Gold2") / 100;//手续费
                decimal dTotal = dAccount + dFactorage;

                string strRemark = "卖家已取消";
                var    sell      = cashsellBLL.GetModel(orderid);
                sell.IsUndo = 1;
                cashsellBLL.Update(sell);

                cashorderBLL.Update(strRemark, orderid, userid, 2);
                UpdateAccount("BonusAccount", userid, dTotal, 1);//终止交易,将EP币返还卖家

                SetAccount(userid, dTotal, strRemark, (int)Library.AccountType.购物分);

                lgk.Model.SysLog log       = new lgk.Model.SysLog();//日志
                lgk.BLL.SysLog   syslogBLL = new lgk.BLL.SysLog();
                log.LogMsg    = "卖家已取消订单【" + cashsellinfo.OrderCode + "】";
                log.LogType   = 24;                //
                log.LogLeve   = 0;                 //
                log.LogDate   = DateTime.Now;
                log.LogCode   = "卖家已取消订单";         //
                log.IsDeleted = 0;
                log.Log1      = userid.ToString(); //用户UserID
                log.Log2      = "";                // BrowserHelper.UserHostIP(this.Page);
                log.Log3      = "";                //BrowserHelper.UserHostName();
                log.Log4      = "";
                syslogBLL.Add(log);

                message = "卖家取消成功!";
                return(true);
            }

            message = "该订单不能撤销";
            return(false);
        }
示例#4
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (LoginUser.User005 == "1")
            {
                return;
            }

            if (RegValidate())
            {
                lgk.Model.tb_user m_user = userBLL.GetModel(GetUserID());

                m_user.BankAccount = this.txtBankAccount.Value.Trim();         // "銀行賬號";
                //if (string.IsNullOrEmpty(m_user.BankAccountUser))
                m_user.BankAccountUser = this.txtBankAccountUser.Value.Trim(); // "開户姓名";
                m_user.BankName        = this.dropBank.SelectedValue;          // "開户銀行";
                m_user.BankBranch      = this.txtBankBranch.Value.Trim();      // "支行名稱";
                m_user.BankInProvince  = dropProvince.SelectedItem.Text;       // "銀行所在省份";
                //m_user.BankInCity = city.Value;// "銀行所在城市";

                m_user.NiceName = this.txtNiceName.Value.Trim();// "姓名";
                //m_user.TrueName = this.txtTrueName.Value.Trim();// "姓名";
                // m_user.IdenCode = this.txtIdenCode.Text.Trim();// "身份证號";
                //m_user.PhoneNum = this.txtPhoneNum.Value;// "手机號碼";
                //m_user.QQnumer =txtQQnumer.Value.Trim();//QQ
                //m_user.Email = txtEmail.Text.Trim();//电子邮箱
                //m_user.Address = txtAddress.Value;//聯系地址
                m_user.User010 = txtAlipay.Value.Trim(); //支付宝

                m_user.User005 = "1";
                if (userBLL.Update(m_user))
                {
                    #region 日志
                    string ip = Page.Request.UserHostAddress;

                    lgk.Model.SysLog log       = new lgk.Model.SysLog();//日志
                    lgk.BLL.SysLog   syslogBLL = new lgk.BLL.SysLog();
                    log.LogMsg    = "";
                    log.LogType   = 5;                        //修改资料
                    log.LogLeve   = 0;                        //
                    log.LogDate   = DateTime.Now;
                    log.LogCode   = "修改资料";                   //订单编号
                    log.IsDeleted = 0;
                    log.Log1      = m_user.UserID.ToString(); //用户UserID
                    log.Log2      = ip;                       //
                    log.Log3      = "";
                    log.Log4      = "";
                    syslogBLL.Add(log);
                    #endregion
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("Modifications") + "');window.location.href='PersonalInfo.aspx'", true);//修改资料成功
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("FailedModify") + "');", true);//修改资料失败
                }
            }
        }
示例#5
0
        protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            long   id  = Convert.ToInt64(e.CommandArgument);
            string tag = e.CommandName;

            if (tag.Equals("cancel"))
            {
                lgk.Model.Cashbuy cashbuyInfo = cashbuyBLL.GetModel(id);
                if (cashbuyInfo == null)
                {
                    MessageBox.ShowBox(this.Page, "订单不存在", Library.Enums.ModalTypes.warning);
                    return;
                }
                if (cashbuyInfo.IsBuy == -1)
                {
                    MessageBox.ShowBox(this.Page, "订单已撤销,请勿重复操作", Library.Enums.ModalTypes.warning);
                    return;
                }
                else if (cashbuyInfo.IsBuy == 1)
                {
                    MessageBox.ShowBox(this.Page, "订单已完成,无法撤销", Library.Enums.ModalTypes.warning);
                    return;
                }
                else
                {
                    int     SurplusNum  = cashbuyInfo.Number - cashbuyInfo.BuyNum;
                    decimal iAmount     = SurplusNum * cashbuyInfo.Price;
                    string  strRemark   = "后台已撤销买入订单[" + cashbuyInfo.OrderCode + "],返还剩余云盾[" + iAmount + "]";
                    string  strRemarkEn = "The manager has revoked the buyer's order [" + cashbuyInfo.OrderCode + "] and returned the remaining YD [" + iAmount + "]";
                    //修改买入订单记录
                    cashbuyInfo.IsBuy = -1;//买家已取消
                    cashbuyBLL.Update(cashbuyInfo);

                    int iJtype = (int)Library.AccountType.云盾;                                                    //币种
                    UpdateAccount("BonusAccount", cashbuyInfo.UserID, iAmount, iJtype);                          //终止交易,将剩余花费的云盾返还买家
                    SetAccount(cashbuyInfo.UserID, iAmount, strRemark, strRemarkEn, cashbuyInfo.UserID, iJtype); //插入流水

                    lgk.Model.SysLog log       = new lgk.Model.SysLog();                                         //日志
                    lgk.BLL.SysLog   syslogBLL = new lgk.BLL.SysLog();
                    log.LogMsg    = "后台撤销买入订单【" + cashbuyInfo.OrderCode + "】";
                    log.LogType   = 25;                               //
                    log.LogLeve   = 0;                                //
                    log.LogDate   = DateTime.Now;
                    log.LogCode   = "后台撤销买入订单";                       //
                    log.IsDeleted = 0;
                    log.Log1      = cashbuyInfo.CashbuyID.ToString(); //用户UserID
                    log.Log2      = "";                               // BrowserHelper.UserHostIP(this.Page);
                    log.Log3      = "";                               //BrowserHelper.UserHostName();
                    log.Log4      = "";
                    syslogBLL.Add(log);

                    BindData();
                }
            }
        }
示例#6
0
        protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            long   id  = Convert.ToInt64(e.CommandArgument);
            string tag = e.CommandName;

            if (tag.Equals("cancel"))
            {
                lgk.Model.Cashsell cashsellInfo = cashsellBLL.GetModel(id);
                if (cashsellInfo == null)
                {
                    MessageBox.ShowBox(this.Page, "订单不存在", Library.Enums.ModalTypes.warning);
                    return;
                }
                if (cashsellInfo.IsSell == -1)
                {
                    MessageBox.ShowBox(this.Page, "订单已撤销,请勿重复操作", Library.Enums.ModalTypes.warning);
                    return;
                }
                else if (cashsellInfo.IsSell == 1)
                {
                    MessageBox.ShowBox(this.Page, "订单已完成,无法撤销", Library.Enums.ModalTypes.warning);
                    return;
                }
                else if (cashsellInfo.IsSell == 0)
                {
                    int    SurplusNum  = cashsellInfo.Number - cashsellInfo.SaleNum;
                    string strRemark   = "后台已撤销卖出订单[" + cashsellInfo.OrderCode + "],返还剩余云图[" + SurplusNum + "]";
                    string strRemarkEn = "The manager has revoked the seller's order [" + cashsellInfo.OrderCode + "] and returned the remaining YT [" + SurplusNum + "]";
                    //修改订单状态
                    cashsellInfo.IsUndo = 1;
                    cashsellInfo.IsSell = -1;
                    cashsellBLL.Update(cashsellInfo);

                    int iJtype = (int)Library.AccountType.云图;                                                                                   //币种
                    UpdateAccount("BonusAccount", cashsellInfo.UserID, SurplusNum, iJtype);                                                     //终止交易,将云图返还卖家
                    SetAccount(cashsellInfo.UserID, Convert.ToDecimal(SurplusNum * 1.00), strRemark, strRemarkEn, cashsellInfo.UserID, iJtype); //插入流水

                    lgk.Model.SysLog log       = new lgk.Model.SysLog();                                                                        //日志
                    lgk.BLL.SysLog   syslogBLL = new lgk.BLL.SysLog();
                    log.LogMsg    = strRemark;
                    log.LogType   = 24;                                 //
                    log.LogLeve   = 0;                                  //
                    log.LogDate   = DateTime.Now;
                    log.LogCode   = "卖家已撤销订单";                          //
                    log.IsDeleted = 0;
                    log.Log1      = cashsellInfo.CashsellID.ToString(); //用户UserID
                    log.Log2      = "";                                 // BrowserHelper.UserHostIP(this.Page);
                    log.Log3      = "";                                 //BrowserHelper.UserHostName();
                    log.Log4      = "";
                    syslogBLL.Add(log);

                    BindData();
                }
            }
        }
示例#7
0
        //撤销买入订单
        public bool BuyOrderCancel(long userid, long orderid, out string message)
        {
            string  strRemark = "";
            decimal dAccount  = Convert.ToDecimal(0.00);

            lgk.Model.Cashorder cashorderInfo = cashorderBLL.GetModel(orderid);
            lgk.Model.Cashbuy   cashbuyInfo   = cashbuyBLL.GetModel(cashorderInfo.CashbuyID);

            var user = userBLL.GetModel(userid);

            if (user.IsLock == 1)
            {
                message = "账户已冻结,撤销买入订单失败";
                return(false);
            }

            strRemark = "买家已取消";

            //加入流水账表
            if (userid == cashorderInfo.BUserID && cashorderInfo.BStatus == 0)
            {
                cashorderBLL.UndoOrder(orderid, strRemark);                       //买家撤销订单
                lgk.Model.Cashsell cashsellInfo = cashsellBLL.GetModel(cashorderInfo.CashsellID);
                cashsellInfo.SaleNum = cashsellInfo.SaleNum - cashbuyInfo.BuyNum; //减掉购买的金额,卖方继续挂卖
                cashsellBLL.Update(cashsellInfo);

                cashbuyInfo.IsBuy = -1;//买家已取消
                cashbuyBLL.Update(cashbuyInfo);

                lgk.Model.SysLog log       = new lgk.Model.SysLog();//日志
                lgk.BLL.SysLog   syslogBLL = new lgk.BLL.SysLog();
                log.LogMsg    = "买家已取消订单【" + cashorderInfo.OrderCode + "】";
                log.LogType   = 23;                               //
                log.LogLeve   = 0;                                //
                log.LogDate   = DateTime.Now;
                log.LogCode   = "买家已取消订单";                        //
                log.IsDeleted = 0;
                log.Log1      = cashorderInfo.BUserID.ToString(); //用户UserID
                log.Log2      = "";                               // BrowserHelper.UserHostIP(this.Page);
                log.Log3      = "";                               //BrowserHelper.UserHostName();
                log.Log4      = "";
                syslogBLL.Add(log);

                message = "买家取消成功";
                return(true);
            }

            message = "该订单不能撤销";
            return(false);
        }
示例#8
0
 private void WriteDBLog(string msg, int leve)
 {
     lgk.Model.SysLog log       = new lgk.Model.SysLog();//日志
     lgk.BLL.SysLog   syslogBLL = new lgk.BLL.SysLog();
     log.LogMsg    = msg;
     log.LogType   = 1;                 //后台登陆
     log.LogLeve   = leve;              // 0:提示,1:出错
     log.LogDate   = DateTime.Now;
     log.LogCode   = "后台登陆";            //后台登陆
     log.IsDeleted = 0;
     log.Log1      = txtUserName.Value; //用户UserID
     log.Log2      = BrowserHelper.UserHostIP(this.Page);
     log.Log3      = BrowserHelper.UserHostName();
     log.Log4      = "";
     syslogBLL.Add(log);
 }
示例#9
0
        protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            int iUserID = int.Parse(e.CommandArgument.ToString());

            lgk.Model.tb_user userInfo = userBLL.GetModel(iUserID);
            //lgk.Model.Stock stockInfo = stockBLL.GetModel("UserID=" + iUserID + "");
            if (e.CommandName == "Activate")
            {
                spd.jumpAdminUrl1(this.Page, 1);//跳转三级密码

                UserOpen(iUserID);
            }
            if (e.CommandName == "Into")
            {
                spd.jumpAdminUrl1(this.Page, 1);//跳转三级密码

                Session["goto_uid"] = iUserID;
                Security sec    = new Security();
                string   admins = LoginAdmin.ID.ToString(); //sec.EncryptQueryString("1");//加密传递的adminid
                string   userid = iUserID.ToString();       //sec.EncryptQueryString(iUserID.ToString());//加密传递的adminid
                //string _adminUrl = WebHelper.ServerCurrentDomain;
                //if (ConfigHelper.GetConfigBool("AdminUseRedirect"))
                //    _adminUrl = ConfigHelper.GetConfigString("AdminUrl");
                // Response.Write("<script>window.open('"+ _adminUrl + "/Login.aspx?adminid=" + admins + "&uid=" + userid + "')</script>");
                Response.Write("<script>window.open('../../Login.aspx?adminid=" + admins + "&uid=" + userid + "')</script>");
                return;
            }
            if (e.CommandName == "Lock")         //冻结
            {
                spd.jumpAdminUrl1(this.Page, 1); //跳转三级密码

                userInfo.IsLock = 1;
                userBLL.Update(userInfo);
                //if (stockInfo != null)
                //{
                //    stockInfo.IsLock = 1;
                //    stockBLL.Update(stockInfo);
                //}
                MessageBox.MyShow(this, "冻结成功!");
            }
            if (e.CommandName == "Open")         //解冻
            {
                spd.jumpAdminUrl1(this.Page, 1); //跳转三级密码

                userInfo.IsLock = 0;
                userBLL.Update(userInfo);
                //if (stockInfo!=null)
                //{
                //    stockInfo.Price = getParamAmount("Share5");
                //    stockInfo.IsLock = 0;
                //    stockBLL.Update(stockInfo);
                //}
                MessageBox.MyShow(this, "解冻成功!");
            }
            if (e.CommandName == "Batch")        //解冻
            {
                spd.jumpAdminUrl1(this.Page, 1); //跳转三级密码

                //userInfo.BillCount += 1;
                //userInfo.IsOut= 0;
                //userInfo.Emoney += Convert.ToDecimal(getParamAmount("consume" + userInfo.LevelID));
                //if (userBLL.Update(userInfo))
                //{
                //    MessageBox.MyShow(this, "复投成功!");
                //}else
                //{
                //    MessageBox.MyShow(this, "复投失败!");
                //}
            }
            if (e.CommandName == "modifypass")
            {
                userInfo.User005 = "0";
                if (userBLL.Update(userInfo))
                {
                    string ip = Page.Request.UserHostAddress;

                    lgk.Model.SysLog log       = new lgk.Model.SysLog();//日志
                    lgk.BLL.SysLog   syslogBLL = new lgk.BLL.SysLog();
                    log.LogMsg    = "设置允许修改资料";
                    log.LogType   = 3;                   //修改资料
                    log.LogLeve   = 0;                   //
                    log.LogDate   = DateTime.Now;
                    log.LogCode   = "1000";              //订单编号
                    log.IsDeleted = 0;
                    log.Log1      = LoginAdmin.UserName; //用户UserID
                    log.Log2      = ip;                  //
                    log.Log3      = userInfo.UserID.ToString();
                    log.Log4      = "";
                    syslogBLL.Add(log);

                    MessageBox.MyShow(this, "设置允许修改资料成功!");
                }
                else
                {
                    MessageBox.MyShow(this, "设置允许修改资料失败!");
                }
            }
            if (e.CommandName == "nomodify")
            {
                userInfo.User005 = "1";
                if (userBLL.Update(userInfo))
                {
                    string ip = Page.Request.UserHostAddress;

                    lgk.Model.SysLog log       = new lgk.Model.SysLog();//日志
                    lgk.BLL.SysLog   syslogBLL = new lgk.BLL.SysLog();
                    log.LogMsg    = "设置拒绝修改资料";
                    log.LogType   = 4;                   //修改资料
                    log.LogLeve   = 0;                   //
                    log.LogDate   = DateTime.Now;
                    log.LogCode   = "1001";              //订单编号
                    log.IsDeleted = 0;
                    log.Log1      = LoginAdmin.UserName; //用户UserID
                    log.Log2      = ip;                  //
                    log.Log3      = userInfo.UserID.ToString();
                    log.Log4      = "";
                    syslogBLL.Add(log);

                    MessageBox.MyShow(this, "设置拒绝修改资料成功!");
                }
                else
                {
                    MessageBox.MyShow(this, "设置拒绝修改资料失败!");
                }
            }
            BindData();
        }
示例#10
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            // if (RegValidate())
            {
                var m_user = userBLL.GetModel(getID());
                m_user.BankAccount     = this.txtBankAccount.Value.Trim();     // "銀行賬號";
                m_user.BankAccountUser = this.txtBankAccountUser.Value.Trim(); // "開户姓名";
                m_user.BankName        = this.dropBank.SelectedItem.Text;      // "開户銀行";
                m_user.BankBranch      = this.txtBankBranch.Value.Trim();      // "支行名稱";
                //m_user.BankInProvince = dropProvince.SelectedItem.Text;// "銀行所在省份";
                //m_user.BankInCity = DropDownList1.SelectedItem.Text;// "銀行所在城市";

                m_user.NiceName = this.txtNickName.Value.Trim(); // "姓名";
                m_user.TrueName = this.txtTrueName.Value.Trim(); // "姓名";
                m_user.Address  = this.txtPhoneNum.Value.Trim();

                string strIdenCode = txtIdenCode.Value.Trim(); //"身份证號";
                if (!m_user.IdenCode.Equals(strIdenCode))
                {
                    int ct = GetIDCodeNumber(strIdenCode);
                    if (ct >= 1)
                    {
                        MessageBox.ShowBox(this.Page, string.Format("该身份证號已注册"), Library.Enums.ModalTypes.warning);//该手机号码已注册
                        return;
                    }
                }
                m_user.IdenCode = this.txtIdenCode.Value.Trim(); //

                string strPhoneNum = txtPhoneNum.Value.Trim();   //手机号码
                if (!m_user.IdenCode.Equals(strPhoneNum))
                {
                    int ct = GetPhoneNumber(strPhoneNum);
                    if (ct >= 1)
                    {
                        MessageBox.ShowBox(this.Page, string.Format("该手机号码已注册"), Library.Enums.ModalTypes.warning);//
                        return;
                    }
                }
                m_user.PhoneNum = this.txtPhoneNum.Value; // "手机號碼";
                m_user.Address  = txtAddress.Value;       //聯系地址

                if (userBLL.Update(m_user))
                {
                    string ip = Page.Request.UserHostAddress;

                    lgk.Model.SysLog log       = new lgk.Model.SysLog();//日志
                    lgk.BLL.SysLog   syslogBLL = new lgk.BLL.SysLog();
                    log.LogMsg    = "";
                    log.LogType   = 11;                  //后台修改会员资料
                    log.LogLeve   = 0;                   //
                    log.LogDate   = DateTime.Now;
                    log.LogCode   = "后台修改会员资料";          //后台修改会员资料
                    log.IsDeleted = 0;
                    log.Log1      = LoginAdmin.UserName; //用户UserID
                    log.Log2      = ip;                  //
                    log.Log3      = m_user.UserID.ToString();
                    log.Log4      = "";
                    syslogBLL.Add(log);

                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('修改资料成功!');", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('修改资料失败!');", true);
                }
                ShowInfo();
            }
        }
示例#11
0
        protected void btnApply_Click(object sender, EventArgs e)
        {
            var usermodel = userBLL.GetModel(LoginUser.UserID);

            if (usermodel.User001 == 1)
            {
                MessageBox.ShowBox(this.Page, "您已开通分号", Library.Enums.ModalTypes.info);//您已开通分号
                return;
            }

            if (usermodel.IsOpend == 0)
            {
                MessageBox.ShowBox(this.Page, GetLanguage("AccountNoActiveInfo"), Library.Enums.ModalTypes.error);//您的帐号未激活
                return;
            }

            if (usermodel.IsLock == 1)
            {
                MessageBox.ShowBox(this.Page, GetLanguage("AccountLock"), GetLanguage("AccountLockInfo"), Library.Enums.ModalTypes.error);//您的帐号已冻结,不能进行操作
                return;
            }
            decimal amount = GetInvestAmount(LoginUser.UserID);

            if (amount < p_amount)
            {
                MessageBox.ShowBox(this.Page, "投资额度不足", Library.Enums.ModalTypes.warning);//投资额度不足
                return;
            }

            int recnum = usermodel.User003;

            if (recnum < p_recnum)
            {
                MessageBox.ShowBox(this.Page, "直推人数不足", Library.Enums.ModalTypes.warning);//直推人数不足
                return;
            }

            decimal trans = usermodel.ShopAccount;

            if (trans < p_trans)
            {
                MessageBox.ShowBox(this.Page, "释放币不足", Library.Enums.ModalTypes.warning);//释放币不足
                return;
            }

            usermodel.User001 = 1;
            userBLL.Update(usermodel);

            UpdateAccount("ShopAccount", usermodel.UserID, trans, 0);//
            //加入流水账表(现金币增加)
            lgk.Model.tb_journal journalInfo = new lgk.Model.tb_journal()
            {
                UserID        = usermodel.UserID,
                Remark        = "开通分号使用释放币",
                RemarkEn      = "Open Account ",
                InAmount      = 0,
                OutAmount     = p_trans,
                BalanceAmount = userBLL.GetMoney(usermodel.UserID, "ShopAccount"),
                JournalDate   = DateTime.Now,
                JournalType   = 2,
                Journal01     = usermodel.UserID
            };
            journalBLL.Add(journalInfo);

            #region 日志
            string ip = Page.Request.UserHostAddress;

            lgk.Model.SysLog log       = new lgk.Model.SysLog();//日志
            lgk.BLL.SysLog   syslogBLL = new lgk.BLL.SysLog();
            log.LogMsg    = "";
            log.LogType   = 22;                          //
            log.LogLeve   = 0;                           //
            log.LogDate   = DateTime.Now;
            log.LogCode   = "开通分号";                      //
            log.IsDeleted = 0;
            log.Log1      = usermodel.UserID.ToString(); //用户UserID
            log.Log2      = ip;                          //
            log.Log3      = "";
            log.Log4      = "";
            syslogBLL.Add(log);
            #endregion
            MessageBox.ShowBox(this.Page, "开通分号成功", Library.Enums.ModalTypes.success);//开通分号成功
        }
示例#12
0
        //撤销买入订单
        public bool BuyCancel(long userid, long orderid, out string message)
        {
            var user = userBLL.GetModel(userid);

            if (user == null)
            {
                message = "账户不存在";
                return(false);
            }
            if (user.IsLock == 1)
            {
                message = "账户已冻结,撤销买入订单失败";
                return(false);
            }

            lgk.Model.Cashbuy cashbuyInfo = cashbuyBLL.GetModel(orderid);
            if (cashbuyInfo == null)
            {
                message = "订单不存在";
                return(false);
            }
            if (cashbuyInfo.IsBuy == -1)
            {
                message = "订单已撤销,请勿重复操作";
                return(false);
            }
            else if (cashbuyInfo.IsBuy == 1)
            {
                message = "订单已完成,无法撤销";
                return(false);
            }
            else
            {
                int     SurplusNum = cashbuyInfo.Number - cashbuyInfo.BuyNum;
                decimal iAmount    = SurplusNum * cashbuyInfo.Price;
                string  strRemark  = "买家已撤销订单[" + cashbuyInfo.OrderCode + "]的买入,返还剩余云盾[" + iAmount + "]";

                //修改买入订单记录
                cashbuyInfo.IsBuy = -1;//买家已取消
                cashbuyBLL.Update(cashbuyInfo);

                int iJtype = (int)Library.AccountType.云盾;               //币种
                UpdateAccount("BonusAccount", userid, iAmount, iJtype); //终止交易,将剩余花费的云盾返还买家
                SetAccount(userid, iAmount, strRemark, userid, iJtype); //插入流水

                lgk.Model.SysLog log       = new lgk.Model.SysLog();    //日志
                lgk.BLL.SysLog   syslogBLL = new lgk.BLL.SysLog();
                log.LogMsg    = "买家撤销订单【" + cashbuyInfo.OrderCode + "】";
                log.LogType   = 23;                               //
                log.LogLeve   = 0;                                //
                log.LogDate   = DateTime.Now;
                log.LogCode   = "买家撤销订单";                         //
                log.IsDeleted = 0;
                log.Log1      = cashbuyInfo.CashbuyID.ToString(); //用户UserID
                log.Log2      = "";                               // BrowserHelper.UserHostIP(this.Page);
                log.Log3      = "";                               //BrowserHelper.UserHostName();
                log.Log4      = "";
                syslogBLL.Add(log);

                message = "买家撤销成功";
                return(true);
            }
        }
示例#13
0
        protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            int iOrderID = Convert.ToInt32(e.CommandArgument);

            if (e.CommandName == "Undo")
            {
                lgk.Model.Cashorder cashorderInfo = cashorderBLL.GetModel(iOrderID);
                if (cashorderInfo != null)
                {
                    cashorderBLL.UndoOrder(iOrderID, "后台撤销订单");//后台撤销订单

                    lgk.Model.Cashsell cashsellInfo = cashsellBLL.GetModel(cashorderInfo.CashsellID);
                    lgk.Model.Cashbuy  cashbuyInfo  = cashbuyBLL.GetModel(cashorderInfo.CashbuyID);
                    cashbuyInfo.IsBuy = -1;//撤销
                    cashbuyBLL.Update(cashbuyInfo);

                    decimal dAccount = Convert.ToDecimal(cashsellInfo.Number);                            // + cashsellInfo.Charge;//数量+手续费
                    UpdateAccount("ShopAccount", cashsellInfo.UserID, dAccount + cashsellInfo.Charge, 1); //返还金币 + 保证金
                    //  UpdateAccount("ShopAccount", cashsellInfo.UserID, cashsellInfo.Charge, 1);//返还

                    //SetAccount(iUserID, dAccount, "EP币发货!", 1);
                    SetAccount(cashsellInfo.UserID, dAccount, "后台撤销订单,返回交易币!", cashsellInfo.UserID, (int)Library.AccountType.购物分, "ShopAccount");

                    //if (cashorderInfo.SStatus == 0 && cashorderInfo.BStatus == 0)
                    //{
                    //    userBLL.UserLock(cashorderInfo.BUserID, 1);
                    //}
                    //else
                    //{
                    //    userBLL.UserLock(cashorderInfo.SUserID, 1);
                    //    userBLL.UserLock(cashorderInfo.BUserID, 1);
                    //}

                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('撤销成功!');window.location.href='CashOrderList.aspx';", true);
                }
            }

            if (e.CommandName == "Payfor")
            {
                lgk.Model.Cashorder cashorderInfo = cashorderBLL.GetModel(iOrderID);
                if (cashorderInfo != null)
                {
                    cashorderBLL.Update(cashorderInfo.SUserID, cashorderInfo.OrderID, DateTime.Now, "", "", 2); //确认已付款

                    cashorderBLL.Update(cashorderInfo.SUserID, iOrderID, DateTime.Now, "", "", 3);              //发货

                    lgk.Model.Cashbuy cashbuyInfo = cashbuyBLL.GetModel(cashorderInfo.CashbuyID);
                    cashbuyInfo.IsBuy = 2;//完成
                    cashbuyBLL.Update(cashbuyInfo);

                    lgk.Model.Cashsell CashsellInfo = cashsellBLL.GetModel(cashbuyInfo.CashsellID);
                    int buyNum = cashorderBLL.GetOrderBuyNumber(cashbuyInfo.CashsellID);
                    if (buyNum == CashsellInfo.Number)
                    {
                        CashsellInfo.IsSell = 2;//完成
                        cashsellBLL.Update(CashsellInfo);
                    }

                    decimal dNumber = CashsellInfo.Number;
                    //decimal dCharge = CashsellInfo.Charge;//总手续费
                    //decimal dMTaxRate = dNumber * getParamAmount("Gold3") / 100;//买家获得手续费
                    // decimal dCTaxRate = dNumber * getParamAmount("Gold4") / 100;//公司获得手续费

                    //decimal dTNumber = dNumber - dCharge + dMTaxRate;
                    decimal dTNumber = dNumber; // + dMTaxRate;
                    // decimal give = dTNumber * getParamAmount("Gold10") / 100; //买入获得系统赠送
                    // dTNumber += give; //买入获得系统赠送2018-3-15
                    //买家得到的是投资积分 StockMoney
                    UpdateAccount("ShopAccount", cashorderInfo.BUserID, dTNumber, 1);//发货给购买者

                    //UpdateSystemAccount("MoneyAccount", dCTaxRate, 1);

                    ////SetAccount(iUserID, dAccount, "EP币发货!", 1);
                    SetAccount(cashorderInfo.BUserID, dTNumber, "金币收货!", cashorderInfo.SUserID, (int)Library.AccountType.购物分, "ShopAccount");
                    UpdateGLmoney(cashorderInfo.BUserID, dTNumber, 1); //更新能量值 买方
                    UpdateGLmoney(cashorderInfo.SUserID, dTNumber, 0); //更新能量值 卖方

                    //扣除交易币到购物币
                    var userBuy = userBLL.GetModel(cashorderInfo.BUserID);
                    if (userBuy.GLmoney <= 0)
                    {
                        decimal lessthenRate   = getParamAmount("Gold11");                          //能量值小于等于0时,每次购买交易币扣除
                        decimal shoppingAmount = dTNumber * lessthenRate / 100;
                        UpdateAccount("ShopAccount", cashorderInfo.BUserID, shoppingAmount, 0);     //交易币
                        UpdateAccount("AllBonusAccount", cashorderInfo.BUserID, shoppingAmount, 1); //购物币
                        SetOutAccount(cashorderInfo.BUserID, shoppingAmount, "能量值小于0,扣除交易币到购物币。", cashorderInfo.BUserID, (int)Library.AccountType.购物分, "ShopAccount");
                        SetAccount(cashorderInfo.BUserID, shoppingAmount, "能量值小于0,扣除交易币到购物币。", cashorderInfo.BUserID, (int)Library.AccountType.购物分, "AllBonusAccount");
                    }
                    else
                    {
                        decimal greaterthenRate = getParamAmount("Gold10");                         //能量值大于0时,每次购买交易币扣除
                        decimal shoppingAmount  = dTNumber * greaterthenRate / 100;
                        UpdateAccount("ShopAccount", cashorderInfo.BUserID, shoppingAmount, 0);     //交易币
                        UpdateAccount("AllBonusAccount", cashorderInfo.BUserID, shoppingAmount, 1); //购物币
                        SetOutAccount(cashorderInfo.BUserID, shoppingAmount, "能量值大于0,扣除交易币到购物币。", cashorderInfo.BUserID, (int)Library.AccountType.购物分, "ShopAccount");
                        SetAccount(cashorderInfo.BUserID, shoppingAmount, "能量值大于0,扣除交易币到购物币。", cashorderInfo.BUserID, (int)Library.AccountType.购物分, "AllBonusAccount");
                    }
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("Successful") + "');window.location.href='CashOrderList.aspx';", true);
                }
            }

            if (e.CommandName == "Send")
            {
                lgk.Model.Cashorder cashorderInfo = cashorderBLL.GetModel(iOrderID);
                if (cashorderInfo != null)
                {
                    cashorderBLL.Update(cashorderInfo.SUserID, iOrderID, DateTime.Now, "", "", 3);//发货

                    lgk.Model.Cashbuy cashbuyInfo = cashbuyBLL.GetModel(cashorderInfo.CashbuyID);
                    cashbuyInfo.IsBuy = 2;//完成
                    cashbuyBLL.Update(cashbuyInfo);

                    lgk.Model.Cashsell CashsellInfo = cashsellBLL.GetModel(cashbuyInfo.CashsellID);
                    int buyNum = cashorderBLL.GetOrderBuyNumber(cashbuyInfo.CashsellID);
                    if (buyNum == CashsellInfo.Number)
                    {
                        CashsellInfo.IsSell = 2;//完成
                        cashsellBLL.Update(CashsellInfo);
                    }

                    decimal dNumber = cashbuyInfo.Number;
                    //decimal dCharge = CashsellInfo.Charge;//总手续费
                    //decimal dMTaxRate = dNumber * getParamAmount("Gold3") / 100;//买家获得手续费
                    //decimal dCTaxRate = dNumber * getParamAmount("Gold4") / 100;//公司获得手续费

                    decimal dTNumber = dNumber;// + dMTaxRate;
                    // decimal give = dTNumber * getParamAmount("Gold10") / 100; //买入获得系统赠送
                    //  dTNumber += give; //买入获得系统赠送2018-3-15
                    //买家得到的是投资积分 StockMoney
                    UpdateAccount("ShopAccount", cashorderInfo.BUserID, dTNumber, 1);//发货给购买者

                    // UpdateSystemAccount("MoneyAccount", dCTaxRate, 1);

                    ////SetAccount(iUserID, dAccount, "EP币发货!", 1);
                    SetAccount(cashorderInfo.BUserID, dTNumber, "金币发货!", cashorderInfo.SUserID, (int)Library.AccountType.购物分, "ShopAccount");
                    //更新能量值
                    UpdateGLmoney(cashorderInfo.BUserID, dTNumber, 1); //更新能量值 买方
                    UpdateGLmoney(cashorderInfo.SUserID, dTNumber, 0); //更新能量值 卖方

                    //扣除交易币到购物币
                    var userBuy = userBLL.GetModel(cashorderInfo.BUserID);
                    if (userBuy.GLmoney <= 0)
                    {
                        decimal lessthenRate   = getParamAmount("Gold11");                          //能量值小于等于0时,每次购买交易币扣除
                        decimal shoppingAmount = dTNumber * lessthenRate / 100;
                        UpdateAccount("ShopAccount", cashorderInfo.BUserID, shoppingAmount, 0);     //交易币
                        UpdateAccount("AllBonusAccount", cashorderInfo.BUserID, shoppingAmount, 1); //购物币
                        SetOutAccount(cashorderInfo.BUserID, shoppingAmount, "能量值小于0,扣除交易币到购物币。", cashorderInfo.BUserID, (int)Library.AccountType.购物分, "ShopAccount");
                        SetAccount(cashorderInfo.BUserID, shoppingAmount, "能量值小于0,扣除交易币到购物币。", cashorderInfo.BUserID, (int)Library.AccountType.购物分, "AllBonusAccount");
                    }
                    else
                    {
                        decimal greaterthenRate = getParamAmount("Gold10");                         //能量值大于0时,每次购买交易币扣除
                        decimal shoppingAmount  = dTNumber * greaterthenRate / 100;
                        UpdateAccount("ShopAccount", cashorderInfo.BUserID, shoppingAmount, 0);     //交易币
                        UpdateAccount("AllBonusAccount", cashorderInfo.BUserID, shoppingAmount, 1); //购物币
                        SetOutAccount(cashorderInfo.BUserID, shoppingAmount, "能量值大于0,扣除交易币到购物币。", cashorderInfo.BUserID, (int)Library.AccountType.购物分, "ShopAccount");
                        SetAccount(cashorderInfo.BUserID, shoppingAmount, "能量值大于0,扣除交易币到购物币。", cashorderInfo.BUserID, (int)Library.AccountType.购物分, "AllBonusAccount");
                    }
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('发货成功!');window.location.href='CashOrderList.aspx';", true);
                }
            }
            if (e.CommandName == "AdjustNoPay")
            {
                lgk.Model.Cashorder cashorderInfo = cashorderBLL.GetModel(iOrderID);
                if (cashorderInfo != null)
                {
                    cashorderBLL.UndoOrder(iOrderID, "后台撤销订单");//后台撤销订单

                    lgk.Model.Cashbuy cashbuyInfo = cashbuyBLL.GetModel(cashorderInfo.CashbuyID);
                    cashbuyInfo.IsBuy = -1;//撤销
                    cashbuyBLL.Update(cashbuyInfo);

                    lgk.Model.Cashsell cashsellInfo = cashsellBLL.GetModel(cashorderInfo.CashsellID);
                    //decimal dAccount = Convert.ToDecimal(cashbuyInfo.Amount);// + cashsellInfo.Charge;//数量+手续费
                    cashsellInfo.SaleNum = cashsellInfo.SaleNum - cashbuyInfo.BuyNum; //减掉购买的金额,卖方继续挂卖
                    cashsellBLL.Update(cashsellInfo);



                    //UpdateAccount("BonusAccount", cashsellInfo.UserID, dAccount, 1);//返还金币
                    //UpdateAccount("ShopAccount", cashsellInfo.UserID, cashsellInfo.Charge, 1);//返还金币

                    //SetAccount(iUserID, dAccount, "EP币发货!", 1);
                    // SetAccount(cashsellInfo.UserID, dAccount, "后台撤销订单,返回现金积分!", cashsellInfo.UserID, (int)Library.AccountType.现金积分);
                    // SetAccount(cashsellInfo.UserID, dAccount, "后台撤销订单,返回交易码!", cashsellInfo.UserID, (int)Library.AccountType.交易码);

                    //冻结买家
                    var user = userBLL.GetModel(cashorderInfo.BUserID);
                    user.IsLock = 1;
                    userBLL.Update(user);

                    lgk.Model.SysLog log       = new lgk.Model.SysLog();//日志
                    lgk.BLL.SysLog   syslogBLL = new lgk.BLL.SysLog();
                    log.LogMsg    = "后台裁决买家【" + cashorderInfo.OrderCode + "】未付款,冻结帐号";
                    log.LogType   = 23;                               //
                    log.LogLeve   = 0;                                //
                    log.LogDate   = DateTime.Now;
                    log.LogCode   = "后台裁决买家未付款冻结帐号";                  //
                    log.IsDeleted = 0;
                    log.Log1      = cashorderInfo.BUserID.ToString(); //用户UserID
                    log.Log2      = BrowserHelper.UserHostIP(this.Page);
                    log.Log3      = BrowserHelper.UserHostName();
                    log.Log4      = "";
                    syslogBLL.Add(log);

                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('操作成功!');window.location.href='CashOrderList.aspx';", true);
                }
            }
            if (e.CommandName == "AdjustReceived")
            {
                lgk.Model.Cashorder cashorderInfo = cashorderBLL.GetModel(iOrderID);
                if (cashorderInfo != null)
                {
                    cashorderBLL.Update(cashorderInfo.SUserID, cashorderInfo.OrderID, DateTime.Now, "", "", 2); //确认已付款

                    cashorderBLL.Update(cashorderInfo.SUserID, iOrderID, DateTime.Now, "", "", 3);              //发货

                    lgk.Model.Cashbuy cashbuyInfo = cashbuyBLL.GetModel(cashorderInfo.CashbuyID);
                    cashbuyInfo.IsBuy = 2;//完成
                    cashbuyBLL.Update(cashbuyInfo);

                    lgk.Model.Cashsell CashsellInfo = cashsellBLL.GetModel(cashbuyInfo.CashsellID);
                    int buyNum = cashorderBLL.GetOrderBuyNumber(cashbuyInfo.CashsellID);
                    if (buyNum == CashsellInfo.Number)
                    {
                        CashsellInfo.IsSell = 2;//完成
                        cashsellBLL.Update(CashsellInfo);
                    }

                    decimal dNumber = cashbuyInfo.Amount;

                    decimal dTNumber = dNumber; // + dMTaxRate;
                    // decimal give = dTNumber * getParamAmount("Gold10") / 100; //买入获得系统赠送
                    // dTNumber += give; //买入获得系统赠送
                    //买家得到的是投资积分 StockMoney
                    UpdateAccount("ShopAccount", cashorderInfo.BUserID, dTNumber, 1);//发货给购买者

                    SetAccount(cashorderInfo.BUserID, dTNumber, "金币收货!", cashorderInfo.SUserID, (int)Library.AccountType.购物分, "ShopAccount");


                    //更新能量值
                    UpdateGLmoney(cashorderInfo.BUserID, dTNumber, 1); //更新能量值 买方
                    UpdateGLmoney(cashorderInfo.SUserID, dTNumber, 0); //更新能量值 卖方
                    //扣除交易币到购物币
                    var userBuy = userBLL.GetModel(cashorderInfo.BUserID);
                    if (userBuy.GLmoney <= 0)
                    {
                        decimal lessthenRate   = getParamAmount("Gold11");                          //能量值小于等于0时,每次购买交易币扣除
                        decimal shoppingAmount = dTNumber * lessthenRate / 100;
                        UpdateAccount("ShopAccount", cashorderInfo.BUserID, shoppingAmount, 0);     //交易币
                        UpdateAccount("AllBonusAccount", cashorderInfo.BUserID, shoppingAmount, 1); //购物币
                        SetOutAccount(cashorderInfo.BUserID, shoppingAmount, "能量值小于0,扣除交易币到购物币。", cashorderInfo.BUserID, (int)Library.AccountType.购物分, "ShopAccount");
                        SetAccount(cashorderInfo.BUserID, shoppingAmount, "能量值小于0,扣除交易币到购物币。", cashorderInfo.BUserID, (int)Library.AccountType.购物分, "AllBonusAccount");
                    }
                    else
                    {
                        decimal greaterthenRate = getParamAmount("Gold10");                         //能量值大于0时,每次购买交易币扣除
                        decimal shoppingAmount  = dTNumber * greaterthenRate / 100;
                        UpdateAccount("ShopAccount", cashorderInfo.BUserID, shoppingAmount, 0);     //交易币
                        UpdateAccount("AllBonusAccount", cashorderInfo.BUserID, shoppingAmount, 1); //购物币
                        SetOutAccount(cashorderInfo.BUserID, shoppingAmount, "能量值大于0,扣除交易币到购物币。", cashorderInfo.BUserID, (int)Library.AccountType.购物分, "ShopAccount");
                        SetAccount(cashorderInfo.BUserID, shoppingAmount, "能量值大于0,扣除交易币到购物币。", cashorderInfo.BUserID, (int)Library.AccountType.购物分, "AllBonusAccount");
                    }

                    //冻结卖家
                    var user = userBLL.GetModel(cashorderInfo.SUserID);
                    user.IsLock = 1;
                    userBLL.Update(user);

                    lgk.Model.SysLog log       = new lgk.Model.SysLog();//日志
                    lgk.BLL.SysLog   syslogBLL = new lgk.BLL.SysLog();
                    log.LogMsg    = "后台裁决卖家订单【" + cashorderInfo.OrderCode + "】未付款,冻结帐号";
                    log.LogType   = 24;                               //
                    log.LogLeve   = 0;                                //
                    log.LogDate   = DateTime.Now;
                    log.LogCode   = "后台裁决卖家未付款冻结帐号";                  //
                    log.IsDeleted = 0;
                    log.Log1      = cashorderInfo.SUserID.ToString(); //用户UserID
                    log.Log2      = BrowserHelper.UserHostIP(this.Page);
                    log.Log3      = BrowserHelper.UserHostName();
                    log.Log4      = "";
                    syslogBLL.Add(log);

                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("Successful") + "');window.location.href='CashOrderList.aspx';", true);
                }
            }
        }
示例#14
0
        private bool UpdateParam(int id, HtmlInputText valuemoney, out string msg)
        {
            decimal value = 0;

            lgk.Model.tb_globeParam paramInfo = paramBLL.GetModel(id);
            string s = "\r\n" + "\r\n" + "\r\n" + "\r\n" + "记录时间" + DateTime.Now.ToString() + "\r\n";

            if (paramInfo != null)
            {
                // 错误的信息
                IPAddress ads = Dns.GetHostAddresses(Environment.MachineName)[0];
                string    ip  = Page.Request.UserHostAddress;
                s = s + "操作mac:" + ads.ToString() + ",操作IP" + ip + ",操作人::" + getLoginID() + ",修改字段:" + paramInfo.ParamName + ",修改前的值:" + paramInfo.ParamVarchar + ",修改后的值:" + valuemoney.Value + "\r\n";

                string strRemark = paramInfo.Remark.Replace("</font>", "").Replace("<font color=\"red\">", "").Replace("&gt;", ">");
                if (strRemark.IndexOf(">>") > 0)
                {
                    strRemark = strRemark.Remove(0, strRemark.IndexOf(">>") + 2);
                }
                msg = "更新完成[" + strRemark + "]\\n";
                if (valuemoney.Value == "")
                {
                    msg = "请输入参数值[" + strRemark + "]\\n"; return(false);
                }

                lgk.Model.SysLog log       = new lgk.Model.SysLog();//日志
                lgk.BLL.SysLog   syslogBLL = new lgk.BLL.SysLog();
                log.LogMsg    = strRemark + ",修改前值:" + paramInfo.ParamVarchar + ",修改后值:" + valuemoney.Value;
                log.LogType   = 10;                  //修改参数
                log.LogLeve   = 0;                   //
                log.LogDate   = DateTime.Now;
                log.LogCode   = "修改参数";              //修改参数
                log.IsDeleted = 0;
                log.Log1      = LoginAdmin.UserName; //用户UserID
                log.Log2      = ip;                  //
                log.Log3      = paramInfo.ParamName; //修改字段
                log.Log4      = ads.ToString();
                syslogBLL.Add(log);

                if (paramInfo.ParamType == 1)//Decimal
                {
                    try
                    {
                        value = Convert.ToDecimal(valuemoney.Value);
                    }
                    catch
                    {
                        msg = "参数格式错误[" + strRemark + "]\\n"; return(false);
                    }
                    if (value < 0)
                    {
                        msg = "请输入大于等于0的参数[" + strRemark + "]\\n"; return(false);
                    }
                }
                else if (paramInfo.ParamType == 2)//Int
                {
                    try
                    {
                        value = Convert.ToInt32(valuemoney.Value);
                    }
                    catch
                    {
                        msg = "请输入整数[" + strRemark + "]\\n"; return(false);
                    }
                }
                else if (paramInfo.ParamType == 3)//Decimal
                {
                    value = Convert.ToDecimal(valuemoney.Value);

                    if (value > 100)
                    {
                        msg = "比率不能大于100%的参数[" + strRemark + "]\\n"; return(false);
                    }
                }

                if (paramInfo.ParamType <= 3)
                {
                    paramInfo.ParamVarchar = value.ToString();
                }
                else if (paramInfo.ParamType == 4)
                {
                    paramInfo.ParamVarchar = valuemoney.Value;
                }
                LogHelper.SaveLog(s, "Param");
                //paramInfo.ParamVarchar = paramInfo.ParamType == 1 ? valuemoney.Value : value.ToString();
                // System.IO.File.AppendAllText(Server.MapPath("~/log/ParamRecodelog.log"), s);
                if (!paramBLL.Update(paramInfo))
                {
                    msg = "更新出错[" + strRemark + "]\\n";
                }
                return(false);
            }
            else
            {
                msg = "数据不存在,无法更新!";
            }

            return(true);
        }
示例#15
0
        protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            int iOrderID = Convert.ToInt32(e.CommandArgument);

            if (e.CommandName == "Undo")
            {
                lgk.Model.Cashorder cashorderInfo = cashorderBLL.GetModel(iOrderID);
                if (cashorderInfo != null)
                {
                    lgk.Model.Cashsell cashsellInfo = cashsellBLL.GetModel(cashorderInfo.CashsellID);
                    decimal            dAccount     = Convert.ToDecimal(cashsellInfo.Number);              // + cashsellInfo.Charge;//数量+手续费
                    UpdateAccount("BonusAccount", cashsellInfo.UserID, dAccount + cashsellInfo.Charge, 1); //返还金币
                    // UpdateAccount("ShopAccount", cashsellInfo.UserID, cashsellInfo.Charge, 1);//返还金币

                    //SetAccount(iUserID, dAccount, "EP币发货!", 1);
                    //SetAccount(cashsellInfo.UserID, dAccount + cashsellInfo.Charge, "后台撤销订单,返回现金积分!", cashsellInfo.UserID, (int)Library.AccountType.云图);
                    //SetAccount(cashsellInfo.UserID, dAccount, "后台撤销订单,返回云图!", cashsellInfo.UserID, (int)Library.AccountType.云图);

                    //if (cashorderInfo.SStatus == 0 && cashorderInfo.BStatus == 0)
                    //{
                    //    userBLL.UserLock(cashorderInfo.BUserID, 1);
                    //}
                    //else
                    //{
                    //    userBLL.UserLock(cashorderInfo.SUserID, 1);
                    //    userBLL.UserLock(cashorderInfo.BUserID, 1);
                    //}

                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('撤销成功!');window.location.href='CashOrderList.aspx';", true);
                }
            }

            if (e.CommandName == "Payfor")
            {
                lgk.Model.Cashorder cashorderInfo = cashorderBLL.GetModel(iOrderID);
                if (cashorderInfo != null)
                {
                    lgk.Model.Cashbuy cashbuyInfo = cashbuyBLL.GetModel(cashorderInfo.CashbuyID);

                    //lgk.Model.Cashsell CashsellInfo = cashsellBLL.GetModel(cashbuyInfo.CashsellID);

                    //decimal dNumber = CashsellInfo.Number;
                    //decimal dCharge = CashsellInfo.Charge;//总手续费
                    //decimal dMTaxRate = dNumber * getParamAmount("Gold3") / 100;//买家获得手续费
                    // decimal dCTaxRate = dNumber * getParamAmount("Gold4") / 100;//公司获得手续费

                    //decimal dTNumber = dNumber - dCharge + dMTaxRate;
                    //decimal dTNumber = dNumber; // + dMTaxRate;
                    //买家得到的是投资积分 StockMoney
                    //UpdateAccount("BonusAccount", cashorderInfo.BUserID, dTNumber, 1);//发货给购买者

                    //UpdateSystemAccount("MoneyAccount", dCTaxRate, 1);

                    ////SetAccount(iUserID, dAccount, "EP币发货!", 1);
                    //SetAccount(cashorderInfo.BUserID, dTNumber, "金币收货!", cashorderInfo.SUserID, (int)Library.AccountType.云图);

                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("Successful") + "');window.location.href='CashOrderList.aspx';", true);
                }
            }

            if (e.CommandName == "Send")
            {
                lgk.Model.Cashorder cashorderInfo = cashorderBLL.GetModel(iOrderID);
                if (cashorderInfo != null)
                {
                    lgk.Model.Cashbuy cashbuyInfo = cashbuyBLL.GetModel(cashorderInfo.CashbuyID);
                    //decimal dAccount = Convert.ToDecimal(cashbuyInfo.Number * cashbuyInfo.BuyNum);//每件数量*件数

                    //decimal dNumber = CashsellInfo.Number;
                    //decimal dCharge = CashsellInfo.Charge;//总手续费
                    //decimal dMTaxRate = dNumber * getParamAmount("Gold3") / 100;//买家获得手续费
                    //decimal dCTaxRate = dNumber * getParamAmount("Gold4") / 100;//公司获得手续费

                    //decimal dTNumber = dNumber;// + dMTaxRate;
                    //买家得到的是投资积分 StockMoney
                    //UpdateAccount("BonusAccount", cashorderInfo.BUserID, dTNumber, 1);//发货给购买者

                    // UpdateSystemAccount("MoneyAccount", dCTaxRate, 1);

                    ////SetAccount(iUserID, dAccount, "EP币发货!", 1);
                    //SetAccount(cashorderInfo.BUserID, dTNumber, "金币发货!", cashorderInfo.SUserID, (int)Library.AccountType.云图);

                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('发货成功!');window.location.href='CashOrderList.aspx';", true);
                }
            }
            if (e.CommandName == "AdjustNoPay")
            {
                lgk.Model.Cashorder cashorderInfo = cashorderBLL.GetModel(iOrderID);
                if (cashorderInfo != null)
                {
                    lgk.Model.Cashbuy  cashbuyInfo  = cashbuyBLL.GetModel(cashorderInfo.CashbuyID);
                    lgk.Model.Cashsell cashsellInfo = cashsellBLL.GetModel(cashorderInfo.CashsellID);
                    //decimal dAccount = Convert.ToDecimal(cashbuyInfo.Amount);// + cashsellInfo.Charge;//数量+手续费
                    cashsellInfo.SaleNum = cashsellInfo.SaleNum - cashbuyInfo.BuyNum; //减掉购买的金额,卖方继续挂卖
                    cashsellBLL.Update(cashsellInfo);

                    //UpdateAccount("BonusAccount", cashsellInfo.UserID, dAccount, 1);//返还金币
                    //UpdateAccount("ShopAccount", cashsellInfo.UserID, cashsellInfo.Charge, 1);//返还金币

                    //SetAccount(iUserID, dAccount, "EP币发货!", 1);
                    // SetAccount(cashsellInfo.UserID, dAccount, "后台撤销订单,返回现金积分!", cashsellInfo.UserID, (int)Library.AccountType.现金积分);
                    // SetAccount(cashsellInfo.UserID, dAccount, "后台撤销订单,返回云图!", cashsellInfo.UserID, (int)Library.AccountType.云图);

                    //冻结买家
                    var user = userBLL.GetModel(cashorderInfo.BUserID);
                    user.IsLock = 1;
                    userBLL.Update(user);

                    lgk.Model.SysLog log       = new lgk.Model.SysLog();//日志
                    lgk.BLL.SysLog   syslogBLL = new lgk.BLL.SysLog();
                    log.LogMsg    = "后台裁决买家【" + cashorderInfo.OrderCode + "】未付款,冻结帐号";
                    log.LogType   = 23;                               //
                    log.LogLeve   = 0;                                //
                    log.LogDate   = DateTime.Now;
                    log.LogCode   = "后台裁决买家未付款冻结帐号";                  //
                    log.IsDeleted = 0;
                    log.Log1      = cashorderInfo.BUserID.ToString(); //用户UserID
                    log.Log2      = BrowserHelper.UserHostIP(this.Page);
                    log.Log3      = BrowserHelper.UserHostName();
                    log.Log4      = "";
                    syslogBLL.Add(log);

                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('操作成功!');window.location.href='CashOrderList.aspx';", true);
                }
            }
            if (e.CommandName == "AdjustReceived")
            {
                lgk.Model.Cashorder cashorderInfo = cashorderBLL.GetModel(iOrderID);
                if (cashorderInfo != null)
                {
                    lgk.Model.Cashbuy cashbuyInfo = cashbuyBLL.GetModel(cashorderInfo.CashbuyID);

                    //lgk.Model.Cashsell CashsellInfo = cashsellBLL.GetModel(cashbuyInfo.CashsellID);

                    decimal dNumber = cashbuyInfo.Amount;

                    decimal dTNumber = dNumber; // + dMTaxRate;
                    //买家得到的是投资积分 StockMoney
                    //UpdateAccount("BonusAccount", cashorderInfo.BUserID, dTNumber, 1);//发货给购买者

                    //SetAccount(cashorderInfo.BUserID, dTNumber, "金币收货!", cashorderInfo.SUserID, (int)Library.AccountType.云图);

                    //冻结卖家
                    var user = userBLL.GetModel(cashorderInfo.SUserID);
                    user.IsLock = 1;
                    userBLL.Update(user);

                    lgk.Model.SysLog log       = new lgk.Model.SysLog();//日志
                    lgk.BLL.SysLog   syslogBLL = new lgk.BLL.SysLog();
                    log.LogMsg    = "后台裁决卖家订单【" + cashorderInfo.OrderCode + "】未付款,冻结帐号";
                    log.LogType   = 24;                               //
                    log.LogLeve   = 0;                                //
                    log.LogDate   = DateTime.Now;
                    log.LogCode   = "后台裁决卖家未付款冻结帐号";                  //
                    log.IsDeleted = 0;
                    log.Log1      = cashorderInfo.SUserID.ToString(); //用户UserID
                    log.Log2      = BrowserHelper.UserHostIP(this.Page);
                    log.Log3      = BrowserHelper.UserHostName();
                    log.Log4      = "";
                    syslogBLL.Add(log);

                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("Successful") + "');window.location.href='CashOrderList.aspx';", true);
                }
            }
        }