示例#1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            int toUserID = 0;

            lgk.Model.tb_user   userInfo   = userBLL.GetModel(getLoginID());
            lgk.Model.tb_change changeInfo = new lgk.Model.tb_change();
            int type = 0;

            if (Convert.ToDecimal(txtMoney.Value.Trim()) > userInfo.BonusAccount)
            {
                MessageBox.Show(this, GetLanguage("balanceDollars"));//奖金余额不足
                return;
            }
            changeInfo.UserID     = getLoginID();
            changeInfo.ToUserID   = toUserID;
            changeInfo.ToUserType = 0;
            changeInfo.MoneyType  = 0;
            changeInfo.Amount     = Convert.ToDecimal(txtMoney.Value.Trim());
            changeInfo.ChangeType = 5;
            changeInfo.ChangeDate = DateTime.Now;

            if (changeBLL.Add(changeInfo) > 0)
            {
                var     user   = userBLL.GetModel(LoginUser.UserID);
                decimal EMoney = Convert.ToDecimal(getColumn(0, "BonusAccount", "tb_user", "UserID=" + getLoginID(), ""));
                if (EMoney >= Convert.ToDecimal(txtMoney.Value.Trim()))
                {
                    UpdateAccount("BonusAccount", getLoginID(), Convert.ToDecimal(changeInfo.Amount), 0);//
                    UpdateSystemAccount("Money001", Convert.ToDecimal(changeInfo.Amount), 1);
                    UpdateSystemAccount("Money002", Convert.ToDecimal(changeInfo.Amount), 1);
                    //  UpdateAccount("Emoney", toUserID, Convert.ToDecimal(changeInfo.Amount), 1);//
                    //加入流水账表(奖金币减少)
                    lgk.Model.tb_journal jmodel = new lgk.Model.tb_journal();
                    jmodel.UserID    = getLoginID();
                    jmodel.Remark    = "慈善捐款";
                    jmodel.RemarkEn  = "慈善捐款";
                    jmodel.InAmount  = 0;
                    jmodel.OutAmount = changeInfo.Amount;
                    var data = userBLL.GetModel(getLoginID());
                    jmodel.BalanceAmount = data.BonusAccount;
                    jmodel.JournalDate   = DateTime.Now;
                    jmodel.JournalType   = 3;
                    jmodel.Journal01     = toUserID;
                    journalBLL.Add(jmodel);
                    MessageBox.ShowAndRedirect(this, "捐款金额成功!", "addcishan.aspx");//转账成功
                    //  ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('捐款金额成功!');", true);//奖金币转拍币功能未开放
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('捐款金额不能大于奖金币余额!');", true);//奖金币转拍币功能未开放
                }
                //发送短信通知
                //content = GetLanguage("TransferMoenyFrom").Replace("{username}", user.UserCode).Replace("{Amount}", changeInfo.Amount.ToString()).Replace("{time}", DateTime.Now.ToString("yyyy年MM月dd日HH时mm分")).Replace("{timeEn}", DateTime.Now.ToString("yyyy/MM/dd HH:mm"));
                //SendMessage(getLoginID(), user.PhoneNum, content);
            }
        }
示例#2
0
文件: ListView.cs 项目: githexing/05
 public bool FindID(lgk.Model.tb_user view)
 {
     if (view.UserID == this._ParentID)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
示例#3
0
文件: ListView.cs 项目: githexing/05
 public bool FindNode(lgk.Model.tb_user view)
 {
     if (view.ParentID == this._ParentID && view.Location == this._Location)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
示例#4
0
文件: UserView.cs 项目: githexing/05
        /// <summary>
        /// 输出会员节点
        /// </summary>
        /// <param name="sd">记录股东内容的实体</param>
        /// <returns></returns>
        private string TTable(lgk.Model.tb_user sd)
        {
            StringBuilder sbContent = new StringBuilder();
            List <string> nodeli    = new List <string>();

            if (sd.UserCode == "[注册]")
            {
                sbContent.Append("<table  border=\"0\" cellspacing=\"0\" cellpadding=\"0\"  class=\"map05\">");
                sbContent.Append("<tr>");
                sbContent.Append("<td width=\"102\" height=\"26\"   colspan=\"2\"  class=\"cBlack\">");
                if (cnen == "zh-cn")
                {
                    sbContent.Append("<a href=\"../../Registers.aspx?state=" + sd.ParentID + "," + sd.Location + "," + this._isht + "," + this._ViewID + "\">注册</a>");
                }
                else
                {
                    sbContent.Append("<a href=\"../../Registers.aspx?state=" + sd.ParentID + "," + sd.Location + "," + this._isht + "," + this._ViewID + "\">regist</a>");
                }
                //sbContent.Append("空位");
                sbContent.Append("</td></tr>");
                sbContent.Append("</table>");
            }
            else if (sd.UserCode == "[空位]")
            {
                if (cnen == "zh-cn")
                {
                    sbContent.Append("<table  border=\"0\" cellspacing=\"0\" cellpadding=\"0\"  class=\"map06\"><tr><td width=\"102\" height=\"26\"   colspan=\"2\" class=\"cBlack\">空位</td></tr></table>");
                }
                else
                {
                    sbContent.Append("<table  border=\"0\" cellspacing=\"0\" cellpadding=\"0\"  class=\"map06\"><tr><td width=\"102\" height=\"26\"   colspan=\"2\" class=\"cBlack\">empty</td></tr></table>");
                }
            }
            else
            {
                string map = "";
                //  string kaitong = "";
                if (sd.IsOpend == 0 || sd.IsOpend == 1)
                {
                    // kaitong = "<span style='color:red;'>[未开通]</span>";
                    map = "image0";
                }
                else
                {
                    //  kaitong = "[已开通]";
                    if (int.Parse(sd.LevelID.ToString()) == 1)
                    {
                        map = "image1";// 普卡会员
                    }
                    if (int.Parse(sd.LevelID.ToString()) == 2)
                    {
                        map = "image3"; // 银卡会员
                    }
                    if (int.Parse(sd.LevelID.ToString()) == 3)
                    {
                        map = "image6";// 金卡会员
                    }
                    if (int.Parse(sd.LevelID.ToString()) == 4)
                    {
                        map = "image5"; // 钻卡会员
                    }
                    if (int.Parse(sd.LevelID.ToString()) == 5)
                    {
                        map = "image4";//  创业合伙人
                    }
                    if (int.Parse(sd.LevelID.ToString()) == 6)
                    {
                        map = "image2";//  创业合伙人
                    }
                }
                string jibie = new tb_level().GetModel(sd.LevelID).LevelName;

                if (cnen == "zh-cn")
                {
                    sbContent.Append(" <table height=\"100px\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\"  class=\"" + map + "\">" +
                                     "<tr height=\"5px\"><td align=\"center\"  colspan=\"3\" class=\"th\"><b><a style=\" color:White;\" href=\"MemberTree.aspx?tt=" + sd.UserID + "\">" + sd.UserCode + "</a></b></td></tr>" +
                                     "<tr  align=\"center\" height=\"5px\"><td align=\"center\"  colspan=\"3\" class=\"th\">" + sd.TrueName + "</td></tr>" +
                                     "<tr height=\"5px\"><td width=\"50\" align=\"center\" >" + Convert.ToDouble(sd.LeftScore).ToString() + "</td><td>总</td><td width=\"50\" align=\"center\" >" + Convert.ToDouble(sd.RightScore).ToString() + "</td></tr>" +
                                     "<tr height=\"5px\"><td width=\"50\" align=\"center\" >" + Convert.ToDouble(sd.LeftBalance).ToString() + "</td><td>余</td><td width=\"50\" align=\"center\" >" + Convert.ToDouble(sd.RightBalance).ToString() + "</td></tr>" +
                                     "<tr height=\"5px\"><td width=\"50\" align=\"center\" >" + Convert.ToDouble(sd.LeftNewScore).ToString() + "</td><td>新</td><td width=\"50\" align=\"center\" >" + Convert.ToDouble(sd.RightNewScore).ToString() + "</td></tr>" +
                                     "</table>");
                }
                else
                {
                    sbContent.Append(" <table height=\"100px\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\"  class=\"" + map + "\">" +
                                     "<tr height=\"5px\"><td align=\"center\"  colspan=\"3\" class=\"th\"><b><a style=\" color:White;\" href=\"MemberTree.aspx?tt=" + sd.UserID + "\">" + sd.UserCode + "</a></b></td></tr>" +
                                     "<tr  align=\"center\" height=\"5px\"><td align=\"center\"  colspan=\"3\" class=\"th\">" + sd.TrueName + "</td></tr>" +
                                     "<tr height=\"5px\"><td width=\"50\" align=\"center\" >" + Convert.ToDouble(sd.LeftScore).ToString() + "</td><td>total</td><td width=\"50\" align=\"center\" >" + Convert.ToDouble(sd.RightScore).ToString() + "</td></tr>" +
                                     "<tr height=\"5px\"><td width=\"50\" align=\"center\" >" + Convert.ToDouble(sd.LeftBalance).ToString() + "</td><td>balance</td><td width=\"50\" align=\"center\" >" + Convert.ToDouble(sd.RightBalance).ToString() + "</td></tr>" +
                                     "<tr height=\"5px\"><td width=\"50\" align=\"center\" >" + Convert.ToDouble(sd.LeftNewScore).ToString() + "</td><td>new</td><td width=\"50\" align=\"center\" >" + Convert.ToDouble(sd.RightNewScore).ToString() + "</td></tr>" +
                                     "</table>");
                }
            }
            return(sbContent.ToString());
        }
示例#5
0
 /// <summary>
 /// 注册会员
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public string proc_RegisterUser(lgk.Model.tb_user model)
 {
     return(dal.proc_RegisterUser(model));
 }
示例#6
0
文件: UserView.cs 项目: githexing/05
        /// <summary>
        /// 输出TR
        /// </summary>
        /// <param name="Wtype"></param>
        /// <param name="id"></param>
        /// <param name="x"></param>
        /// <param name="a"></param>
        /// <param name="alist"></param>
        /// <param name="blist"></param>
        /// <returns></returns>
        private string addTr(int Wtype, int id, int x, int a, ArrayList alist, out ArrayList blist)
        {
            ArrayList clist             = new ArrayList();
            List <lgk.Model.tb_user> li = new List <lgk.Model.tb_user>();

            for (int i = 0; i < id; i++)
            {
                string[]          fx = alist[i].ToString().Split(',');
                lgk.Model.tb_user fd = us.GetModel(int.Parse(fx[1]));
                if (fd != null)
                {
                    fd.User005 = x.ToString();
                    li.Add(fd);
                    for (int j = 1; j < a + 1; j++)
                    {
                        int Myid;
                        if (use.Exist(int.Parse(fx[1]), j, out Myid))
                        {
                            clist.Add("0," + Myid.ToString());
                        }
                        else
                        {
                            if (fd.IsOpend >= 2)
                            {
                                clist.Add("0,-1," + fx[1] + "," + j);
                            }
                            else if (fd.IsOpend == 0 || fd.IsOpend == 1)
                            {
                                clist.Add("2,-1," + fx[1] + "," + j);
                            }
                        }
                    }
                }
                else
                {
                    if (fx[0] == "0")//父节点已开通
                    {
                        if (us.GetModel(" isopend>=2 and Location=1 and ParentID=" + int.Parse(fx[2])) == null)
                        {
                            if (int.Parse(fx[3]) == 2)
                            {
                                fd          = new lgk.Model.tb_user();
                                fd.User005  = x.ToString();
                                fd.UserCode = "[空位]";
                                li.Add(fd);
                            }
                            else
                            {
                                fd          = new lgk.Model.tb_user();
                                fd.User005  = x.ToString();
                                fd.UserCode = "[注册]";
                                fd.ParentID = int.Parse(fx[2]);
                                fd.Location = int.Parse(fx[3]);
                                li.Add(fd);
                            }
                        }
                        else
                        {
                            fd          = new lgk.Model.tb_user();
                            fd.User005  = x.ToString();
                            fd.UserCode = "[注册]";
                            fd.ParentID = int.Parse(fx[2]);
                            fd.Location = int.Parse(fx[3]);
                            li.Add(fd);
                        }
                    }
                    else
                    {
                        if (fx[0] == "2")//父节点未开通
                        {
                            if (int.Parse(fx[3]) == 2)
                            {
                                fd          = new lgk.Model.tb_user();
                                fd.User005  = x.ToString();
                                fd.UserCode = "[空位]";
                                li.Add(fd);
                            }
                            else
                            {
                                //fd = new lgk.Model.tb_user();
                                //fd.User005 = x.ToString();
                                //fd.UserCode = "[注册]";
                                //fd.ParentID = int.Parse(fx[2]);
                                //fd.Location = int.Parse(fx[3]);
                                //li.Add(fd);
                                fd          = new lgk.Model.tb_user();
                                fd.User005  = x.ToString();
                                fd.UserCode = "[空位]";
                                li.Add(fd);
                            }
                        }
                        else
                        {
                            fd          = new lgk.Model.tb_user();
                            fd.User005  = x.ToString();
                            fd.UserCode = "[空位]";
                            li.Add(fd);
                        }
                    }
                    for (int j = 0; j < a; j++)
                    {
                        clist.Add("1,-1");
                    }
                }
            }
            blist = clist;
            return(Aid(li, Wtype, a));
        }
示例#7
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool UpdateGender(lgk.Model.tb_user model)
 {
     return(dal.UpdateGender(model));
 }
示例#8
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool UpdateNiceName(lgk.Model.tb_user model)
 {
     return(dal.UpdateNiceName(model));
 }
示例#9
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public long Add(lgk.Model.tb_user model)
 {
     return(dal.Add(model));
 }
示例#10
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            long toUserID = 0;

            lgk.Model.tb_user   userInfo   = userBLL.GetModel(getLoginID());
            lgk.Model.tb_change changeInfo = new lgk.Model.tb_change();

            int iTypeID = int.Parse(dropCurrency.SelectedValue);

            if (iTypeID == 0)
            {
                MessageBox.ShowBox(this.Page, GetLanguage("ChooseTransfer"), Library.Enums.ModalTypes.warning);//请选择转账类型
                return;
            }
            if (!CheckOpen(iTypeID))
            {
                MessageBox.ShowBox(this.Page, GetLanguage("Feature"), Library.Enums.ModalTypes.warning);//该功能未开放
                return;
            }

            string strMoney = txtMoney.Text.Trim();

            if (string.IsNullOrEmpty(strMoney))
            {
                MessageBox.ShowBox(this.Page, GetLanguage("transferMoneyIsnull"), Library.Enums.ModalTypes.warning);//转账金额不能为空
                return;
            }
            string strPayPwd = txtSecondPassword.Text.Trim();

            if (string.IsNullOrEmpty(strPayPwd))
            {
                MessageBox.ShowBox(this.Page, GetLanguage("SecondaryISNUll"), Library.Enums.ModalTypes.warning);//二级密码不能为空
                return;
            }
            if (!ValidPassword(userInfo.SecondPassword, PageValidate.GetMd5(strPayPwd)))
            {
                MessageBox.ShowBox(this.Page, "支付密码错误", Library.Enums.ModalTypes.warning);//
                return;
            }

            decimal dResult = 0;

            if (decimal.TryParse(strMoney, out dResult))
            {
                decimal dTrans = getParamAmount("Transfer1"); //转账最低金额
                decimal d      = getParamAmount("Transfer2"); //转账倍数基数
                if (dResult < dTrans)
                {
                    MessageBox.ShowBox(this.Page, GetLanguage("equalTo") + dTrans, Library.Enums.ModalTypes.warning);//转账金额必须是大于等于XX的整数
                    return;
                }
                if (d != 0 && dResult % d != 0)
                {
                    MessageBox.ShowBox(this.Page, GetLanguage("amountMustbe") + d + GetLanguage("Multiples"), Library.Enums.ModalTypes.warning);//转账金额必须是XX的倍数
                    return;
                }
            }
            else
            {
                MessageBox.ShowBox(this.Page, "输入的金额格式错误", Library.Enums.ModalTypes.warning);
                return;
            }

            if ((iTypeID == 1) && dResult > userInfo.BonusAccount)
            {
                MessageBox.ShowBox(this.Page, "奖励分余额不足", Library.Enums.ModalTypes.warning);//
                return;
            }
            else if (iTypeID == 2 && dResult > userInfo.StockAccount)
            {
                MessageBox.ShowBox(this.Page, "激活分余额不足", Library.Enums.ModalTypes.warning);//
                return;
            }
            else if (iTypeID == 3 && dResult > userInfo.Emoney)
            {
                MessageBox.ShowBox(this.Page, "注册分余额不足", Library.Enums.ModalTypes.warning);//
                return;
            }

            string strUserCode = txtUserCode.Text.Trim();
            var    toUser      = userBLL.GetModelByUserCode(strUserCode);

            if (toUser == null)
            {
                MessageBox.ShowBox(this.Page, GetLanguage("numberIsExist"), Library.Enums.ModalTypes.warning);//会员编号不存在
                return;
            }
            else
            {
                toUserID = int.Parse(toUser.UserID.ToString());
            }

            if (toUserID <= 0)
            {
                MessageBox.ShowBox(this.Page, GetLanguage("objectExist"), Library.Enums.ModalTypes.warning);//转帐对象不存在
                return;
            }

            if (!userInfo.SecondPassword.Equals(PageValidate.GetMd5(txtSecondPassword.Text.Trim())))
            {
                MessageBox.ShowBox(this.Page, GetLanguage("PasswordError"), Library.Enums.ModalTypes.error);//二级密码错误
                return;
            }

            decimal fee = dResult * getParamAmount("Transfer3");

            changeInfo.UserID     = getLoginID();
            changeInfo.ToUserID   = toUserID;
            changeInfo.ToUserType = 0;
            changeInfo.MoneyType  = 0;
            changeInfo.Amount     = dResult;
            changeInfo.ChangeType = iTypeID;
            changeInfo.ChangeDate = DateTime.Now;
            changeInfo.Change005  = dResult - fee;
            changeInfo.Change006  = fee;// 转账手续费

            if (changeBLL.Add(changeInfo) > 0)
            {
                try
                {
                    if (changeInfo.ChangeType == 1)//奖励分转激活分
                    {
                        #region 奖励分转激活分
                        decimal dBonusAccount = userBLL.GetMoney(userInfo.UserID, "BonusAccount");
                        if (dBonusAccount >= changeInfo.Amount)
                        {
                            UpdateAccount("BonusAccount", userInfo.UserID, changeInfo.Amount, 0); //
                            UpdateAccount("StockAccount", toUserID, changeInfo.Change005, 1);     //
                            //加入流水账表(佣金币减少)
                            lgk.Model.tb_journal jmodel = new lgk.Model.tb_journal();
                            jmodel.UserID        = userInfo.UserID;
                            jmodel.Remark        = "奖励分转激活分";
                            jmodel.RemarkEn      = "Currency to shopping currency";
                            jmodel.InAmount      = 0;
                            jmodel.OutAmount     = changeInfo.Amount;
                            jmodel.BalanceAmount = userBLL.GetMoney(userInfo.UserID, "BonusAccount");
                            jmodel.JournalDate   = DateTime.Now;
                            jmodel.JournalType   = (int)Library.AccountType.奖励分;
                            jmodel.Journal01     = toUserID;
                            journalBLL.Add(jmodel);

                            //加入流水账表(现金币增加)
                            lgk.Model.tb_journal journalInfo = new lgk.Model.tb_journal();
                            journalInfo.UserID        = toUserID;
                            journalInfo.Remark        = "奖励分转激活分";
                            journalInfo.RemarkEn      = "Currency to shopping currency";
                            journalInfo.InAmount      = changeInfo.Change005;
                            journalInfo.OutAmount     = 0;
                            journalInfo.BalanceAmount = userBLL.GetMoney(toUserID, "StockAccount");
                            journalInfo.JournalDate   = DateTime.Now;
                            journalInfo.JournalType   = (int)Library.AccountType.激活分;
                            journalInfo.Journal01     = userInfo.UserID;
                            journalBLL.Add(journalInfo);
                        }
                        else
                        {
                            MessageBox.ShowBox(this.Page, GetLanguage("objectExist"), Library.Enums.ModalTypes.warning);//转帐对象不存在
                        }
                        #endregion
                    }
                    else if (changeInfo.ChangeType == 2)//激活分转其他会员
                    {
                        #region 激活分转其他会员
                        decimal dStockAccount = userBLL.GetMoney(userInfo.UserID, "StockAccount");
                        if (dStockAccount >= changeInfo.Amount)
                        {
                            UpdateAccount("StockAccount", userInfo.UserID, changeInfo.Amount, 0); //
                            UpdateAccount("StockAccount", toUserID, changeInfo.Change005, 1);     //
                            //加入流水账表(佣金币减少)
                            lgk.Model.tb_journal jmodel = new lgk.Model.tb_journal();
                            jmodel.UserID        = userInfo.UserID;
                            jmodel.Remark        = "激活分转给" + toUser.UserCode;
                            jmodel.RemarkEn      = "Investment BonusAccount transferred to other member";
                            jmodel.InAmount      = 0;
                            jmodel.OutAmount     = changeInfo.Amount;
                            jmodel.BalanceAmount = userBLL.GetMoney(userInfo.UserID, "StockAccount");
                            jmodel.JournalDate   = DateTime.Now;
                            jmodel.JournalType   = (int)Library.AccountType.激活分;
                            jmodel.Journal01     = toUserID;
                            journalBLL.Add(jmodel);

                            //加入流水账表(现金币增加)
                            lgk.Model.tb_journal journalInfo = new lgk.Model.tb_journal();
                            journalInfo.UserID        = toUserID;
                            journalInfo.Remark        = "收到" + userInfo.UserCode + "转来激活分";
                            journalInfo.RemarkEn      = "Investment BonusAccount transferred to other member";
                            journalInfo.InAmount      = changeInfo.Change005;
                            journalInfo.OutAmount     = 0;
                            journalInfo.BalanceAmount = userBLL.GetMoney(toUserID, "StockAccount ");
                            journalInfo.JournalDate   = DateTime.Now;
                            journalInfo.JournalType   = (int)Library.AccountType.激活分;
                            journalInfo.Journal01     = userInfo.UserID;
                            journalBLL.Add(journalInfo);
                        }
                        else
                        {
                            MessageBox.ShowBox(this.Page, GetLanguage("objectExist"), Library.Enums.ModalTypes.warning);//转帐对象不存在
                            return;
                        }
                        #endregion
                    }
                    else if (changeInfo.ChangeType == 3)//注册分转其他会员
                    {
                        #region 注册分转其他会员
                        decimal dBonusAccount = userBLL.GetMoney(userInfo.UserID, "Emoney");
                        if (dBonusAccount >= changeInfo.Amount)
                        {
                            UpdateAccount("Emoney", userInfo.UserID, changeInfo.Amount, 0); //
                            UpdateAccount("Emoney", toUserID, changeInfo.Change005, 1);     //

                            fee = changeInfo.Amount - changeInfo.Change005;
                            //加入流水账表(减少)
                            lgk.Model.tb_journal jmodel = new lgk.Model.tb_journal();
                            jmodel.UserID        = userInfo.UserID;
                            jmodel.Remark        = "注册分转给" + toUser.UserCode;
                            jmodel.RemarkEn      = "Currency to shopping currency";
                            jmodel.InAmount      = 0;
                            jmodel.OutAmount     = changeInfo.Change005;
                            jmodel.BalanceAmount = userBLL.GetMoney(toUserID, "Emoney");
                            jmodel.JournalDate   = DateTime.Now;
                            jmodel.JournalType   = (int)Library.AccountType.注册分;
                            jmodel.Journal01     = toUserID;
                            journalBLL.Add(jmodel);

                            //加入流水账表(现金币增加)
                            lgk.Model.tb_journal journalInfo = new lgk.Model.tb_journal();
                            journalInfo.UserID        = toUserID;
                            journalInfo.Remark        = "收到" + userInfo.UserCode + "转来注册分";
                            journalInfo.RemarkEn      = "Currency to shopping currency";
                            journalInfo.InAmount      = changeInfo.Change005;
                            journalInfo.OutAmount     = 0;
                            journalInfo.BalanceAmount = userBLL.GetMoney(toUserID, "Emoney ");
                            journalInfo.JournalDate   = DateTime.Now;
                            journalInfo.JournalType   = (int)Library.AccountType.注册分;
                            journalInfo.Journal01     = userInfo.UserID;
                            journalBLL.Add(journalInfo);
                        }
                        #endregion
                    }
                }
                catch
                {
                    MessageBox.ShowBox(this.Page, GetLanguage("addError"), Library.Enums.ModalTypes.error);                               //添加流水账错误
                }
                MessageBox.ShowBox(this.Page, GetLanguage("TransferSuccess"), Library.Enums.ModalTypes.success, "TransferToEmoney.aspx"); //转账成功
            }
            else
            {
                MessageBox.ShowBox(this.Page, GetLanguage("addError"), Library.Enums.ModalTypes.error);//操作失败
            }
        }
示例#11
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            long   toUserID    = 0;
            string strUserCode = txtUserCode.Text.Trim();

            lgk.Model.tb_user   userInfo   = userBLL.GetModel(getLoginID());
            lgk.Model.tb_change changeInfo = new lgk.Model.tb_change();

            if (dropCurrency.SelectedValue == "0")
            {
                MessageBox.Show(this, "" + GetLanguage("ChooseTransfer") + "");//请选择转账类型
                return;
            }
            if (strUserCode == "")
            {
                MessageBox.Show(this, "转入的会员编号不能为空!");//转入的会员编号不能为空
                return;
            }
            else if (strUserCode == LoginUser.UserCode)
            {
                MessageBox.Show(this, "登录会员账号不能进行自转账操作!");//不能自己给自己转账
                return;
            }
            var toUser = userBLL.GetModel(" UserCode='" + strUserCode + "'");

            if (toUser == null)
            {
                MessageBox.Show(this, GetLanguage("numberIsExist"));//会员编号不存在
                return;
            }
            else
            {
                toUserID = int.Parse(toUser.UserID.ToString());
            }
            if (toUserID <= 0)
            {
                MessageBox.Show(this, GetLanguage("objectExist"));//转帐对象不存在
                return;
            }
            //if (!CheckOpen(dropCurrency.SelectedValue))
            //{
            //    MessageBox.Show(this, "" + GetLanguage("Feature") + "");//该功能未开放
            //    return;
            //}
            int iTypeID = int.Parse(dropCurrency.SelectedValue);

            if (txtScore.Text.Trim() == "")
            {
                MessageBox.Show(this, "" + GetLanguage("transferScoreIsnull") + "");//转账金额不能为空
                return;
            }

            decimal dResult = 0;

            if (decimal.TryParse(txtScore.Text.Trim(), out dResult))
            {
                decimal dTrans = getParamAmount("Transfer1"); //转账最低金额
                decimal d      = getParamAmount("Transfer2"); //转账倍数基数
                if (dResult < dTrans)
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("equalTo") + dTrans + "');", true);//转账金额/积分必须是大于等于XX的整数
                    return;
                }
                if (d != 0 && dResult % d != 0)
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("amountMustbe") + "" + d + "" + GetLanguage("Multiples") + "');", true);//转账金额/积分必须是XX的倍数
                    return;
                }
            }

            if (iTypeID != 0)
            {
                if (iTypeID <= 1 && dResult > userInfo.BonusAccount)
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('奖金积分不足');", true);
                    return;
                }
                //if (iTypeID <= 3 && dResult > userInfo.BonusAccount)
                //{
                //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("NotCurrent") + "');", true);
                //    return;
                //}
                //else if (iTypeID >= 4 && dResult > userInfo.StockAccount)
                //{
                //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("NotRegistered") + "');", true);
                //    return;
                //}
            }

            //if (dropCurrency.SelectedValue == "5")
            //{
            //    if (toUserID == userInfo.UserID)
            //    {
            //        ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("TransferToOuner") + "');", true);
            //        return;
            //    }

            //    if (!userBLL.OnRecommendSameLine(userInfo.UserID, toUserID))
            //    {
            //        ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("objectExist") + "');", true);
            //        return;
            //    }
            //}

            changeInfo.UserID     = getLoginID();
            changeInfo.ToUserID   = toUserID;
            changeInfo.ToUserType = 0;
            changeInfo.MoneyType  = 0;
            changeInfo.Amount     = dResult;                                                //转出积分
            changeInfo.ChangeType = Convert.ToInt32(dropCurrency.SelectedValue);
            changeInfo.ChangeDate = DateTime.Now;
            changeInfo.Change005  = dResult - dResult * getParamAmount("Transfer3") / 100;  //实际到账奖金积分

            if (changeBLL.Add(changeInfo) > 0)
            {
                try
                {
                    if (changeInfo.ChangeType == 1)//奖金积分转其他会员
                    {
                        #region 奖金积分转其他会员
                        decimal dBonusAccount = userBLL.GetMoney(getLoginID(), "BonusAccount");
                        if (dBonusAccount >= changeInfo.Amount)
                        {
                            UpdateAccount("BonusAccount", userInfo.UserID, changeInfo.Amount, 0); //
                            UpdateAccount("BonusAccount", toUserID, changeInfo.Change005, 1);     //
                            //转出账号加入流水账表(奖金积分减少)
                            lgk.Model.tb_journal jmodel = new lgk.Model.tb_journal();
                            jmodel.UserID        = userInfo.UserID;
                            jmodel.Remark        = "奖金积分转给" + txtUserCode.Text;
                            jmodel.RemarkEn      = "BonusScore to " + txtUserCode.Text;
                            jmodel.InAmount      = 0;
                            jmodel.OutAmount     = changeInfo.Amount;                 //转出积分
                            jmodel.BalanceAmount = dBonusAccount - changeInfo.Amount; //转出后的积分余额
                            jmodel.JournalDate   = DateTime.Now;
                            jmodel.JournalType   = 2;                                 //流水记录类型: 1-提现 2-转账 3-充值 5-会员升级
                            jmodel.Journal01     = toUserID;                          //转入积分的账号
                            jmodel.Journal02     = 1;                                 //转账类型流水记录: 1-积分  2-月分红静态钱包 3-月分红动态钱包 4-年分红静态钱包 5-年分红动态钱包
                            journalBLL.Add(jmodel);

                            //转入账号加入流水账表(奖金积分增加)
                            lgk.Model.tb_journal journalInfo = new lgk.Model.tb_journal();
                            journalInfo.UserID        = toUserID;
                            journalInfo.Remark        = "获得" + LoginUser.UserCode + "转来奖金积分";
                            journalInfo.RemarkEn      = "Get " + LoginUser.UserCode + " Transfer BonusSocre";
                            journalInfo.InAmount      = changeInfo.Change005;                                              //实际到账积分
                            journalInfo.OutAmount     = 0;
                            journalInfo.BalanceAmount = userBLL.GetMoney(toUserID, "BonusAccount") + changeInfo.Change005; //转入后的积分余额
                            journalInfo.JournalDate   = DateTime.Now;
                            journalInfo.JournalType   = 2;                                                                 //操作记录的流水类型: 1-提现 2-转账 3-充值 5-会员升级
                            journalInfo.Journal01     = userInfo.UserID;                                                   //转出积分的账号
                            journalInfo.Journal02     = 1;                                                                 //转账类型流水记录: 1-积分  2-月分红静态钱包 3-月分红动态钱包 4-年分红静态钱包 5-年分红动态钱包
                            journalBLL.Add(journalInfo);
                        }
                        //else
                        //{
                        //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("objectExist") + "');", true);//奖金币转拍币功能未开放
                        //}
                        #endregion


                        //    #region 流通币转MDD钻币
                        //    decimal dBonusAccount = userBLL.GetMoney(getLoginID(), "BonusAccount");
                        //    if (dBonusAccount >= changeInfo.Amount)
                        //    {
                        //        UpdateAccount("BonusAccount", userInfo.UserID, changeInfo.Amount, 0);//
                        //        UpdateAccount("Emoney", toUserID, changeInfo.Change005, 1);//
                        //        //加入流水账表(流通币减少)
                        //        lgk.Model.tb_journal model = new lgk.Model.tb_journal();
                        //        model.UserID = userInfo.UserID;
                        //        model.Remark = "流通币转MDD钻币";
                        //        model.RemarkEn = "Currency to MDD drill";
                        //        model.InAmount = 0;
                        //        model.OutAmount = changeInfo.Amount;

                        //        model.BalanceAmount = userBLL.GetMoney(getLoginID(), "BonusAccount");
                        //        model.JournalDate = DateTime.Now;
                        //        model.JournalType = 1;
                        //        model.Journal01 = toUserID;
                        //        journalBLL.Add(model);

                        //        //加入流水账表(购物币增加)
                        //        lgk.Model.tb_journal journalInfo = new lgk.Model.tb_journal();
                        //        journalInfo.UserID = toUserID;
                        //        journalInfo.Remark = "流通币转MDD钻币";
                        //        journalInfo.RemarkEn = "Currency to MDD drill";
                        //        journalInfo.InAmount = changeInfo.Change005;
                        //        journalInfo.OutAmount = 0;
                        //        journalInfo.BalanceAmount = userBLL.GetMoney(getLoginID(), "Emoney");
                        //        journalInfo.JournalDate = DateTime.Now;
                        //        journalInfo.JournalType = 2;
                        //        journalInfo.Journal01 = userInfo.UserID;

                        //        journalBLL.Add(journalInfo);
                        //    }
                        //    else
                        //    {
                        //        ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("objectExist") + "');", true);//奖金币转拍币功能未开放
                        //    }
                        //    #endregion
                        //}
                        //else if (changeInfo.ChangeType == 2)//流通币转注册币
                        //{
                        //    #region 流通币转注册币
                        //    decimal dBonusAccount = userBLL.GetMoney(getLoginID(), "BonusAccount");
                        //    if (dBonusAccount >= changeInfo.Amount)
                        //    {
                        //        UpdateAccount("BonusAccount", userInfo.UserID, changeInfo.Amount, 0);//
                        //        UpdateAccount("StockAccount", toUserID, changeInfo.Change005, 1);//
                        //        //加入流水账表(佣金币减少)
                        //        lgk.Model.tb_journal jmodel = new lgk.Model.tb_journal();
                        //        jmodel.UserID = userInfo.UserID;
                        //        jmodel.Remark = "流通币转注册币";
                        //        jmodel.RemarkEn = "Currency to Registered currency";
                        //        jmodel.InAmount = 0;
                        //        jmodel.OutAmount = changeInfo.Amount;

                        //        jmodel.BalanceAmount = userBLL.GetMoney(getLoginID(), "BonusAccount");
                        //        jmodel.JournalDate = DateTime.Now;
                        //        jmodel.JournalType = 1;
                        //        jmodel.Journal01 = toUserID;
                        //        journalBLL.Add(jmodel);

                        //        //加入流水账表(现金币增加)
                        //        lgk.Model.tb_journal journalInfo = new lgk.Model.tb_journal();
                        //        journalInfo.UserID = toUserID;
                        //        journalInfo.Remark = "流通币转注册币";
                        //        journalInfo.RemarkEn = "Currency to Registered currency";
                        //        journalInfo.InAmount = changeInfo.Change005;
                        //        journalInfo.OutAmount = 0;
                        //        journalInfo.BalanceAmount = userBLL.GetMoney(toUserID, "StockAccount");
                        //        journalInfo.JournalDate = DateTime.Now;
                        //        journalInfo.JournalType = 5;
                        //        journalInfo.Journal01 = userInfo.UserID;
                        //        journalBLL.Add(journalInfo);
                        //    }
                        //    else
                        //    {
                        //        ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("objectExist") + "');", true);//奖金币转拍币功能未开放
                        //    }
                        //    #endregion
                        //}
                        //else if (changeInfo.ChangeType == 3)//流通币转购物币
                        //{
                        //    #region 流通币转购物币
                        //    decimal dBonusAccount = userBLL.GetMoney(getLoginID(), "BonusAccount");
                        //    if (dBonusAccount >= changeInfo.Amount)
                        //    {
                        //        UpdateAccount("BonusAccount", userInfo.UserID, changeInfo.Amount, 0);//
                        //        UpdateAccount("ShopAccount", toUserID, changeInfo.Change005, 1);//
                        //        //加入流水账表(佣金币减少)
                        //        lgk.Model.tb_journal jmodel = new lgk.Model.tb_journal();
                        //        jmodel.UserID = userInfo.UserID;
                        //        jmodel.Remark = "流通币转购物币";
                        //        jmodel.RemarkEn = "Currency to shopping currency";
                        //        jmodel.InAmount = 0;
                        //        jmodel.OutAmount = changeInfo.Amount;
                        //        jmodel.BalanceAmount = userBLL.GetMoney(getLoginID(), "BonusAccount");
                        //        jmodel.JournalDate = DateTime.Now;
                        //        jmodel.JournalType = 1;
                        //        jmodel.Journal01 = toUserID;
                        //        journalBLL.Add(jmodel);

                        //        //加入流水账表(现金币增加)
                        //        lgk.Model.tb_journal journalInfo = new lgk.Model.tb_journal();
                        //        journalInfo.UserID = toUserID;
                        //        journalInfo.Remark = "流通币转购物币";
                        //        journalInfo.RemarkEn = "Currency to shopping currency";
                        //        journalInfo.InAmount = changeInfo.Change005;
                        //        journalInfo.OutAmount = 0;
                        //        journalInfo.BalanceAmount = userBLL.GetMoney(toUserID, "ShopAccount");
                        //        journalInfo.JournalDate = DateTime.Now;
                        //        journalInfo.JournalType = 3;
                        //        journalInfo.Journal01 = userInfo.UserID;
                        //        journalBLL.Add(journalInfo);
                        //    }
                        //    else
                        //    {
                        //        ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("objectExist") + "');", true);//奖金币转拍币功能未开放
                        //    }
                        //    #endregion
                        //}
                        //else if (changeInfo.ChangeType == 4)//注册币转购物币
                        //{
                        //    #region 注册币转购物币
                        //    decimal dStockAccount = userBLL.GetMoney(getLoginID(), "StockAccount");
                        //    if (dStockAccount >= changeInfo.Amount)
                        //    {
                        //        UpdateAccount("StockAccount", userInfo.UserID, changeInfo.Amount, 0);//
                        //        UpdateAccount("ShopAccount", toUserID, changeInfo.Change005, 1);//
                        //        //加入流水账表(佣金币减少)
                        //        lgk.Model.tb_journal jmodel = new lgk.Model.tb_journal();
                        //        jmodel.UserID = userInfo.UserID;
                        //        jmodel.Remark = "注册币转购物币";
                        //        jmodel.RemarkEn = "Registered currency to shopping currency";
                        //        jmodel.InAmount = 0;
                        //        jmodel.OutAmount = changeInfo.Amount;
                        //        jmodel.BalanceAmount = userBLL.GetMoney(getLoginID(), "StockAccount");
                        //        jmodel.JournalDate = DateTime.Now;
                        //        jmodel.JournalType = 5;
                        //        jmodel.Journal01 = toUserID;
                        //        journalBLL.Add(jmodel);

                        //        //加入流水账表(现金币增加)
                        //        lgk.Model.tb_journal journalInfo = new lgk.Model.tb_journal();
                        //        journalInfo.UserID = toUserID;
                        //        journalInfo.Remark = "注册币转购物币";
                        //        journalInfo.RemarkEn = "Registered currency to shopping currency";
                        //        journalInfo.InAmount = changeInfo.Change005;
                        //        journalInfo.OutAmount = 0;
                        //        journalInfo.BalanceAmount = userBLL.GetMoney(toUserID, "ShopAccount");
                        //        journalInfo.JournalDate = DateTime.Now;
                        //        journalInfo.JournalType = 3;
                        //        journalInfo.Journal01 = userInfo.UserID;
                        //        journalBLL.Add(journalInfo);
                        //    }
                        //    else
                        //    {
                        //        ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("objectExist") + "');", true);//奖金币转拍币功能未开放
                        //    }
                        //    #endregion
                        //}
                        //else if (changeInfo.ChangeType == 5)//注册币转其他会员
                        //{
                        //    #region 注册币转其他会员
                        //    decimal dStockAccount = userBLL.GetMoney(getLoginID(), "StockAccount");
                        //    if (dStockAccount >= changeInfo.Amount)
                        //    {
                        //        UpdateAccount("StockAccount", userInfo.UserID, changeInfo.Amount, 0);//
                        //        UpdateAccount("StockAccount", toUserID, changeInfo.Change005, 1);//
                        //        //加入流水账表(佣金币减少)
                        //        lgk.Model.tb_journal jmodel = new lgk.Model.tb_journal();
                        //        jmodel.UserID = userInfo.UserID;
                        //        jmodel.Remark = "注册币转给" + txtUserCode.Text;
                        //        jmodel.RemarkEn = "Registered currency to " + txtUserCode.Text;
                        //        jmodel.InAmount = 0;
                        //        jmodel.OutAmount = changeInfo.Amount;
                        //        jmodel.BalanceAmount = userBLL.GetMoney(getLoginID(), "StockAccount");
                        //        jmodel.JournalDate = DateTime.Now;
                        //        jmodel.JournalType = 5;
                        //        jmodel.Journal01 = toUserID;
                        //        journalBLL.Add(jmodel);

                        //        //加入流水账表(现金币增加)
                        //        lgk.Model.tb_journal journalInfo = new lgk.Model.tb_journal();
                        //        journalInfo.UserID = toUserID;
                        //        journalInfo.Remark = "获得" + LoginUser.UserCode + "转来注册币";
                        //        journalInfo.RemarkEn = "Get " + LoginUser.UserCode + " Transfer Registered currency";
                        //        journalInfo.InAmount = changeInfo.Change005;
                        //        journalInfo.OutAmount = 0;
                        //        journalInfo.BalanceAmount = userBLL.GetMoney(toUserID, "StockAccount");
                        //        journalInfo.JournalDate = DateTime.Now;
                        //        journalInfo.JournalType = 5;
                        //        journalInfo.Journal01 = userInfo.UserID;
                        //        journalBLL.Add(journalInfo);
                        //    }
                        //    else
                        //    {
                        //        ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("objectExist") + "');", true);//奖金币转拍币功能未开放
                        //    }
                        //    #endregion
                    }
                }
                catch
                {
                    MessageBox.Show(this, GetLanguage("addError"));                                        //添加流水账错误
                }
                MessageBox.ShowAndRedirect(this, GetLanguage("TransferSuccess"), "TransferToEmoney.aspx"); //转账成功
            }
            else
            {
                MessageBox.Show(this, GetLanguage("OperationFailed"));//操作失败
            }
        }
示例#12
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            long toUserID = 0;

            lgk.Model.tb_user   userInfo   = userBLL.GetModel(getLoginID());
            lgk.Model.tb_change changeInfo = new lgk.Model.tb_change();

            if (dropCurrency.SelectedValue == "0")
            {
                MessageBox.ShowBox(this.Page, GetLanguage("ChooseTransfer"), Library.Enums.ModalTypes.warning);//请选择转账类型
                return;
            }
            if (!CheckOpen(dropCurrency.SelectedValue))
            {
                MessageBox.ShowBox(this.Page, GetLanguage("Feature"), Library.Enums.ModalTypes.warning);//该功能未开放
                return;
            }
            int iTypeID = int.Parse(dropCurrency.SelectedValue);

            if (txtMoney.Text.Trim() == "")
            {
                MessageBox.ShowBox(this.Page, GetLanguage("transferMoneyIsnull"), Library.Enums.ModalTypes.warning);//转账金额不能为空
                return;
            }
            if (string.IsNullOrEmpty(txtSecondPassword.Text.Trim()))
            {
                MessageBox.ShowBox(this.Page, GetLanguage("SecondaryISNUll"), Library.Enums.ModalTypes.warning);//二级密码不能为空
                return;
            }

            decimal dResult = 0;

            if (decimal.TryParse(txtMoney.Text.Trim(), out dResult))
            {
                decimal dTrans = getParamAmount("Transfer1"); //转账最低金额
                decimal d      = getParamAmount("Transfer2"); //转账倍数基数
                if (dResult < dTrans)
                {
                    MessageBox.ShowBox(this.Page, GetLanguage("equalTo") + dTrans, Library.Enums.ModalTypes.warning); //转账金额必须是大于等于XX的整数
                    return;
                }
                if (d != 0 && dResult % d != 0)
                {
                    MessageBox.ShowBox(this.Page, GetLanguage("amountMustbe") + d + GetLanguage("Multiples"), Library.Enums.ModalTypes.warning); //转账金额必须是XX的倍数
                    return;
                }
            }

            if (iTypeID != 0)
            {
                if ((iTypeID == 1 || iTypeID == 2) && dResult > userInfo.BonusAccount)
                {
                    MessageBox.ShowBox(this.Page, GetLanguage("NotCurrent"), Library.Enums.ModalTypes.warning);//云图余额不足
                    return;
                }
                else if (iTypeID == 3 && dResult > userInfo.Emoney)
                {
                    MessageBox.ShowBox(this.Page, GetLanguage("moneyDollars"), Library.Enums.ModalTypes.warning);//云盾余额不足
                    return;
                }
                else if (iTypeID == 4 && dResult > userInfo.StockMoney)
                {
                    MessageBox.ShowBox(this.Page, GetLanguage("balanceDollars"), Library.Enums.ModalTypes.warning);//云图余额不足
                    return;
                }
                else if (iTypeID == 5 && dResult > userInfo.ShopAccount)
                {
                    MessageBox.ShowBox(this.Page, GetLanguage("NotCurrency"), Library.Enums.ModalTypes.warning);//云图余额不足
                    return;
                }
            }

            string strUserCode = txtUserCode.Text.Trim();
            var    toUser      = userBLL.GetModel(" UserCode='" + strUserCode + "'");

            if (toUser == null)
            {
                MessageBox.ShowBox(this.Page, GetLanguage("numberIsExist"), Library.Enums.ModalTypes.warning);//会员编号不存在
                return;
            }
            else
            {
                toUserID = int.Parse(toUser.UserID.ToString());
            }

            if (toUserID <= 0)
            {
                MessageBox.ShowBox(this.Page, GetLanguage("objectExist"), Library.Enums.ModalTypes.warning);//转帐对象不存在
                return;
            }

            if (dropCurrency.SelectedValue == "5")
            {
                if (toUserID == userInfo.UserID)
                {
                    MessageBox.ShowBox(this.Page, GetLanguage("TransferToOuner"), Library.Enums.ModalTypes.warning);//不能给自己转账
                    return;
                }

                if (!userBLL.OnRecommendSameLine(userInfo.UserID, toUserID))
                {
                    MessageBox.ShowBox(this.Page, GetLanguage("objectExist"), Library.Enums.ModalTypes.warning);//转帐对象不存在
                    return;
                }
            }

            if (!userInfo.SecondPassword.Equals(PageValidate.GetMd5(txtSecondPassword.Text.Trim())))
            {
                MessageBox.ShowBox(this.Page, GetLanguage("PasswordError"), Library.Enums.ModalTypes.error);//二级密码错误
                return;
            }

            changeInfo.UserID     = getLoginID();
            changeInfo.ToUserID   = toUserID;
            changeInfo.ToUserType = 0;
            changeInfo.MoneyType  = 0;
            changeInfo.Amount     = dResult;
            changeInfo.ChangeType = Convert.ToInt32(dropCurrency.SelectedValue);
            changeInfo.ChangeDate = DateTime.Now;
            changeInfo.Change005  = dResult - dResult * getParamAmount("Transfer3") / 100;

            if (changeBLL.Add(changeInfo) > 0)
            {
                try
                {
                    if (changeInfo.ChangeType == 1)//云图转换云盾
                    {
                        #region 云图转换云盾


                        decimal dBonusAccount = userBLL.GetMoney(getLoginID(), "BonusAccount");
                        if (dBonusAccount >= changeInfo.Amount)
                        {
                            UpdateAccount("BonusAccount", userInfo.UserID, changeInfo.Amount, 0); //
                            UpdateAccount("Emoney", toUserID, changeInfo.Change005, 1);           //
                            //加入流水账表(流通币减少)
                            lgk.Model.tb_journal model = new lgk.Model.tb_journal();
                            model.UserID    = userInfo.UserID;
                            model.Remark    = "云图转换云盾";
                            model.RemarkEn  = "Cash register integral transform integral";
                            model.InAmount  = 0;
                            model.OutAmount = changeInfo.Amount;

                            model.BalanceAmount = userBLL.GetMoney(getLoginID(), "BonusAccount");
                            model.JournalDate   = DateTime.Now;
                            model.JournalType   = (int)Library.AccountType.云图;
                            model.Journal01     = toUserID;
                            journalBLL.Add(model);

                            //加入流水账表(购物币增加)
                            lgk.Model.tb_journal journalInfo = new lgk.Model.tb_journal();
                            journalInfo.UserID        = toUserID;
                            journalInfo.Remark        = "云图转换云盾";
                            journalInfo.RemarkEn      = "Cash register integral transform integral";
                            journalInfo.InAmount      = changeInfo.Change005;
                            journalInfo.OutAmount     = 0;
                            journalInfo.BalanceAmount = userBLL.GetMoney(getLoginID(), "Emoney");
                            journalInfo.JournalDate   = DateTime.Now;
                            journalInfo.JournalType   = (int)Library.AccountType.云盾;
                            journalInfo.Journal01     = userInfo.UserID;

                            journalBLL.Add(journalInfo);
                        }
                        else
                        {
                            MessageBox.ShowBox(this.Page, GetLanguage("objectExist"), Library.Enums.ModalTypes.warning);//转帐对象不存在
                        }
                        #endregion
                    }
                    else if (changeInfo.ChangeType == 2)//云图转云图
                    {
                        #region 云图转云图
                        decimal dBonusAccount = userBLL.GetMoney(getLoginID(), "BonusAccount");
                        if (dBonusAccount >= changeInfo.Amount)
                        {
                            UpdateAccount("BonusAccount", userInfo.UserID, changeInfo.Amount, 0); //
                            UpdateAccount("StockMoney", toUserID, changeInfo.Change005, 1);       //
                            //加入流水账表(佣金币减少)
                            lgk.Model.tb_journal jmodel = new lgk.Model.tb_journal();
                            jmodel.UserID    = userInfo.UserID;
                            jmodel.Remark    = "云图转云图";
                            jmodel.RemarkEn  = "Cash conversion points";
                            jmodel.InAmount  = 0;
                            jmodel.OutAmount = changeInfo.Amount;

                            jmodel.BalanceAmount = userBLL.GetMoney(getLoginID(), "BonusAccount");
                            jmodel.JournalDate   = DateTime.Now;
                            jmodel.JournalType   = (int)Library.AccountType.云图;
                            jmodel.Journal01     = toUserID;
                            journalBLL.Add(jmodel);

                            //加入流水账表(现金币增加)
                            lgk.Model.tb_journal journalInfo = new lgk.Model.tb_journal();
                            journalInfo.UserID        = toUserID;
                            journalInfo.Remark        = "云图转云图";
                            journalInfo.RemarkEn      = "Cash conversion points";
                            journalInfo.InAmount      = changeInfo.Change005;
                            journalInfo.OutAmount     = 0;
                            journalInfo.BalanceAmount = userBLL.GetMoney(toUserID, "StockMoney");
                            journalInfo.JournalDate   = DateTime.Now;
                            journalInfo.JournalType   = (int)Library.AccountType.云图;
                            journalInfo.Journal01     = userInfo.UserID;
                            journalBLL.Add(journalInfo);
                        }
                        else
                        {
                            MessageBox.ShowBox(this.Page, GetLanguage("objectExist"), Library.Enums.ModalTypes.warning);//转帐对象不存在
                        }
                        #endregion
                    }
                    else if (changeInfo.ChangeType == 3)//云盾转给其他会员
                    {
                        #region 云盾转给其他会员
                        decimal dBonusAccount = userBLL.GetMoney(getLoginID(), "Emoney");
                        if (dBonusAccount >= changeInfo.Amount)
                        {
                            UpdateAccount("Emoney", userInfo.UserID, changeInfo.Amount, 0); //
                            UpdateAccount("Emoney", toUserID, changeInfo.Change005, 1);     //
                            //加入流水账表(佣金币减少)
                            lgk.Model.tb_journal jmodel = new lgk.Model.tb_journal();
                            jmodel.UserID        = userInfo.UserID;
                            jmodel.Remark        = "云盾转给" + txtUserCode.Text;;
                            jmodel.RemarkEn      = "Currency to shopping currency";
                            jmodel.InAmount      = 0;
                            jmodel.OutAmount     = changeInfo.Amount;
                            jmodel.BalanceAmount = userBLL.GetMoney(getLoginID(), "Emoney");
                            jmodel.JournalDate   = DateTime.Now;
                            jmodel.JournalType   = (int)Library.AccountType.云盾;
                            jmodel.Journal01     = toUserID;
                            journalBLL.Add(jmodel);

                            //加入流水账表(现金币增加)
                            lgk.Model.tb_journal journalInfo = new lgk.Model.tb_journal();
                            journalInfo.UserID        = toUserID;
                            journalInfo.Remark        = "获得" + LoginUser.UserCode + "转来云盾";
                            journalInfo.RemarkEn      = "Currency to shopping currency";
                            journalInfo.InAmount      = changeInfo.Change005;
                            journalInfo.OutAmount     = 0;
                            journalInfo.BalanceAmount = userBLL.GetMoney(toUserID, "Emoney");
                            journalInfo.JournalDate   = DateTime.Now;
                            journalInfo.JournalType   = (int)Library.AccountType.云盾;
                            journalInfo.Journal01     = userInfo.UserID;
                            journalBLL.Add(journalInfo);
                        }
                        else
                        {
                            MessageBox.ShowBox(this.Page, GetLanguage("objectExist"), Library.Enums.ModalTypes.warning);//转帐对象不存在
                        }
                        #endregion
                    }
                    else if (changeInfo.ChangeType == 4)//云图转给其他会员
                    {
                        #region 云图转给其他会员
                        decimal dStockAccount = userBLL.GetMoney(getLoginID(), "StockMoney");
                        if (dStockAccount >= changeInfo.Amount)
                        {
                            UpdateAccount("StockMoney", userInfo.UserID, changeInfo.Amount, 0); //
                            UpdateAccount("StockMoney", toUserID, changeInfo.Change005, 1);     //
                            //加入流水账表(佣金币减少)
                            lgk.Model.tb_journal jmodel = new lgk.Model.tb_journal();
                            jmodel.UserID        = userInfo.UserID;
                            jmodel.Remark        = "云图转给" + txtUserCode.Text;
                            jmodel.RemarkEn      = "Investment points transferred to shopping currency";
                            jmodel.InAmount      = 0;
                            jmodel.OutAmount     = changeInfo.Amount;
                            jmodel.BalanceAmount = userBLL.GetMoney(getLoginID(), "StockMoney");
                            jmodel.JournalDate   = DateTime.Now;
                            jmodel.JournalType   = (int)Library.AccountType.云图;
                            jmodel.Journal01     = toUserID;
                            journalBLL.Add(jmodel);

                            //加入流水账表(现金币增加)
                            lgk.Model.tb_journal journalInfo = new lgk.Model.tb_journal();
                            journalInfo.UserID        = toUserID;
                            journalInfo.Remark        = "获得" + LoginUser.UserCode + "转来云图";
                            journalInfo.RemarkEn      = "Investment points transferred to shopping currency";
                            journalInfo.InAmount      = changeInfo.Change005;
                            journalInfo.OutAmount     = 0;
                            journalInfo.BalanceAmount = userBLL.GetMoney(toUserID, "StockMoney");
                            journalInfo.JournalDate   = DateTime.Now;
                            journalInfo.JournalType   = (int)Library.AccountType.云图;
                            journalInfo.Journal01     = userInfo.UserID;
                            journalBLL.Add(journalInfo);
                        }
                        else
                        {
                            MessageBox.ShowBox(this.Page, GetLanguage("objectExist"), Library.Enums.ModalTypes.warning);//转帐对象不存在
                            return;
                        }
                        #endregion
                    }
                    else if (changeInfo.ChangeType == 5)//云图转其他会员
                    {
                        #region 云图转其他会员
                        decimal dStockAccount = userBLL.GetMoney(getLoginID(), "ShopAccount");
                        if (dStockAccount >= changeInfo.Amount)
                        {
                            UpdateAccount("ShopAccount", userInfo.UserID, changeInfo.Amount, 0); //
                            UpdateAccount("ShopAccount", toUserID, changeInfo.Change005, 1);     //
                            //加入流水账表(佣金币减少)
                            lgk.Model.tb_journal jmodel = new lgk.Model.tb_journal();
                            jmodel.UserID        = userInfo.UserID;
                            jmodel.Remark        = "云图转给" + txtUserCode.Text;
                            jmodel.RemarkEn      = "Transaction code transfer to " + txtUserCode.Text;
                            jmodel.InAmount      = 0;
                            jmodel.OutAmount     = changeInfo.Amount;
                            jmodel.BalanceAmount = userBLL.GetMoney(getLoginID(), "ShopAccount");
                            jmodel.JournalDate   = DateTime.Now;
                            jmodel.JournalType   = (int)Library.AccountType.云图;
                            jmodel.Journal01     = toUserID;
                            journalBLL.Add(jmodel);

                            //加入流水账表(现金币增加)
                            lgk.Model.tb_journal journalInfo = new lgk.Model.tb_journal();
                            journalInfo.UserID        = toUserID;
                            journalInfo.Remark        = "获得" + LoginUser.UserCode + "转来云图";
                            journalInfo.RemarkEn      = "Get " + LoginUser.UserCode + " Transaction code transfer";
                            journalInfo.InAmount      = changeInfo.Change005;
                            journalInfo.OutAmount     = 0;
                            journalInfo.BalanceAmount = userBLL.GetMoney(toUserID, "ShopAccount");
                            journalInfo.JournalDate   = DateTime.Now;
                            journalInfo.JournalType   = (int)Library.AccountType.云图;
                            journalInfo.Journal01     = userInfo.UserID;
                            journalBLL.Add(journalInfo);
                        }
                        else
                        {
                            MessageBox.ShowBox(this.Page, GetLanguage("objectExist"), Library.Enums.ModalTypes.warning);//转帐对象不存在
                        }
                        #endregion
                    }
                }
                catch
                {
                    MessageBox.ShowBox(this.Page, GetLanguage("addError"), Library.Enums.ModalTypes.error);//添加流水账错误
                }

                MessageBox.ShowBox(this.Page, GetLanguage("TransferSuccess"), Library.Enums.ModalTypes.success, "TransferToEmoney.aspx");//转账成功
            }
            else
            {
                MessageBox.ShowBox(this.Page, GetLanguage("addError"), Library.Enums.ModalTypes.error);//操作失败
            }
        }
示例#13
0
文件: tb_user.cs 项目: githexing/05
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <lgk.Model.tb_user> DataTableToList(DataTable dt)
        {
            List <lgk.Model.tb_user> modelList = new List <lgk.Model.tb_user>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                lgk.Model.tb_user model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new lgk.Model.tb_user();
                    if (dt.Rows[n]["UserID"] != null && dt.Rows[n]["UserID"].ToString() != "")
                    {
                        model.UserID = long.Parse(dt.Rows[n]["UserID"].ToString());
                    }
                    if (dt.Rows[n]["UserCode"] != null && dt.Rows[n]["UserCode"].ToString() != "")
                    {
                        model.UserCode = dt.Rows[n]["UserCode"].ToString();
                    }
                    if (dt.Rows[n]["LevelID"] != null && dt.Rows[n]["LevelID"].ToString() != "")
                    {
                        model.LevelID = int.Parse(dt.Rows[n]["LevelID"].ToString());
                    }
                    if (dt.Rows[n]["RecommendID"] != null && dt.Rows[n]["RecommendID"].ToString() != "")
                    {
                        model.RecommendID = long.Parse(dt.Rows[n]["RecommendID"].ToString());
                    }
                    if (dt.Rows[n]["RecommendCode"] != null && dt.Rows[n]["RecommendCode"].ToString() != "")
                    {
                        model.RecommendCode = dt.Rows[n]["RecommendCode"].ToString();
                    }
                    if (dt.Rows[n]["RecommendPath"] != null && dt.Rows[n]["RecommendPath"].ToString() != "")
                    {
                        model.RecommendPath = dt.Rows[n]["RecommendPath"].ToString();
                    }
                    if (dt.Rows[n]["RecommendGenera"] != null && dt.Rows[n]["RecommendGenera"].ToString() != "")
                    {
                        model.RecommendGenera = int.Parse(dt.Rows[n]["RecommendGenera"].ToString());
                    }
                    if (dt.Rows[n]["ParentID"] != null && dt.Rows[n]["ParentID"].ToString() != "")
                    {
                        model.ParentID = long.Parse(dt.Rows[n]["ParentID"].ToString());
                    }
                    if (dt.Rows[n]["ParentCode"] != null && dt.Rows[n]["ParentCode"].ToString() != "")
                    {
                        model.ParentCode = dt.Rows[n]["ParentCode"].ToString();
                    }
                    if (dt.Rows[n]["UserPath"] != null && dt.Rows[n]["UserPath"].ToString() != "")
                    {
                        model.UserPath = dt.Rows[n]["UserPath"].ToString();
                    }
                    if (dt.Rows[n]["Layer"] != null && dt.Rows[n]["Layer"].ToString() != "")
                    {
                        model.Layer = int.Parse(dt.Rows[n]["Layer"].ToString());
                    }
                    if (dt.Rows[n]["Location"] != null && dt.Rows[n]["Location"].ToString() != "")
                    {
                        model.Location = int.Parse(dt.Rows[n]["Location"].ToString());
                    }
                    if (dt.Rows[n]["IsOpend"] != null && dt.Rows[n]["IsOpend"].ToString() != "")
                    {
                        model.IsOpend = int.Parse(dt.Rows[n]["IsOpend"].ToString());
                    }
                    if (dt.Rows[n]["IsLock"] != null && dt.Rows[n]["IsLock"].ToString() != "")
                    {
                        model.IsLock = int.Parse(dt.Rows[n]["IsLock"].ToString());
                    }
                    if (dt.Rows[n]["IsAgent"] != null && dt.Rows[n]["IsAgent"].ToString() != "")
                    {
                        model.IsAgent = int.Parse(dt.Rows[n]["IsAgent"].ToString());
                    }
                    if (dt.Rows[n]["AgentsID"] != null && dt.Rows[n]["AgentsID"].ToString() != "")
                    {
                        model.AgentsID = long.Parse(dt.Rows[n]["AgentsID"].ToString());
                    }
                    if (dt.Rows[n]["Emoney"] != null && dt.Rows[n]["Emoney"].ToString() != "")
                    {
                        model.Emoney = decimal.Parse(dt.Rows[n]["Emoney"].ToString());
                    }
                    if (dt.Rows[n]["BonusAccount"] != null && dt.Rows[n]["BonusAccount"].ToString() != "")
                    {
                        model.BonusAccount = decimal.Parse(dt.Rows[n]["BonusAccount"].ToString());
                    }
                    if (dt.Rows[n]["AllBonusAccount"] != null && dt.Rows[n]["AllBonusAccount"].ToString() != "")
                    {
                        model.AllBonusAccount = decimal.Parse(dt.Rows[n]["AllBonusAccount"].ToString());
                    }
                    if (dt.Rows[n]["StockAccount"] != null && dt.Rows[n]["StockAccount"].ToString() != "")
                    {
                        model.StockAccount = decimal.Parse(dt.Rows[n]["StockAccount"].ToString());
                    }
                    if (dt.Rows[n]["StockMoney"] != null && dt.Rows[n]["StockMoney"].ToString() != "")
                    {
                        model.StockMoney = decimal.Parse(dt.Rows[n]["StockMoney"].ToString());
                    }
                    if (dt.Rows[n]["ShopAccount"] != null && dt.Rows[n]["ShopAccount"].ToString() != "")
                    {
                        model.ShopAccount = decimal.Parse(dt.Rows[n]["ShopAccount"].ToString());
                    }
                    if (dt.Rows[n]["RegTime"] != null && dt.Rows[n]["RegTime"].ToString() != "")
                    {
                        model.RegTime = DateTime.Parse(dt.Rows[n]["RegTime"].ToString());
                    }
                    if (dt.Rows[n]["OpenTime"] != null && dt.Rows[n]["OpenTime"].ToString() != "")
                    {
                        model.OpenTime = DateTime.Parse(dt.Rows[n]["OpenTime"].ToString());
                    }
                    if (dt.Rows[n]["RegMoney"] != null && dt.Rows[n]["RegMoney"].ToString() != "")
                    {
                        model.RegMoney = decimal.Parse(dt.Rows[n]["RegMoney"].ToString());
                    }
                    if (dt.Rows[n]["BillCount"] != null && dt.Rows[n]["BillCount"].ToString() != "")
                    {
                        model.BillCount = int.Parse(dt.Rows[n]["BillCount"].ToString());
                    }
                    if (dt.Rows[n]["GLmoney"] != null && dt.Rows[n]["GLmoney"].ToString() != "")
                    {
                        model.GLmoney = decimal.Parse(dt.Rows[n]["GLmoney"].ToString());
                    }
                    if (dt.Rows[n]["AddGLTime"] != null && dt.Rows[n]["AddGLTime"].ToString() != "")
                    {
                        model.AddGLTime = DateTime.Parse(dt.Rows[n]["AddGLTime"].ToString());
                    }
                    if (dt.Rows[n]["Password"] != null && dt.Rows[n]["Password"].ToString() != "")
                    {
                        model.Password = dt.Rows[n]["Password"].ToString();
                    }
                    if (dt.Rows[n]["SecondPassword"] != null && dt.Rows[n]["SecondPassword"].ToString() != "")
                    {
                        model.SecondPassword = dt.Rows[n]["SecondPassword"].ToString();
                    }
                    if (dt.Rows[n]["ThreePassword"] != null && dt.Rows[n]["ThreePassword"].ToString() != "")
                    {
                        model.ThreePassword = dt.Rows[n]["ThreePassword"].ToString();
                    }
                    if (dt.Rows[n]["SafetyCodeQuestion"] != null && dt.Rows[n]["SafetyCodeQuestion"].ToString() != "")
                    {
                        model.SafetyCodeQuestion = dt.Rows[n]["SafetyCodeQuestion"].ToString();
                    }
                    if (dt.Rows[n]["SafetyCodeAnswer"] != null && dt.Rows[n]["SafetyCodeAnswer"].ToString() != "")
                    {
                        model.SafetyCodeAnswer = dt.Rows[n]["SafetyCodeAnswer"].ToString();
                    }
                    if (dt.Rows[n]["LeftScore"] != null && dt.Rows[n]["LeftScore"].ToString() != "")
                    {
                        model.LeftScore = decimal.Parse(dt.Rows[n]["LeftScore"].ToString());
                    }
                    if (dt.Rows[n]["CenterScore"] != null && dt.Rows[n]["CenterScore"].ToString() != "")
                    {
                        model.CenterScore = decimal.Parse(dt.Rows[n]["CenterScore"].ToString());
                    }
                    if (dt.Rows[n]["RightScore"] != null && dt.Rows[n]["RightScore"].ToString() != "")
                    {
                        model.RightScore = decimal.Parse(dt.Rows[n]["RightScore"].ToString());
                    }
                    if (dt.Rows[n]["LeftBalance"] != null && dt.Rows[n]["LeftBalance"].ToString() != "")
                    {
                        model.LeftBalance = decimal.Parse(dt.Rows[n]["LeftBalance"].ToString());
                    }
                    if (dt.Rows[n]["CenterBalance"] != null && dt.Rows[n]["CenterBalance"].ToString() != "")
                    {
                        model.CenterBalance = decimal.Parse(dt.Rows[n]["CenterBalance"].ToString());
                    }
                    if (dt.Rows[n]["RightBalance"] != null && dt.Rows[n]["RightBalance"].ToString() != "")
                    {
                        model.RightBalance = decimal.Parse(dt.Rows[n]["RightBalance"].ToString());
                    }
                    if (dt.Rows[n]["LeftNewScore"] != null && dt.Rows[n]["LeftNewScore"].ToString() != "")
                    {
                        model.LeftNewScore = decimal.Parse(dt.Rows[n]["LeftNewScore"].ToString());
                    }
                    if (dt.Rows[n]["CenterNewScore"] != null && dt.Rows[n]["CenterNewScore"].ToString() != "")
                    {
                        model.CenterNewScore = decimal.Parse(dt.Rows[n]["CenterNewScore"].ToString());
                    }
                    if (dt.Rows[n]["RightNewScore"] != null && dt.Rows[n]["RightNewScore"].ToString() != "")
                    {
                        model.RightNewScore = decimal.Parse(dt.Rows[n]["RightNewScore"].ToString());
                    }
                    if (dt.Rows[n]["LeftZT"] != null && dt.Rows[n]["LeftZT"].ToString() != "")
                    {
                        model.LeftZT = decimal.Parse(dt.Rows[n]["LeftZT"].ToString());
                    }
                    if (dt.Rows[n]["CenterZT"] != null && dt.Rows[n]["CenterZT"].ToString() != "")
                    {
                        model.CenterZT = decimal.Parse(dt.Rows[n]["CenterZT"].ToString());
                    }
                    if (dt.Rows[n]["RightZT"] != null && dt.Rows[n]["RightZT"].ToString() != "")
                    {
                        model.RightZT = decimal.Parse(dt.Rows[n]["RightZT"].ToString());
                    }
                    if (dt.Rows[n]["BankAccount"] != null && dt.Rows[n]["BankAccount"].ToString() != "")
                    {
                        model.BankAccount = dt.Rows[n]["BankAccount"].ToString();
                    }
                    if (dt.Rows[n]["BankAccountUser"] != null && dt.Rows[n]["BankAccountUser"].ToString() != "")
                    {
                        model.BankAccountUser = dt.Rows[n]["BankAccountUser"].ToString();
                    }
                    if (dt.Rows[n]["BankName"] != null && dt.Rows[n]["BankName"].ToString() != "")
                    {
                        model.BankName = dt.Rows[n]["BankName"].ToString();
                    }
                    if (dt.Rows[n]["BankBranch"] != null && dt.Rows[n]["BankBranch"].ToString() != "")
                    {
                        model.BankBranch = dt.Rows[n]["BankBranch"].ToString();
                    }
                    if (dt.Rows[n]["BankInProvince"] != null && dt.Rows[n]["BankInProvince"].ToString() != "")
                    {
                        model.BankInProvince = dt.Rows[n]["BankInProvince"].ToString();
                    }
                    if (dt.Rows[n]["BankInCity"] != null && dt.Rows[n]["BankInCity"].ToString() != "")
                    {
                        model.BankInCity = dt.Rows[n]["BankInCity"].ToString();
                    }
                    if (dt.Rows[n]["Address"] != null && dt.Rows[n]["Address"].ToString() != "")
                    {
                        model.Address = dt.Rows[n]["Address"].ToString();
                    }
                    if (dt.Rows[n]["TrueName"] != null && dt.Rows[n]["TrueName"].ToString() != "")
                    {
                        model.TrueName = dt.Rows[n]["TrueName"].ToString();
                    }
                    if (dt.Rows[n]["NiceName"] != null && dt.Rows[n]["NiceName"].ToString() != "")
                    {
                        model.NiceName = dt.Rows[n]["NiceName"].ToString();
                    }
                    if (dt.Rows[n]["IdenCode"] != null && dt.Rows[n]["IdenCode"].ToString() != "")
                    {
                        model.IdenCode = dt.Rows[n]["IdenCode"].ToString();
                    }
                    if (dt.Rows[n]["PhoneNum"] != null && dt.Rows[n]["PhoneNum"].ToString() != "")
                    {
                        model.PhoneNum = dt.Rows[n]["PhoneNum"].ToString();
                    }
                    if (dt.Rows[n]["Gender"] != null && dt.Rows[n]["Gender"].ToString() != "")
                    {
                        model.Gender = int.Parse(dt.Rows[n]["Gender"].ToString());
                    }
                    if (dt.Rows[n]["QQnumer"] != null && dt.Rows[n]["QQnumer"].ToString() != "")
                    {
                        model.QQnumer = dt.Rows[n]["QQnumer"].ToString();
                    }
                    if (dt.Rows[n]["User001"] != null && dt.Rows[n]["User001"].ToString() != "")
                    {
                        model.User001 = int.Parse(dt.Rows[n]["User001"].ToString());
                    }
                    if (dt.Rows[n]["User002"] != null && dt.Rows[n]["User002"].ToString() != "")
                    {
                        model.User002 = long.Parse(dt.Rows[n]["User002"].ToString());
                    }
                    if (dt.Rows[n]["User003"] != null && dt.Rows[n]["User003"].ToString() != "")
                    {
                        model.User003 = int.Parse(dt.Rows[n]["User003"].ToString());
                    }
                    if (dt.Rows[n]["User004"] != null && dt.Rows[n]["User004"].ToString() != "")
                    {
                        model.User004 = int.Parse(dt.Rows[n]["User004"].ToString());
                    }
                    if (dt.Rows[n]["User005"] != null && dt.Rows[n]["User005"].ToString() != "")
                    {
                        model.User005 = dt.Rows[n]["User005"].ToString();
                    }
                    if (dt.Rows[n]["User006"] != null && dt.Rows[n]["User006"].ToString() != "")
                    {
                        model.User006 = dt.Rows[n]["User006"].ToString();
                    }
                    if (dt.Rows[n]["User007"] != null && dt.Rows[n]["User007"].ToString() != "")
                    {
                        model.User007 = dt.Rows[n]["User007"].ToString();
                    }
                    if (dt.Rows[n]["User008"] != null && dt.Rows[n]["User008"].ToString() != "")
                    {
                        model.User008 = dt.Rows[n]["User008"].ToString();
                    }
                    if (dt.Rows[n]["User009"] != null && dt.Rows[n]["User009"].ToString() != "")
                    {
                        model.User009 = dt.Rows[n]["User009"].ToString();
                    }
                    if (dt.Rows[n]["User010"] != null && dt.Rows[n]["User010"].ToString() != "")
                    {
                        model.User010 = dt.Rows[n]["User010"].ToString();
                    }
                    if (dt.Rows[n]["User011"] != null && dt.Rows[n]["User011"].ToString() != "")
                    {
                        model.User011 = decimal.Parse(dt.Rows[n]["User011"].ToString());
                    }
                    if (dt.Rows[n]["User012"] != null && dt.Rows[n]["User012"].ToString() != "")
                    {
                        model.User012 = decimal.Parse(dt.Rows[n]["User012"].ToString());
                    }
                    if (dt.Rows[n]["User013"] != null && dt.Rows[n]["User013"].ToString() != "")
                    {
                        model.User013 = decimal.Parse(dt.Rows[n]["User013"].ToString());
                    }
                    if (dt.Rows[n]["User014"] != null && dt.Rows[n]["User014"].ToString() != "")
                    {
                        model.User014 = decimal.Parse(dt.Rows[n]["User014"].ToString());
                    }
                    if (dt.Rows[n]["User015"] != null && dt.Rows[n]["User015"].ToString() != "")
                    {
                        model.User015 = decimal.Parse(dt.Rows[n]["User015"].ToString());
                    }
                    if (dt.Rows[n]["User016"] != null && dt.Rows[n]["User016"].ToString() != "")
                    {
                        model.User016 = decimal.Parse(dt.Rows[n]["User016"].ToString());
                    }
                    if (dt.Rows[n]["User017"] != null && dt.Rows[n]["User017"].ToString() != "")
                    {
                        model.User017 = decimal.Parse(dt.Rows[n]["User017"].ToString());
                    }
                    if (dt.Rows[n]["User018"] != null && dt.Rows[n]["User018"].ToString() != "")
                    {
                        model.User018 = decimal.Parse(dt.Rows[n]["User018"].ToString());
                    }
                    if (dt.Rows[n]["IsOut"] != null && dt.Rows[n]["IsOut"].ToString() != "")
                    {
                        model.IsOut = int.Parse(dt.Rows[n]["IsOut"].ToString());
                    }
                    if (dt.Rows[n]["Batch"] != null && dt.Rows[n]["Batch"].ToString() != "")
                    {
                        model.Batch = int.Parse(dt.Rows[n]["Batch"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }