Example #1
0
        public string adre(int type)
        {
            string bi = "";

            lgk.Model.tb_agent typer = agentBLL.GetModel("userid=" + type);
            if (typer == null)
            {
                bi = "无";
            }
            else
            {
                if (typer.AgentType == 1)
                {
                    bi = "一级服务中心";
                }
                else if (typer.AgentType == 2)
                {
                    bi = "二级服务中心";
                }
                else if (typer.AgentType == 3)
                {
                    bi = "三级服务中心";
                }
            }
            return(bi);
        }
Example #2
0
        protected void Repeater2_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            int ID = int.Parse(e.CommandArgument.ToString());

            lgk.Model.tb_agent agent = agentBLL.GetModel(ID);
            if (e.CommandName == "close")
            {
                agent.Flag = 2;
                agentBLL.Update(agent);
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('冻结成功!');", true);
            }
            if (e.CommandName == "open")
            {
                agent.Flag = 1;
                agentBLL.Update(agent);
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('解冻成功!');", true);
            }
            if (e.CommandName == "close_hx")
            {
                agent.Agent001 = 1;
                agentBLL.Update(agent);
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('设置空单成功!');", true);
            }
            if (e.CommandName == "open_hx")
            {
                agent.Agent001 = 0;
                agentBLL.Update(agent);
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('取消空单成功!');", true);
            }
            if (e.CommandName == "list")
            {
                Response.Redirect("UserList.aspx?id=" + ID);
            }
            bind2();
        }
Example #3
0
 private void bind()
 {
     Button3.Visible          = false;
     txtAddress.Disabled      = true;
     DropDownList4.Enabled    = false;
     DropDownList5.Enabled    = false;
     tr2.Visible              = false;
     RadioButtonList1.Enabled = false;
     txtAgentCode.Disabled    = true;
     txtCode.Disabled         = true;
     lgk.Model.tb_agent model = agentBLL.GetModel(getIntRequest("agentid"));
     if (model.Flag == 0)
     {
         tr1.Visible = true;
     }
     txtAgentCode.Value = model.AgentCode;
     RadioButtonList1.Items[model.AgentType - 1].Selected = true;
     txtCode.Value      = model.Agent003;
     img2.Src           = "../../Upload/" + model.PicLink;
     this.example1.HRef = "../../Upload/" + model.PicLink;
     if (model.AgentType == 2)
     {
         this.DropDownList4.SelectedItem.Text = model.AgentInProvince;
         ListItem lt1 = new ListItem();
         lt1.Value = model.AgentInCity;
         lt1.Text  = model.AgentInCity;
         this.DropDownList5.Items.Add(lt1);
         this.DropDownList5.SelectedValue = model.AgentInCity;
         txtAddress.Value = model.AgentAddress;
         Div1.Visible     = true;
     }
 }
Example #4
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public long Add(lgk.Model.tb_agent model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into tb_agent(");
            strSql.Append("AgentCode,Flag,UserID,AgentType,AppliTime,JoinMoney,OpenTime,PicLink,AgentInProvince,AgentInCity,AgentAddress,Agent001,Agent002,Agent003,Agent004,Agent005,Agent006)");
            strSql.Append(" values (");
            strSql.Append("@AgentCode,@Flag,@UserID,@AgentType,@AppliTime,@JoinMoney,@OpenTime,@PicLink,@AgentInProvince,@AgentInCity,@AgentAddress,@Agent001,@Agent002,@Agent003,@Agent004,@Agent005,@Agent006)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@AgentCode",       SqlDbType.VarChar,   50),
                new SqlParameter("@Flag",            SqlDbType.Int,        4),
                new SqlParameter("@UserID",          SqlDbType.BigInt,     8),
                new SqlParameter("@AgentType",       SqlDbType.Int,        4),
                new SqlParameter("@AppliTime",       SqlDbType.DateTime),
                new SqlParameter("@JoinMoney",       SqlDbType.Decimal,    9),
                new SqlParameter("@OpenTime",        SqlDbType.DateTime),
                new SqlParameter("@PicLink",         SqlDbType.VarChar,   50),
                new SqlParameter("@AgentInProvince", SqlDbType.VarChar,   50),
                new SqlParameter("@AgentInCity",     SqlDbType.VarChar,   50),
                new SqlParameter("@AgentAddress",    SqlDbType.VarChar,   50),
                new SqlParameter("@Agent001",        SqlDbType.Int,        4),
                new SqlParameter("@Agent002",        SqlDbType.Int,        4),
                new SqlParameter("@Agent003",        SqlDbType.VarChar,   50),
                new SqlParameter("@Agent004",        SqlDbType.VarChar,   50),
                new SqlParameter("@Agent005",        SqlDbType.Decimal,    9),
                new SqlParameter("@Agent006",        SqlDbType.Decimal, 9)
            };
            parameters[0].Value  = model.AgentCode;
            parameters[1].Value  = model.Flag;
            parameters[2].Value  = model.UserID;
            parameters[3].Value  = model.AgentType;
            parameters[4].Value  = model.AppliTime;
            parameters[5].Value  = model.JoinMoney;
            parameters[6].Value  = model.OpenTime;
            parameters[7].Value  = model.PicLink;
            parameters[8].Value  = model.AgentInProvince;
            parameters[9].Value  = model.AgentInCity;
            parameters[10].Value = model.AgentAddress;
            parameters[11].Value = model.Agent001;
            parameters[12].Value = model.Agent002;
            parameters[13].Value = model.Agent003;
            parameters[14].Value = model.Agent004;
            parameters[15].Value = model.Agent005;
            parameters[16].Value = model.Agent006;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt64(obj));
            }
        }
Example #5
0
        protected void Repeater2_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            int ID = int.Parse(e.CommandArgument.ToString());

            lgk.Model.tb_agent agent = agentBLL.GetModel(ID);
            TextBox            Jine  = (TextBox)e.Item.FindControl("Jine");//金额
            decimal            jine  = 0;

            if (decimal.TryParse(Jine.Text, out jine))
            {
            }
            if (e.CommandName == "close")
            {
                spd.jumpAdminUrl1(this.Page, 1);//跳转三级密码

                agent.Flag = 2;
                agentBLL.Update(agent);
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('冻结成功!');", true);
            }
            if (e.CommandName == "open")
            {
                spd.jumpAdminUrl1(this.Page, 1);//跳转三级密码

                agent.Flag = 1;
                agentBLL.Update(agent);
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('解冻成功!');", true);
            }
            if (e.CommandName == "close_hx")
            {
                spd.jumpAdminUrl1(this.Page, 1);//跳转三级密码

                agent.Agent001 = 1;
                agentBLL.Update(agent);
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('设置空单成功!');", true);
            }
            if (e.CommandName == "open_hx")
            {
                spd.jumpAdminUrl1(this.Page, 1);//跳转三级密码

                agent.Agent001 = 0;
                agentBLL.Update(agent);
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('取消空单成功!');", true);
            }
            if (e.CommandName == "list")
            {
                Response.Redirect("UserList.aspx?id=" + ID);
            }
            bind2();
        }
Example #6
0
        /// <summary>
        /// 审核分页申请记录
        /// </summary>
        /// <param name="source"></param>
        /// <param name="e"></param>
        protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            long iID = long.Parse(e.CommandArgument.ToString());

            lgk.Model.tb_agent agentInfo = agentBLL.GetModel(iID);
            if (agentInfo == null)
            {
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('已删除,无法再进行此操作!');window.location.href='Agent.aspx';", true);
            }
            else
            {
                if (agentInfo.Flag != 0)
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('该服务中心已激活,不能再进行此操作!');window.location.href='Agent.aspx';", true);
                }
                else
                {
                    if (e.CommandName == "Remove")
                    {
                        if (agentBLL.Delete(iID))
                        {
                            ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('删除成功!');window.location.href='Agent.aspx';", true);
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('删除失败!');window.location.href='Agent.aspx';", true);
                        }
                    }
                    if (e.CommandName == "Open")
                    {
                        agentInfo.Flag     = 1;
                        agentInfo.OpenTime = DateTime.Now;

                        if (agentBLL.Update(agentInfo))
                        {
                            string strUserCode = userBLL.GetUserCode(agentInfo.UserID);

                            userBLL.UpdateAgent(agentInfo.UserID);
                            UpdateAgent(iID, agentInfo.UserID, strUserCode);

                            ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('激活成功!');window.location.href='Agent.aspx';", true);
                        }
                    }
                }
            }
            BindData();
        }
Example #7
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            int iAgentOpend = getParamInt("Agent");//是否可申请服务中心(0否,1是)

            if (iAgentOpend == 0)
            {
                MessageBox.ShowBox(this.Page, GetLanguage("Feature"), Library.Enums.ModalTypes.warning);
                return;
            }

            if (Loginagent != null)
            {
                if (Loginagent.Flag == 0)
                {
                    MessageBox.ShowBox(this.Page, GetLanguage("pleaseWait"), Library.Enums.ModalTypes.warning);//您的申请已提交,请耐心等待
                    return;
                }

                MessageBox.ShowBox(this.Page, GetLanguage("DeclarationAgent"), Library.Enums.ModalTypes.warning);
                return;
            }

            lgk.Model.tb_agent model = new lgk.Model.tb_agent();
            model.UserID    = getLoginID();
            model.AgentCode = LoginUser.UserCode;
            model.Flag      = 0;
            model.AgentType = LoginUser.LevelID;
            model.Agent003  = LoginUser.TrueName;
            model.AppliTime = DateTime.Now;
            model.JoinMoney = getParamAmount("Level" + LoginUser.LevelID);
            model.Agent004  = "";
            model.Agent001  = 0;
            model.Agent002  = 0;
            model.PicLink   = "";

            if (agentBLL.Add(model) > 0)
            {
                MessageBox.ShowBox(this.Page, GetLanguage("Successful"), Library.Enums.ModalTypes.success);
                ShowData();
            }
            else
            {
                MessageBox.ShowBox(this.Page, GetLanguage("OperationFailed"), Library.Enums.ModalTypes.error);
            }
        }
Example #8
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            int iAgentOpend = getParamInt("Agent");//是否可申请报单中心(0否,1是)

            if (iAgentOpend == 0)
            {
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("Feature") + "');", true);//该功能未开放
                return;
            }

            if (Loginagent != null)
            {
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("pleaseWait") + "');", true);//您的申请已提交,请耐心等待
                return;
            }

            if (userBLL.GetCount("RecommendID=" + LoginUser.UserID + " AND IsOpend = 2") < getParamInt("Agent1"))
            {
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("InsufficientNumber") + "');", true);//推荐人数不足
                return;
            }

            lgk.Model.tb_agent model = new lgk.Model.tb_agent();
            model.UserID    = getLoginID();
            model.AgentCode = LoginUser.UserCode;
            model.Flag      = 0;
            model.AgentType = LoginUser.LevelID;
            model.Agent003  = LoginUser.TrueName;
            model.AppliTime = DateTime.Now;
            model.JoinMoney = getParamAmount("Level" + LoginUser.LevelID);
            model.Agent004  = "";
            model.Agent001  = 0;
            model.Agent002  = 0;
            model.PicLink   = "";

            if (agentBLL.Add(model) > 0)
            {
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("Successful") + "');window.location.href='Agent.aspx';", true);//申请XX成功
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("OperationFailed") + "');", true);//申请失败
            }
        }
Example #9
0
 private void ShowData()
 {
     ltAgentCode.Text = LoginUser.UserCode;
     lgk.Model.tb_agent Loginagent = agentBLL.GetModel(agentBLL.GetAgentsIDByUserCode(LoginUser.UserCode));
     if (Loginagent != null)//申请服务中心时,判断该用户是否为服务中心
     {
         div2.Visible      = true;
         btnSubmit.Visible = false;
         ltAudit.Visible   = true;
         if (Loginagent.Flag == 1)
         {
             ltAudit.Text = GetLanguage("DeclarationAgent");//审核中
         }
         else
         {
             ltAudit.Text = GetLanguage("Audit");//审核中
         }
     }
     else
     {
         div2.Visible    = false;
         ltAudit.Visible = false;
     }
 }
Example #10
0
        /// <summary>
        /// 获得服务中心
        /// </summary>
        /// <param name="where">条件</param>
        /// <returns></returns>
        public lgk.Model.tb_agent GetModel(string where)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 ID,AgentCode,Flag,UserID,AgentType,AppliTime,JoinMoney,OpenTime,PicLink,AgentInProvince,AgentInCity,AgentAddress,Agent001,Agent002,Agent003,Agent004,Agent005,Agent006 from tb_agent ");
            strSql.Append(" where " + where);
            lgk.Model.tb_agent model = new lgk.Model.tb_agent();
            DataSet            ds    = DbHelperSQL.Query(strSql.ToString(), null);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["ID"] != null && ds.Tables[0].Rows[0]["ID"].ToString() != "")
                {
                    model.ID = long.Parse(ds.Tables[0].Rows[0]["ID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["AgentCode"] != null && ds.Tables[0].Rows[0]["AgentCode"].ToString() != "")
                {
                    model.AgentCode = ds.Tables[0].Rows[0]["AgentCode"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Flag"] != null && ds.Tables[0].Rows[0]["Flag"].ToString() != "")
                {
                    model.Flag = int.Parse(ds.Tables[0].Rows[0]["Flag"].ToString());
                }
                if (ds.Tables[0].Rows[0]["UserID"] != null && ds.Tables[0].Rows[0]["UserID"].ToString() != "")
                {
                    model.UserID = long.Parse(ds.Tables[0].Rows[0]["UserID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["AgentType"] != null && ds.Tables[0].Rows[0]["AgentType"].ToString() != "")
                {
                    model.AgentType = int.Parse(ds.Tables[0].Rows[0]["AgentType"].ToString());
                }
                if (ds.Tables[0].Rows[0]["AppliTime"] != null && ds.Tables[0].Rows[0]["AppliTime"].ToString() != "")
                {
                    model.AppliTime = DateTime.Parse(ds.Tables[0].Rows[0]["AppliTime"].ToString());
                }
                if (ds.Tables[0].Rows[0]["JoinMoney"] != null && ds.Tables[0].Rows[0]["JoinMoney"].ToString() != "")
                {
                    model.JoinMoney = decimal.Parse(ds.Tables[0].Rows[0]["JoinMoney"].ToString());
                }
                if (ds.Tables[0].Rows[0]["OpenTime"] != null && ds.Tables[0].Rows[0]["OpenTime"].ToString() != "")
                {
                    model.OpenTime = DateTime.Parse(ds.Tables[0].Rows[0]["OpenTime"].ToString());
                }
                if (ds.Tables[0].Rows[0]["PicLink"] != null && ds.Tables[0].Rows[0]["PicLink"].ToString() != "")
                {
                    model.PicLink = ds.Tables[0].Rows[0]["PicLink"].ToString();
                }
                if (ds.Tables[0].Rows[0]["AgentInProvince"] != null && ds.Tables[0].Rows[0]["AgentInProvince"].ToString() != "")
                {
                    model.AgentInProvince = ds.Tables[0].Rows[0]["AgentInProvince"].ToString();
                }
                if (ds.Tables[0].Rows[0]["AgentInCity"] != null && ds.Tables[0].Rows[0]["AgentInCity"].ToString() != "")
                {
                    model.AgentInCity = ds.Tables[0].Rows[0]["AgentInCity"].ToString();
                }
                if (ds.Tables[0].Rows[0]["AgentAddress"] != null && ds.Tables[0].Rows[0]["AgentAddress"].ToString() != "")
                {
                    model.AgentAddress = ds.Tables[0].Rows[0]["AgentAddress"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Agent001"] != null && ds.Tables[0].Rows[0]["Agent001"].ToString() != "")
                {
                    model.Agent001 = int.Parse(ds.Tables[0].Rows[0]["Agent001"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Agent002"] != null && ds.Tables[0].Rows[0]["Agent002"].ToString() != "")
                {
                    model.Agent002 = int.Parse(ds.Tables[0].Rows[0]["Agent002"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Agent003"] != null && ds.Tables[0].Rows[0]["Agent003"].ToString() != "")
                {
                    model.Agent003 = ds.Tables[0].Rows[0]["Agent003"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Agent004"] != null && ds.Tables[0].Rows[0]["Agent004"].ToString() != "")
                {
                    model.Agent004 = ds.Tables[0].Rows[0]["Agent004"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Agent005"] != null && ds.Tables[0].Rows[0]["Agent005"].ToString() != "")
                {
                    model.Agent005 = decimal.Parse(ds.Tables[0].Rows[0]["Agent005"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Agent006"] != null && ds.Tables[0].Rows[0]["Agent006"].ToString() != "")
                {
                    model.Agent006 = decimal.Parse(ds.Tables[0].Rows[0]["Agent006"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
Example #11
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(lgk.Model.tb_agent model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update tb_agent set ");
            strSql.Append("AgentCode=@AgentCode,");
            strSql.Append("Flag=@Flag,");
            strSql.Append("UserID=@UserID,");
            strSql.Append("AgentType=@AgentType,");
            strSql.Append("AppliTime=@AppliTime,");
            strSql.Append("JoinMoney=@JoinMoney,");
            strSql.Append("OpenTime=@OpenTime,");
            strSql.Append("PicLink=@PicLink,");
            strSql.Append("AgentInProvince=@AgentInProvince,");
            strSql.Append("AgentInCity=@AgentInCity,");
            strSql.Append("AgentAddress=@AgentAddress,");
            strSql.Append("Agent001=@Agent001,");
            strSql.Append("Agent002=@Agent002,");
            strSql.Append("Agent003=@Agent003,");
            strSql.Append("Agent004=@Agent004,");
            strSql.Append("Agent005=@Agent005,");
            strSql.Append("Agent006=@Agent006");
            strSql.Append(" where ID=@ID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@AgentCode",       SqlDbType.VarChar,   50),
                new SqlParameter("@Flag",            SqlDbType.Int,        4),
                new SqlParameter("@UserID",          SqlDbType.BigInt,     8),
                new SqlParameter("@AgentType",       SqlDbType.Int,        4),
                new SqlParameter("@AppliTime",       SqlDbType.DateTime),
                new SqlParameter("@JoinMoney",       SqlDbType.Decimal,    9),
                new SqlParameter("@OpenTime",        SqlDbType.DateTime),
                new SqlParameter("@PicLink",         SqlDbType.VarChar,   50),
                new SqlParameter("@AgentInProvince", SqlDbType.VarChar,   50),
                new SqlParameter("@AgentInCity",     SqlDbType.VarChar,   50),
                new SqlParameter("@AgentAddress",    SqlDbType.VarChar,   50),
                new SqlParameter("@Agent001",        SqlDbType.Int,        4),
                new SqlParameter("@Agent002",        SqlDbType.Int,        4),
                new SqlParameter("@Agent003",        SqlDbType.VarChar,   50),
                new SqlParameter("@Agent004",        SqlDbType.VarChar,   50),
                new SqlParameter("@Agent005",        SqlDbType.Decimal,    9),
                new SqlParameter("@Agent006",        SqlDbType.Decimal,    9),
                new SqlParameter("@ID",              SqlDbType.BigInt, 8)
            };
            parameters[0].Value  = model.AgentCode;
            parameters[1].Value  = model.Flag;
            parameters[2].Value  = model.UserID;
            parameters[3].Value  = model.AgentType;
            parameters[4].Value  = model.AppliTime;
            parameters[5].Value  = model.JoinMoney;
            parameters[6].Value  = model.OpenTime;
            parameters[7].Value  = model.PicLink;
            parameters[8].Value  = model.AgentInProvince;
            parameters[9].Value  = model.AgentInCity;
            parameters[10].Value = model.AgentAddress;
            parameters[11].Value = model.Agent001;
            parameters[12].Value = model.Agent002;
            parameters[13].Value = model.Agent003;
            parameters[14].Value = model.Agent004;
            parameters[15].Value = model.Agent005;
            parameters[16].Value = model.Agent006;
            parameters[17].Value = model.ID;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #12
0
        /// <summary>
        /// 注册验证
        /// </summary>
        /// <returns></returns>
        protected bool RegValidate()
        {
            lgk.Model.tb_user ModelRecommend = new lgk.Model.tb_user();
            //lgk.Model.tb_user ModelParent = new lgk.Model.tb_user();
            lgk.Model.tb_agent ModelAgent = new lgk.Model.tb_agent();

            #region 用户编号验证
            if (txtUserCode.Value == "")
            {
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('请输入会员编号');", true);//请输入会员编号
                return(false);
            }
            if (!PageValidate.checkUserCode(txtUserCode.Value.Trim()))
            {
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('会员编号必须由6-10位的英文字母或数字组成');", true);//会员编号必须由6-10位的英文字母或数字组成
                return(false);
            }

            if (GetUserID(txtUserCode.Value.Trim()) > 0)
            {
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('该会员编号已存在,请重新输入!');", true);//该会员编号已存在,请重新输入!
                return(false);
            }
            #endregion

            #region 密码验证
            if (txtPassword.Value.Trim() == "")
            {
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('登录密码不能为空!');", true);//登录密码不能为空
                return(false);
            }

            if (txtRegPassword.Value.Trim() == "")
            {
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('确认密码不能为空');", true);//确认密码不能为空
                return(false);
            }
            if (!txtPassword.Value.Trim().Equals(txtRegPassword.Value.Trim()))
            {
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('两次输入的登录密码不一致');", true);//两次输入的登录密码不一致
                return(false);
            }
            if (txtSecondPassword.Value.Trim() == "")
            {
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('二级密码不能为空');", true);//二级密码不能为空
                return(false);
            }

            if (txtRegSecondPassword.Value.Trim() == "")
            {
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('确认二级密码不能为空');", true);//确认二级密码不能为空
                return(false);
            }
            if (!txtSecondPassword.Value.Trim().Equals(txtRegSecondPassword.Value.Trim()))
            {
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('两次输入的二级密码不一致');", true);//两次输入的二级密码不一致
                return(false);
            }
            if (this.txtThreePassword.Value.Trim() == "")
            {
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('三级密码不能为空');", true);//三级密码不能为空
                return(false);
            }
            if (this.txtRegThreePassword.Value.Trim() == "")
            {
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('确认三级密码不能为空');", true);//确认三级密码不能为空
                return(false);
            }
            if (!txtThreePassword.Value.Trim().Equals(txtRegThreePassword.Value.Trim()))
            {
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('两次输入的三级密码不一致');", true);//两次输入的三级密码不一致
                return(false);
            }
            #endregion

            #region 报单中心验证
            //if (this.txtAgentCode.Value == "")
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("AgentNumber") + "');", true);//服务网点编号不能为空
            //    return false;
            //}
            //else
            //{
            //    string reName = this.txtAgentCode.Value.Trim();
            //    ModelAgent = agentBLL.GetModel(agentBLL.GetAgentsIDByUserCode(reName));//
            //    if (ModelAgent == null)//服务网点没有记录()
            //    {
            //        ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("AgentNumberExist") + "');", true);//服务网点编号不存在
            //        return false;
            //    }
            //    if (ModelAgent != null && ModelAgent.Flag == 0)
            //    {
            //        ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("AgentIsOpen") + "');", true);//该服务网点未开通,无法使用
            //        return false;
            //    }
            //    if (ModelAgent != null && ModelAgent.Flag == 2)
            //    {
            //        ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("AgentFrozen") + "');", true);//该服务网点已被冻结,无法使用
            //        return false;
            //    }
            //}
            #endregion

            #region 推荐人验证
            //if (txtRecommendCode.Value == "")
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("ReferenceNumberIsnull") + "');", true);//推荐人编号不能为空
            //    return false;
            //}
            //else
            //{
            //    string reName = this.txtRecommendCode.Value.Trim();
            //    ModelRecommend = userBLL.GetModel(GetUserID(reName));//推薦用户
            //    if (ModelRecommend == null)
            //    {
            //        ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("featuredNotExist") + "');", true);//该推荐会员不存在
            //        return false;
            //    }
            //    if (ModelRecommend.IsOpend == 0)
            //    {
            //        ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("MemberISNull") + "');", true);//该会员尚未开通,不能作为推荐会员
            //        return false;
            //    }
            //}
            #endregion

            #region 安置接点和区域验证
            //if (txtParentCode.Value == "")
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("PlacementIsnull") + "');", true);//安置会员编号不能为空
            //    return false;
            //}
            //else
            //{
            //    string parName = this.txtParentCode.Value.Trim();
            //    ModelParent = userBLL.GetModel(GetUserID(parName));//父节点用户
            //    if (ModelParent == null)
            //    {
            //        ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("PlacementIsexist") + "');", true);//该安置会员不存在
            //        return false;
            //    }
            //    else
            //    {
            //        if (ModelParent.IsOpend == 0)
            //        {
            //            ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("PlacementIsopen") + "');", true);//该安置会员未开通
            //            return false;
            //        }
            //    }
            //}
            //if (radMarketOne.Checked != true && radMarketTwo.Checked != true)
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("PleaseArea") + "');", true);//请选择注册区域
            //    return false;
            //}

            //int reNum = Convert.ToInt32(DbHelperSQL.GetSingle("select count(*) from tb_user where RecommendID=" + GetUserID(this.txtRecommendCode.Value.Trim())));
            //if (reNum == 0)
            //{
            //    if (radMarketTwo.Checked == true)
            //    {
            //        ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("RecommendFirst") + "');", true);//推荐会员推荐的第一人必须放在最左区
            //        return false;
            //    }
            //}

            //int location = 0;
            //if (radMarketOne.Checked == true) { location = 1; }
            //if (radMarketTwo.Checked == true) { location = 2; }
            //if (FlagLocation(GetUserID(this.txtParentCode.Value.Trim()), location, 0) > 0)
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("hasMember") + "');", true);//该区域已有会员
            //    return false;
            //}
            //if ((location == 2 && FlagLocation(GetUserID(this.txtParentCode.Value.Trim()), 1, 0) == 1))
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("leftIsnull") + "');", true);//该接点会员左区未有人,不能注册右区!
            //    return false;
            //}

            //if (ModelParent.IsOpend == 0 && location == 2)
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('该接点会员尚未开通,不能注册右区!');", true);
            //    return false;
            //}
            #endregion

            #region 银行信息验证
            if (this.txtBankAccount.Value != "")
            {
                int BankAccount = userBLL.GetCount("BankAccount='" + txtBankAccount.Value + "'");
                if (BankAccount > 0)
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('银行卡已被绑定,请重新选择银行卡');", true);//银行卡已被绑定,请重新选择银行卡
                    return(false);
                }
                if (!PageValidate.RegexTrueBank(this.txtBankAccount.Value))
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("BankCardErrors") + "');", true);//银行卡号输入错误
                    return(false);
                }
                if (this.dropBank.SelectedValue == "0")
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('请选择开户银行');", true);//请选择开户银行
                    return(false);
                }
                if (this.dropProvince.SelectedValue == "0")
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('请选择银行所在地');", true);//请选择银行所在地
                    return(false);
                }
                if (this.txtBankBranch.Value == "")
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('银行支行不能为空');", true);//银行支行不能为空
                    return(false);
                }
                if (this.txtBankAccountUser.Value == "")
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('开户名不能为空');", true);//开户名不能为空
                    return(false);
                }
            }

            if (!PageValidate.RegexTrueName(txtBankAccountUser.Value.Trim()))
            {
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('开户名必须为2-30个中英文');", true);//开户名必须为2-30个中英文
                return(false);
            }
            #endregion

            #region 基本信息验证
            string trueName = this.txtTrueName.Value.Trim();

            if (trueName != "")
            {
                if (!PageValidate.RegexTrueName(trueName))
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("AccountMust") + "');", true);//姓名必须为2-30个中英文
                    return(false);
                }
                if (txtBankAccountUser.Value != txtTrueName.Value)
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('会员姓名必须与开户名一致!');", true);//开户名与真实姓名必须一致!
                    return(false);
                }
            }

            string IdenCode = this.txtIdenCode.Value.Trim();
            //if (IdenCode == "")
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("CardIDIsNull") + "');", true);//身份证号不能为空
            //    return false;
            //}
            if (IdenCode != "")
            {
                if (!PageValidate.RegexIden(IdenCode))
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("CardIDMust") + "');", true);//身份证号格式错误
                    return(false);
                }
                int iIdenCode = userBLL.GetCount("IdenCode='" + IdenCode + "'");
                if (iIdenCode > 0)
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("IdenCodeReg") + "');", true);//身份证号已被注册
                    return(false);
                }
            }

            var phoneNum = this.txtPhoneNum.Value.Trim();
            if (string.IsNullOrEmpty(phoneNum))
            {
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('联系电话不能为空');", true);//联系电话不能为空
                return(false);
            }
            if (!PageValidate.RegexPhone(phoneNum))
            {
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('联系电话格式错误');", true);//联系电话格式错误
                return(false);
            }
            int iPhoneNum = userBLL.GetCount("PhoneNum='" + phoneNum + "'");
            if (iPhoneNum > 0)
            {
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('联系电话已被注册');", true);//联系电话已被注册
                return(false);
            }
            //if (this.txtAddress.Value == "")
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('联系地址不能为空');", true);//联系地址不能为空
            //    return false;
            //}

            string email = this.txtEmail.Value.Trim();
            if (email != "")
            {
                if (!PageValidate.IsEmail(email))
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('Email格式不正确!');", true);//E-Mail格式不正确
                    return(false);
                }
                int emailnum = userBLL.GetCount(" Email='" + email + "'");
                if (emailnum > 0)
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('此Email已被注册!');", true);//E-Mail已被注册
                    return(false);
                }
            }
            //var strQQnumer = this.txtQQnumer.Value.Trim();
            //if (string.IsNullOrEmpty(strQQnumer))
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("QQNumberEmpty") + "');", true);//QQ号码不能为空
            //    return false;
            //}
            //if (!PageValidate.IsNumber(strQQnumer))
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("QQNumberCorrect") + "');", true);//QQ号码格式不正确
            //    return false;
            //}

            //if (dropQuestion.SelectedValue.Trim() == "0")
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("PleaseSelectQuestion") + "');", true);//请选择密保问题
            //    return false;
            //}
            //if (string.IsNullOrEmpty(txtAnswer.Text))
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("PleaseAnswer") + "');", true);//请输入密保答案
            //    return false;
            //}
            #endregion

            return(true);
        }
Example #13
0
        public bool GoodsCartPay(long userid, int paytype, long addrid, string strcid, string aa, out string msg)
        {
            string[] arr = strcid.Split(',');
            LogHelper.SaveLog(strcid, "GoodsCartPay");

            if (arr.Length <= 0)
            {
                msg = "传递的ID无数据";
                return(false);
            }

            Random   rand       = new Random();
            string   orderCode  = DateTime.Now.ToString("yyyyMMddhhmmss") + rand.Next(10000, 99999); //订单编号
            string   goodsname  = string.Format("订单号{0},", orderCode);
            decimal  totalMoney = 0;
            int      orderSum   = 0;
            int      insert     = 0;
            DateTime dtime      = DateTime.Now;


            if (!userBLL.Exists(userid))
            {
                msg = "用户不存在";
                return(false);
            }

            if (paytype != 1)
            {
                msg = "支付类型错误";
                return(false);
            }

            lgk.Model.tb_Address addrModel = addressBLL.GetModel(addrid);
            if (addrModel == null)
            {
                msg = "请选择收货地址";
                return(false);
            }

            IList <lgk.Model.tb_goodsCar> listCar = new List <lgk.Model.tb_goodsCar>();

            #region 验证商品
            string errmsg = "";
            foreach (var strID in arr)
            {
                long id = 0;
                long.TryParse(strID, out id);
                lgk.Model.tb_goodsCar carModel = goodsCarBLL.GetModel(id);
                if (carModel != null)
                {
                    lgk.Model.tb_goods goodsModel = goodsBLL.GetModelAndOneName(carModel.GoodsID); //根据发布商品编号找到充值账号密码
                    if (goodsModel.StateType == 0)                                                 //判断是否 审核通过 0未审核
                    {
                        errmsg = "商品" + goodsModel.GoodsName + "审核未通过,请删除该商品!";
                        insert = 0;
                        break;
                    }
                    else if (goodsModel.Goods003 == "1") //判断是否 删除 1已经删除
                    {
                        errmsg = "商品" + goodsModel.GoodsName + "已被删除,请删除该商品!";
                        insert = 0;
                        break;
                    }
                    else if (goodsModel.Goods001 == 0) //判断是否 0下架
                    {
                        errmsg = "商品" + goodsModel.GoodsName + "已经下架,请删除该商品!";
                        insert = 0;
                        break;
                    }
                    else if (goodsModel.Goods002 < carModel.Goods006) //判断库存量
                    {
                        errmsg = "商品" + goodsModel.GoodsName + "库存不足,请重新修改数量!";
                        insert = 0;
                        break;
                    }
                    else if (carModel.BuyUser != userid) //判断库存量
                    {
                        errmsg = "用户不匹配,请刷新购物车再提交!";
                        insert = 0;
                        break;
                    }
                    listCar.Add(carModel);
                    insert += 1;
                }
                else
                {
                    msg = "购物出为空";
                    LogHelper.SaveLog(id.ToString() + "," + errmsg, "GoodsCartPay");
                    return(false);
                }
            }

            if (insert == 0)
            {
                msg = errmsg;
                return(false);
            }
            #endregion

            //总金额
            totalMoney += listCar.Sum(s => s.TotalMoney);
            lgk.Model.tb_user userModel = userBLL.GetModel(userid);
            //支付方式
            string[] aw = aa.Split('-');

            //if (!userBLL.Exists(long.Parse(aw[2])))
            //{
            //    msg = "运营中心不存在";
            //    return false;
            //}
            string sql = "select OrderID from tb_Order where UserID=" + userModel.UserID;
            var    mo  = userBLL.getData_Chaxun(sql, "").Tables[0];

            if (aw[0] == "1")
            {
                //if (mo.Rows.Count > 0)
                //{
                //    msg = "请选择复投产品";
                //    return false;
                //}
                if (aw[1] == "2")
                {
                    if (userModel.StockMoney < totalMoney / 2 || userModel.StockAccount < totalMoney / 2)
                    {
                        msg = "报单积分、电子积分余额不足";
                        return(false);
                    }
                }
                else
                {
                    if (userModel.StockAccount < totalMoney)
                    {
                        msg = "报单积分余额不足";
                        return(false);
                    }
                }
            }
            else if (aw[0] == "2")
            {
                if (userModel.AllBonusAccount < totalMoney)
                {
                    msg = "种子积分余额不足";
                    return(false);
                }
            }
            else if (aw[0] == "3")
            {
                if (userModel.StockMoney < totalMoney / 2 || userModel.StockAccount < totalMoney / 2)
                {
                    msg = "报单积分、电子积分余额不足";
                    return(false);
                }
            }
            else if (aw[0] == "4")
            {
                if (userModel.BonusAccount < totalMoney)
                {
                    msg = "消费积分余额不足";
                    return(false);
                }
            }

            #region 订单处理
            //总订单
            lgk.Model.tb_Order orderModel = new lgk.Model.tb_Order();        //订单
            orderModel.UserID     = userid;                                  //用户
            orderModel.OrderCode  = orderCode;                               //订单编号
            orderModel.OrderSum   = orderSum;                                //订单数--
            orderModel.OrderTotal = totalMoney;                              //购买总金
            orderModel.PVTotal    = totalMoney * getParamAmount("hongbao1"); //
            orderModel.OrderDate  = dtime;
            orderModel.IsSend     = 1;
            orderModel.PayMethod  = 1;                    //--
            orderModel.Order5     = "";                   //运营中心UserID
            orderModel.UserAddr   = addrModel.Address;    //发货地址
            orderModel.Order6     = addrModel.PhoneNum;   //收货电话
            orderModel.Order7     = addrModel.MemberName; //收货姓名
            orderModel.OrderType  = int.Parse(aw[0]);     //1:
            int fenrun = 0;
            foreach (var carModel in listCar)
            {
                lgk.Model.tb_goods       goodsModel       = goodsBLL.GetModelAndOneName(carModel.GoodsID); //根据发布商品编号找到充值账号密码
                lgk.Model.tb_goods       goodsModel1      = goodsBLL.GetModel(carModel.GoodsID);           //插入订单详细表
                lgk.Model.tb_OrderDetail orderDetailModel = new lgk.Model.tb_OrderDetail();
                orderDetailModel.OrderCode   = orderCode;
                orderDetailModel.Price       = carModel.RealityPrice;                     //单价--
                orderDetailModel.OrderSum    = carModel.Goods006;                         //数量--
                orderDetailModel.OrderTotal  = carModel.Goods006 * carModel.RealityPrice; //订单金额
                orderDetailModel.PV          = 0;                                         //
                orderDetailModel.PVTotal     = 0;
                orderDetailModel.ProcudeID   = carModel.GoodsID;                          //产品编号--
                orderDetailModel.ProcudeName = carModel.GoodsName;                        //名称--
                orderDetailModel.gColor      = carModel.gColor;
                orderDetailModel.gSize       = carModel.gSize;
                orderDetailModel.OrderDate   = dtime;                          //
                orderDetailBLL.Add(orderDetailModel);                          //加入订单详情

                fenrun += goodsModel1.IsHave * carModel.Goods006;              //计算分润单位
                //修改库存
                goodsModel.Goods002 = goodsModel.Goods002 - carModel.Goods006; //修改库存
                goodsModel.SaleNum += carModel.Goods006;
                goodsBLL.Update(goodsModel);

                //从购物篮减掉
                goodsCarBLL.Delete(carModel.ID);

                //商品名称 流水表记录用
                goodsname += orderDetailModel.ProcudeName + "|";

                orderSum += carModel.Goods006;
            }
            orderModel.BaodanOrder = fenrun;
            //if (aw[3]=="1")//自提
            //{

            //    orderModel.Order3 = "自提";
            //    orderModel.Order4 = "自提";
            //}
            #endregion
            //if (aw[1]=="2")//种子积分
            //{
            //    orderModel.Order3 = "种子积分购买无发货信息!";
            //    orderModel.Order4= "种子积分购买无发货信息!";
            //    orderModel.IsSend = 3;
            //    long iOrderID = orderBLL.Add(orderModel);//加入订单表
            //}
            //else
            //{
            long iOrderID = orderBLL.Add(orderModel);//加入订单表
            //}



            #region 写入到明细表
            if (aw[0] == "1")
            {
                if (aw[1] == "2")
                {
                    lgk.Model.tb_journal joModel = new lgk.Model.tb_journal();
                    joModel.UserID      = userModel.UserID;
                    joModel.Remark      = goodsname;                                   //名称--;
                    joModel.InAmount    = 0;                                           //收入0;
                    joModel.OutAmount   = totalMoney / 2;                              //购买价(支出金币)
                    joModel.JournalDate = DateTime.Now;
                    joModel.Journal01   = userModel.UserID;                            //
                    joModel.Journal02   = 99;                                          //消费
                    joModel.Journal03   = orderCode;                                   //订单编号
                    if (aw[0] == "2")                                                  //50%电子积分+50%消费积分
                    {
                        joModel.JournalType   = 2;                                     //币种
                        joModel.BalanceAmount = userModel.StockMoney - totalMoney / 2; //余额
                    }
                    journalBLL.Add(joModel);

                    ///---------------------------
                    joModel.UserID      = userModel.UserID;
                    joModel.Remark      = goodsname;                                     //名称--;
                    joModel.InAmount    = 0;                                             //收入0;
                    joModel.OutAmount   = totalMoney / 2;                                //购买价(支出金币)
                    joModel.JournalDate = DateTime.Now;
                    joModel.Journal01   = userModel.UserID;                              //
                    joModel.Journal02   = 99;                                            //消费
                    joModel.Journal03   = orderCode;                                     //订单编号
                    if (aw[0] == "2")                                                    //50%电子积分+50%消费积分
                    {
                        joModel.JournalType   = 5;                                       //币种
                        joModel.BalanceAmount = userModel.StockAccount - totalMoney / 2; //余额
                    }
                    journalBLL.Add(joModel);
                    UpdateAccount("StockMoney", userModel.UserID, totalMoney / 2, 0);
                    UpdateAccount("StockAccount", userModel.UserID, totalMoney / 2, 0);
                }
                else
                {
                    lgk.Model.tb_journal joModel = new lgk.Model.tb_journal();
                    joModel.UserID        = userModel.UserID;
                    joModel.Remark        = goodsname;                           //名称--;
                    joModel.InAmount      = 0;                                   //收入0;
                    joModel.OutAmount     = totalMoney;                          //购买价(支出金币)
                    joModel.JournalDate   = DateTime.Now;
                    joModel.Journal01     = userModel.UserID;                    //
                    joModel.Journal02     = 99;                                  //消费
                    joModel.Journal03     = orderCode;                           //订单编号
                    joModel.JournalType   = 5;                                   //币种
                    joModel.BalanceAmount = userModel.StockAccount - totalMoney; //余额
                    journalBLL.Add(joModel);
                    UpdateAccount("StockAccount", userModel.UserID, totalMoney, 0);
                }
            }
            else if (aw[0] == "2")
            {
                lgk.Model.tb_journal joModel = new lgk.Model.tb_journal();
                joModel.UserID        = userModel.UserID;
                joModel.Remark        = goodsname;                              //名称--;
                joModel.InAmount      = 0;                                      //收入0;
                joModel.OutAmount     = totalMoney;                             //购买价(支出金币)
                joModel.JournalDate   = DateTime.Now;
                joModel.Journal01     = userModel.UserID;                       //
                joModel.Journal02     = 99;                                     //消费
                joModel.Journal03     = orderCode;                              //订单编号
                joModel.JournalType   = 4;                                      //币种
                joModel.BalanceAmount = userModel.AllBonusAccount - totalMoney; //余额
                UpdateAccount("AllBonusAccount", userModel.UserID, totalMoney, 0);
                journalBLL.Add(joModel);
            }
            else if (aw[0] == "3")
            {
                lgk.Model.tb_journal joModel = new lgk.Model.tb_journal();
                joModel.UserID        = userModel.UserID;
                joModel.Remark        = goodsname;                             //名称--;
                joModel.InAmount      = 0;                                     //收入0;
                joModel.OutAmount     = totalMoney / 2;                        //购买价(支出金币)
                joModel.JournalDate   = DateTime.Now;
                joModel.Journal01     = userModel.UserID;                      //
                joModel.Journal02     = 99;                                    //消费
                joModel.Journal03     = orderCode;                             //订单编号
                joModel.JournalType   = 2;                                     //币种子电子积分
                joModel.BalanceAmount = userModel.StockMoney - totalMoney / 2; //余额
                journalBLL.Add(joModel);

                ///---------------------------报单积分扣钱
                joModel.UserID        = userModel.UserID;
                joModel.Remark        = goodsname;                               //名称--;
                joModel.InAmount      = 0;                                       //收入0;
                joModel.OutAmount     = totalMoney / 2;                          //购买价(支出金币)
                joModel.JournalDate   = DateTime.Now;
                joModel.Journal01     = userModel.UserID;                        //
                joModel.Journal02     = 99;                                      //消费
                joModel.Journal03     = orderCode;                               //订单编号
                joModel.JournalType   = 5;                                       //币种
                joModel.BalanceAmount = userModel.StockAccount - totalMoney / 2; //余额
                journalBLL.Add(joModel);
                UpdateAccount("StockMoney", userModel.UserID, totalMoney / 2, 0);
                UpdateAccount("StockAccount", userModel.UserID, totalMoney / 2, 0);
            }
            else if (aw[0] == "4")
            {
                lgk.Model.tb_journal joModel = new lgk.Model.tb_journal();
                joModel.UserID        = userModel.UserID;
                joModel.Remark        = goodsname;                           //名称--;
                joModel.InAmount      = 0;                                   //收入0;
                joModel.OutAmount     = totalMoney;                          //购买价(支出金币)
                joModel.JournalDate   = DateTime.Now;
                joModel.Journal01     = userModel.UserID;                    //
                joModel.Journal02     = 99;                                  //消费
                joModel.Journal03     = orderCode;                           //订单编号
                joModel.JournalType   = 3;                                   //币种
                joModel.BalanceAmount = userModel.BonusAccount - totalMoney; //余额
                UpdateAccount("BonusAccount", userModel.UserID, totalMoney, 0);
                journalBLL.Add(joModel);
            }
            else
            {
                msg = "支付失败,支付方式不正确!";
                return(false);
            }
            //---激活会员
            lgk.Model.tb_user user = userBLL.GetModel(orderModel.UserID);
            if (user.IsOpend != 2)
            {
                string   a  = Luodian(orderModel.UserID);
                string[] ID = a.Split('-');//ID[0]=UserID ID[1]=Location ID[2]=ParentID ID[3]=ParentCode  ID[4]=Layer
                var      l  = userBLL.GetModel(int.Parse(ID[2]));
                //user.RecommendPath = model_1.RecommendPath + "-" + user.UserID.ToString();

                user.ParentID   = 0;  //父节点ID
                user.ParentCode = ""; //父节点編號
                user.UserPath   = "";
                user.Layer      = 0;  //属于多少层
                user.Location   = 0;

                user.ParentID   = int.Parse(ID[2]); //父节点ID
                user.ParentCode = ID[3];            //父节点編號
                user.UserPath   = l.UserPath + "-" + user.UserID;
                user.Layer      = int.Parse(ID[4]); //属于多少层
                user.Location   = int.Parse(ID[1]);
                user.OpenTime   = DateTime.Now;
                user.IsOpend    = 2;
                userBLL.Update(user);
            }
            //开关报单
            MySQL(string.Format(" exec proc_Kaiguan " + orderModel.UserID + "," + orderModel.OrderCode + ""));

            //报单开关
            //---激活会员
            if (aw[0] != "4")
            {
                MySQL(string.Format(" exec proc_YejiUp " + orderModel.UserID + "," + orderModel.OrderTotal + ""));//加业绩
                MySQL(string.Format(" exec proc_Fenxiangjiang " + orderModel.UserID + "," + orderModel.OrderTotal + ""));
                MySQL(string.Format(" exec proc_Xiaocengjiang " + orderModel.UserID + ""));
                MySQL(string.Format(" exec proc_Xiaoliangjiang " + orderModel.UserID + ""));
                MySQL(string.Format(" exec proc_Jiandianjiang " + orderModel.UserID + "," + orderModel.OrderTotal + ",1"));

                //发奖
                #region 报单中心(20套)改为4万元
                if (orderModel.OrderTotal >= getParamInt("Fuwu2"))//报单中心(20套)
                {
                    int t = agentBLL.GetIDByIDUser(orderModel.UserID);
                    if (t == 0)//插入用户
                    {
                        var userModel1           = userBLL.GetModel(orderModel.UserID);
                        lgk.Model.tb_agent model = new lgk.Model.tb_agent();
                        model.UserID    = userModel1.UserID;
                        model.AgentCode = userModel1.UserCode;
                        model.Flag      = 1;
                        model.AgentType = 1;
                        model.Agent003  = userModel1.TrueName;
                        model.AppliTime = DateTime.Now;
                        model.JoinMoney = 0;
                        model.Agent004  = "";
                        model.Agent001  = 0;
                        model.Agent002  = 0;
                        model.PicLink   = "";
                        agentBLL.Add(model);

                        var model1 = userBLL.GetModel(userModel1.UserID);
                        model1.AgentsID = agentBLL.GetIDByIDUser(userModel1.UserID);
                        model1.IsAgent  = 1;
                        userBLL.Update(model1);

                        lgk.Model.tb_journal journalInfo = new lgk.Model.tb_journal();
                        journalInfo.UserID        = userModel1.UserID;
                        journalInfo.Remark        = "一次性购买 " + getParamInt("Fuwu2") + "元的产品,成为服务网点";
                        journalInfo.RemarkEn      = "Cash withdrawal";
                        journalInfo.InAmount      = 0;
                        journalInfo.OutAmount     = 0;
                        journalInfo.BalanceAmount = userBLL.GetMoney(userModel1.UserID, "StockMoney");
                        journalInfo.JournalDate   = DateTime.Now;
                        journalInfo.JournalType   = 2;
                        journalInfo.Journal01     = userModel1.UserID;
                        journalBLL.Add(journalInfo);
                    }
                }
                userid     = orderModel.UserID;
                totalMoney = orderModel.OrderTotal;
                #endregion
                if (getParamInt("Fuwu") == 1)
                {
                    //报单中心奖

                    long    BD_UserID = userBLL.GetUserID(userBLL.GetModel(orderModel.UserID).User006);
                    decimal BD        = getParamAmount("Fuwu1") / 100 * totalMoney;

                    int isLock = userBLL.GetModel(BD_UserID).IsLock;
                    int Ag     = userBLL.GetModel(BD_UserID).IsAgent;
                    if (isLock == 0 && Ag == 1)
                    {
                        decimal shouxufei = BD * getParamAmount("PingTai") / 100;
                        BD -= shouxufei;
                        decimal Gongyi = BD * getParamAmount("PingTai1") / 100;
                        BD -= Gongyi;

                        decimal jiangjin = getParamAmount("JJ");
                        decimal zhongzi  = getParamAmount("ZZ");
                        decimal xiaofei  = getParamAmount("XF");
                        decimal JJ       = BD * jiangjin / 100;
                        decimal ZZ       = BD * zhongzi / 100;
                        decimal XF       = BD * xiaofei / 100;
                        UpdateAccount("Emoney", BD_UserID, JJ, 1);             //奖金
                        UpdateAccount("StockMoney", BD_UserID, ZZ, 1);         //电子

                        UpdateAccount("ShopAccount", BD_UserID, shouxufei, 1); //奖金
                        UpdateAccount("GLmoney", BD_UserID, Gongyi, 1);        //电子
                        if (XF > 0)
                        {
                            UpdateAccount("BonusAccount", BD_UserID, XF, 1);//消费
                            lgk.Model.tb_journal journal1 = new lgk.Model.tb_journal();
                            journal1.UserID        = BD_UserID;
                            journal1.Remark        = "服务网点获得" + (BD + shouxufei + Gongyi) + ",其中扣除平台手续费" + shouxufei + ",扣除公益基金" + Gongyi + " ,剩余" + xiaofei + "%进入消费积分";
                            journal1.RemarkEn      = "";
                            journal1.InAmount      = XF;
                            journal1.OutAmount     = 0;
                            journal1.BalanceAmount = userBLL.GetMoney(BD_UserID, "BonusAccount");;
                            journal1.JournalDate   = DateTime.Now;
                            journal1.JournalType   = 3;
                            journal1.Journal01     = 0;
                            journalBLL.Add(journal1);
                        }

                        lgk.Model.tb_journal journal = new lgk.Model.tb_journal();
                        journal.UserID        = BD_UserID;
                        journal.Remark        = "服务网点获得" + (BD + shouxufei + Gongyi) + ",其中扣除平台手续费" + shouxufei + ",扣除公益基金" + Gongyi + " ,剩余" + jiangjin + "%进入奖金积分";
                        journal.RemarkEn      = "";
                        journal.InAmount      = JJ;
                        journal.OutAmount     = 0;
                        journal.BalanceAmount = userBLL.GetMoney(BD_UserID, "Emoney");;
                        journal.JournalDate   = DateTime.Now;
                        journal.JournalType   = 1;
                        journal.Journal01     = 0;
                        journalBLL.Add(journal);

                        journal.UserID        = BD_UserID;
                        journal.Remark        = "服务网点获得" + (BD + shouxufei + Gongyi) + ",其中扣除平台手续费" + shouxufei + ",扣除公益基金" + Gongyi + " ,剩余" + zhongzi + "%进入电子积分";
                        journal.RemarkEn      = "";
                        journal.InAmount      = ZZ;
                        journal.OutAmount     = 0;
                        journal.BalanceAmount = userBLL.GetMoney(BD_UserID, "StockMoney");;
                        journal.JournalDate   = DateTime.Now;
                        journal.JournalType   = 2;
                        journal.Journal01     = 0;
                        journalBLL.Add(journal);

                        journal.UserID        = BD_UserID;
                        journal.Remark        = "服务网点获得" + (BD + shouxufei + Gongyi) + ",其中扣除平台手续费" + shouxufei + "";
                        journal.RemarkEn      = "";
                        journal.InAmount      = shouxufei;
                        journal.OutAmount     = 0;
                        journal.BalanceAmount = userBLL.GetMoney(BD_UserID, "ShopAccount");;
                        journal.JournalDate   = DateTime.Now;
                        journal.JournalType   = 6;
                        journal.Journal01     = 0;
                        journalBLL.Add(journal);

                        journal.UserID        = BD_UserID;
                        journal.Remark        = "服务网点获得" + (BD + shouxufei + Gongyi) + ",其中扣除公益基金" + Gongyi + "";
                        journal.RemarkEn      = "";
                        journal.InAmount      = Gongyi;
                        journal.OutAmount     = 0;
                        journal.BalanceAmount = userBLL.GetMoney(BD_UserID, "GLmoney");;
                        journal.JournalDate   = DateTime.Now;
                        journal.JournalType   = 7;
                        journal.Journal01     = 0;
                        journalBLL.Add(journal);


                        SqlConnection conn = new SqlConnection(sconn);
                        conn.Open();
                        string sql_Add = "insert into tb_bonus(UserID,TypeID,Amount,Revenue,sf,AddTime,IsSettled,Source,SourceEn,SttleTime,FromUserID,Bonus005,Bonus006)";
                        sql_Add += "values (" + BD_UserID + ",5," + (BD + shouxufei + Gongyi) + "," + shouxufei + "," + BD + ",getdate(),1,'" + journal.Remark + "','',getdate()," + userid + "," + jiangjin + "," + zhongzi + ");";
                        SqlCommand cmd   = new SqlCommand(sql_Add, conn);
                        int        reInt = cmd.ExecuteNonQuery();
                        conn.Close();
                    }
                }
            }
            else
            {
                MySQL(string.Format(" exec proc_Jiandianjiang " + orderModel.UserID + "," + orderModel.OrderTotal + ",2"));
            }
            msg = "支付成功";
            return(true);
        }
Example #14
0
        /// <summary>
        /// 输入验证
        /// </summary>
        /// <returns></returns>
        protected bool RegValidate()
        {
            lgk.Model.tb_user recommendInfo = new lgk.Model.tb_user();
            //lgk.Model.tb_user parentInfo = new lgk.Model.tb_user();
            //lgk.Model.tb_agent agentInfo = new lgk.Model.tb_agent();

            #region 会员编号验证
            if (txtUserCode.Value.Trim() == "")
            {
                MessageBox.ShowBox(this.Page, GetLanguage("PleaseNumber"), Library.Enums.ModalTypes.warning);//请输入会员编号

                return(false);
            }
            if (!PageValidate.checkUserCode(txtUserCode.Value.Trim()))
            {
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("MemberNumber") + "');", true);//会员编号必须由6-10位的英文字母或数字组成
                return(false);
            }

            if (GetUserID(txtUserCode.Value.Trim()) > 0)
            {
                MessageBox.ShowBox(this.Page, GetLanguage("Memberexists"), Library.Enums.ModalTypes.info);//该会员编号已存在,请重新输入!
                return(false);
            }
            #endregion

            #region 密码验证
            if (txtPassword.Value.Trim() == "")
            {
                MessageBox.ShowBox(this.Page, GetLanguage("PasswordISNull"), Library.Enums.ModalTypes.warning);//登录密码不能为空
                return(false);
            }
            //if (txtPassword.Value.Trim().Length < 6)
            //{
            //    MessageBox.ShowBox(this.Page, GetLanguage("PasswordLength"), Library.Enums.ModalTypes.warning);//密码长度不能小于6位
            //    return false;
            //}
            if (txtRegPassword.Value.Trim() == "")
            {
                MessageBox.ShowBox(this.Page, GetLanguage("ConfirmPasswordISNull"), Library.Enums.ModalTypes.warning);//确认密码不能为空
                return(false);
            }
            if (!txtPassword.Value.Trim().Equals(txtRegPassword.Value.Trim()))
            {
                MessageBox.ShowBox(this.Page, GetLanguage("TwoPasswordMatch"), Library.Enums.ModalTypes.warning);//两次输入的登录密码不一致
                return(false);
            }
            if (txtSecondPassword.Value.Trim() == "")
            {
                MessageBox.ShowBox(this.Page, GetLanguage("SecondaryISNUll"), Library.Enums.ModalTypes.warning);//二级密码不能为空
                return(false);
            }

            if (txtRegSecondPassword.Value.Trim() == "")
            {
                MessageBox.ShowBox(this.Page, GetLanguage("secondaryPasswordISNull"), Library.Enums.ModalTypes.warning);//确认二级密码不能为空
                return(false);
            }
            if (!txtSecondPassword.Value.Trim().Equals(txtRegSecondPassword.Value.Trim()))
            {
                MessageBox.ShowBox(this.Page, GetLanguage("TwoSecondaryMatch"), Library.Enums.ModalTypes.warning);//两次输入的二级密码不一致
                return(false);
            }
            #endregion

            #region 银行验证
            //string strBankAccount = this.txtBankAccount.Value.Trim();

            //if (txtAlipay.Value.Trim() == "" && string.IsNullOrEmpty(strBankAccount))
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("AlipayAccount") + "');", true);//支付宝账号不能为空
            //    return false;
            //}


            //if (!string.IsNullOrEmpty(strBankAccount) && !PageValidate.RegexTrueBank(this.txtBankAccount.Value) && string.IsNullOrEmpty(txtAlipay.Value.Trim()))
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("BankCardErrors") + "');", true);//银行卡号输入错误
            //    return false;
            //}

            //string strBankAccountUser = this.txtBankAccountUser.Value.Trim();


            //if (!string.IsNullOrEmpty(strBankAccountUser) && !PageValidate.RegexTrueName(txtBankAccountUser.Value.Trim()) && string.IsNullOrEmpty(txtAlipay.Value.Trim()))
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("NameMust") + "');", true);//开户名必须为2-30个中英文
            //    return false;
            //}
            #endregion

            #region  务中心
            string strAgentCode = this.txtAgentCode.Value.Trim();
            if (string.IsNullOrEmpty(strAgentCode))
            {
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("AgentNumber") + "');", true);//服务中心编号不能为空
                return(false);
            }
            else
            {
                lgk.Model.tb_agent ModelAgent = agentBLL.GetModel(agentBLL.GetAgentsIDByUserCode(strAgentCode));                                     //
                if (ModelAgent == null)                                                                                                              //服务中心没有记录()
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("AgentNumberExist") + "');", true); //服务中心编号不存在
                    return(false);
                }
                if (ModelAgent != null && ModelAgent.Flag == 0)
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("AgentIsOpen") + "');", true);//该服务中心未开通,无法使用
                    return(false);
                }
                if (ModelAgent != null && ModelAgent.Flag == 2)
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("AgentFrozen") + "');", true);//该服务中心已被冻结,无法使用
                    return(false);
                }
            }
            #endregion

            #region 推荐人验证
            string reName = this.txtRecommendCode.Value.Trim();
            if (string.IsNullOrEmpty(reName))
            {
                MessageBox.ShowBox(this.Page, GetLanguage("ReferenceNumberIsnull"), Library.Enums.ModalTypes.warning);//推荐人编号不能为空
                return(false);
            }
            else
            {
                recommendInfo = userBLL.GetModel(GetUserID(reName));//推薦用户
                if (recommendInfo == null)
                {
                    MessageBox.ShowBox(this.Page, GetLanguage("featuredNotExist"), Library.Enums.ModalTypes.warning);//该推荐会员不存在
                    return(false);
                }
                if (recommendInfo.IsOpend == 0)
                {
                    MessageBox.ShowBox(this.Page, GetLanguage("MemberISNull"), Library.Enums.ModalTypes.warning);//该会员尚未开通,不能作为推荐会员
                    return(false);
                }
            }
            #endregion

            //if (radioRegQy.SelectedValue == "")
            //{
            //    MessageBox.ShowBox(this.Page, "请选择注册区域", Library.Enums.ModalTypes.warning);
            //    return false;
            //}

            #region 银行信息
            if (dropBank.SelectedValue == "0")
            {
                MessageBox.ShowBox(this.Page, "请选择开户银行", Library.Enums.ModalTypes.warning);
                return(false);
            }

            string strBankBranch = txtBankBranch.Value.Trim();
            if (string.IsNullOrEmpty(strBankBranch))
            {
                MessageBox.ShowBox(this.Page, "请输入银行支行", Library.Enums.ModalTypes.warning);
                return(false);
            }

            string strBankAccount = txtBankAccount.Value.Trim();
            if (string.IsNullOrEmpty(strBankAccount))
            {
                MessageBox.ShowBox(this.Page, "请输入银行账户", Library.Enums.ModalTypes.warning);
                return(false);
            }

            string strBankAccountUser = txtBankAccountUser.Value.Trim();
            if (string.IsNullOrEmpty(strBankAccountUser))
            {
                MessageBox.ShowBox(this.Page, "请输入开户姓名", Library.Enums.ModalTypes.warning);
                return(false);
            }
            #endregion

            #region 手机号码验证
            var strPhoneNum = this.txtPhoneNum.Value.Trim();

            if (!string.IsNullOrEmpty(strPhoneNum) && !PageValidate.RegexPhone(strPhoneNum))
            {
                MessageBox.ShowBox(this.Page, GetLanguage("PhoneMust"), Library.Enums.ModalTypes.error);//联系电话格式错误
                return(false);
            }

            //int userid = GetUserIDbByPhone(strPhoneNum);
            //if (userid > 0)
            //{
            //    MessageBox.ShowBox(this.Page, GetLanguage("PhoneRegExists"), Library.Enums.ModalTypes.info);//该手机号码已注册
            //    return false;
            //}

            int ct = GetPhoneNumber(strPhoneNum);
            if (ct >= 1)
            {
                MessageBox.ShowBox(this.Page, string.Format(GetLanguage("RegisterPhoneNumber")), Library.Enums.ModalTypes.warning);//该手机号码已注册
                return(false);
            }
            #endregion

            #region 身份证验证
            string strIdCode = txtIDNumber.Value.Trim();
            if (string.IsNullOrEmpty(strIdCode))
            {
                MessageBox.ShowBox(this.Page, string.Format("请输入身份证号码"), Library.Enums.ModalTypes.warning);//该身份证号注册
                return(false);
            }
            ct = GetIDCodeNumber(strIdCode);

            if (ct >= 1)
            {
                MessageBox.ShowBox(this.Page, string.Format(GetLanguage("RegisterIDCodeNumber")), Library.Enums.ModalTypes.warning);//该身份证号注册
                return(false);
            }

            #endregion

            string strAddress = txtAddress.Value.Trim();
            if (string.IsNullOrEmpty(strAddress))
            {
                MessageBox.ShowBox(this.Page, GetLanguage("AddressEmpty"), Library.Enums.ModalTypes.error);//收货地址不能为空
                return(false);
            }

            #region 密保问题验证
            //if (dropQuestion.SelectedValue.Trim() == "0")
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("PleaseSelectQuestion") + "');", true);//请选择密保问题
            //    return false;
            //}
            //if (string.IsNullOrEmpty(txtAnswer.Text))
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("PleaseAnswer") + "');", true);//请输入密保答案
            //    return false;
            //}
            #endregion

            #region 商务中心
            //int iAgentOpend = getParamInt("AgentSwith");//商务中心是否开启
            //if (!string.IsNullOrEmpty(txtAgent.Value.Trim()))
            //{
            //    if (iAgentOpend == 1)
            //    {

            //        bool isagent = agentBLL.isExistByName(txtAgent.Value.Trim());
            //        if (!isagent)
            //        {
            //            MessageBox.ShowBox(this.Page, GetLanguage("AgentNumberExist"), Library.Enums.ModalTypes.warning);//商务中心编号不存在
            //            return false;
            //        }
            //    }
            //}

            //decimal regopen = getParamAmount("RegOpen");
            //if(LoginUser.Emoney < regopen)
            //{
            //    MessageBox.ShowBox(this.Page, GetLanguage("RegOpenMust"), Library.Enums.ModalTypes.warning);//注册积分不足
            //    return false;
            //}
            #endregion

            return(true);
        }
Example #15
0
        /// <summary>
        /// 输入验证
        /// </summary>
        /// <returns></returns>
        protected bool RegValidate()
        {
            lgk.Model.tb_user  recommendInfo = new lgk.Model.tb_user();
            lgk.Model.tb_user  parentInfo    = new lgk.Model.tb_user();
            lgk.Model.tb_agent agentInfo     = new lgk.Model.tb_agent();

            if (txtUserCode.Value.Trim() == "")
            {
                MessageBox.ShowBox(this.Page, GetLanguage("PleaseNumber"), Library.Enums.ModalTypes.warning);//请输入会员编号

                return(false);
            }
            //if (!PageValidate.checkUserCode(txtUserCode.Value.Trim()))
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("MemberNumber") + "');", true);//会员编号必须由6-10位的英文字母或数字组成
            //    return false;
            //}

            if (GetUserID(txtUserCode.Value.Trim()) > 0)
            {
                MessageBox.ShowBox(this.Page, GetLanguage("Memberexists"), Library.Enums.ModalTypes.warning);//该会员编号已存在,请重新输入!

                return(false);
            }
            if (txtPassword.Value.Trim() == "")
            {
                MessageBox.ShowBox(this.Page, GetLanguage("PasswordISNull"), Library.Enums.ModalTypes.warning);//登录密码不能为空

                return(false);
            }

            if (txtRegPassword.Value.Trim() == "")
            {
                MessageBox.ShowBox(this.Page, GetLanguage("ConfirmPasswordISNull"), Library.Enums.ModalTypes.warning);//确认密码不能为空

                return(false);
            }
            if (!txtPassword.Value.Trim().Equals(txtRegPassword.Value.Trim()))
            {
                MessageBox.ShowBox(this.Page, GetLanguage("TwoPasswordMatch"), Library.Enums.ModalTypes.warning);//两次输入的登录密码不一致

                return(false);
            }
            if (txtSecondPassword.Value.Trim() == "")
            {
                MessageBox.ShowBox(this.Page, GetLanguage("SecondaryISNUll"), Library.Enums.ModalTypes.warning);//二级密码不能为空

                return(false);
            }

            if (txtRegSecondPassword.Value.Trim() == "")
            {
                MessageBox.ShowBox(this.Page, GetLanguage("secondaryPasswordISNull"), Library.Enums.ModalTypes.warning);//确认二级密码不能为空

                return(false);
            }
            if (!txtSecondPassword.Value.Trim().Equals(txtRegSecondPassword.Value.Trim()))
            {
                MessageBox.ShowBox(this.Page, GetLanguage("TwoSecondaryMatch"), Library.Enums.ModalTypes.warning);//两次输入的二级密码不一致

                return(false);
            }

            //string strBankAccount = this.txtBankAccount.Value.Trim();

            //if (txtAlipay.Value.Trim() == "" && string.IsNullOrEmpty(strBankAccount) )
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("AlipayAccount") + "');", true);//支付宝账号不能为空
            //    return false;
            //}


            //if (!string.IsNullOrEmpty(strBankAccount) && !PageValidate.RegexTrueBank(this.txtBankAccount.Value) && string.IsNullOrEmpty(txtAlipay.Value.Trim()))
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("BankCardErrors") + "');", true);//银行卡号输入错误
            //    return false;
            //}

            //string strBankAccountUser = this.txtBankAccountUser.Value.Trim();


            //if (!string.IsNullOrEmpty(strBankAccountUser) && !PageValidate.RegexTrueName(txtBankAccountUser.Value.Trim()) && string.IsNullOrEmpty(txtAlipay.Value.Trim()))
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("NameMust") + "');", true);//开户名必须为2-30个中英文
            //    return false;
            //}

            var strPhoneNum = this.txtPhoneNum.Value.Trim();

            if (!string.IsNullOrEmpty(strPhoneNum) && !PageValidate.RegexPhone(strPhoneNum))
            {
                MessageBox.ShowBox(this.Page, GetLanguage("PhoneMust"), Library.Enums.ModalTypes.error);//联系电话格式错误

                return(false);
            }

            //if (dropQuestion.SelectedValue.Trim() == "0")
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("PleaseSelectQuestion") + "');", true);//请选择密保问题
            //    return false;
            //}
            //if (string.IsNullOrEmpty(txtAnswer.Text))
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("PleaseAnswer") + "');", true);//请输入密保答案
            //    return false;
            //}
            return(true);
        }
Example #16
0
        protected void rpOrderList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            long iID = Convert.ToInt64(e.CommandArgument);

            lgk.Model.tb_Order orderModel = orderBLL.GetModel(iID);
            if (e.CommandName.Equals("cancel"))
            {
                if (orderModel != null)
                {
                    if (orderModel.IsDel == 0)
                    {
                        orderModel.IsDel = 1;
                        if (orderBLL.Update(orderModel))
                        {
                            ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('订单取消成功!');", true);
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('订单取消失败!');", true);
                            return;
                        }
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('此订单已取消!');", true);
                        return;
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('此订单记录不存在!');", true);
                    return;
                }
            }
            else if (e.CommandName.Equals("sure"))
            {
                if (orderModel != null)
                {
                    if (orderModel.IsSend == 3)
                    {
                        ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('此订单已收货!');", true);
                        return;
                    }
                    else if (orderModel.IsSend == 1)
                    {
                        ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('此订单未发货!');", true);
                        return;
                    }
                    else
                    {
                        orderModel.IsSend = 3;

                        if (orderBLL.Update(orderModel))
                        {
                            //发奖
                            #region 报单中心(20套)改为4万元
                            if (orderModel.OrderTotal >= getParamInt("Fuwu2"))//报单中心(20套)
                            {
                                int a = agentBLL.GetIDByIDUser(orderModel.UserID);
                                if (a == 0)//插入用户
                                {
                                    var userModel            = userBLL.GetModel(orderModel.UserID);
                                    lgk.Model.tb_agent model = new lgk.Model.tb_agent();
                                    model.UserID    = userModel.UserID;
                                    model.AgentCode = userModel.UserCode;
                                    model.Flag      = 1;
                                    model.AgentType = 1;
                                    model.Agent003  = userModel.TrueName;
                                    model.AppliTime = DateTime.Now;
                                    model.JoinMoney = 0;
                                    model.Agent004  = "";
                                    model.Agent001  = 0;
                                    model.Agent002  = 0;
                                    model.PicLink   = "";
                                    agentBLL.Add(model);

                                    var model1 = userBLL.GetModel(userModel.UserID);
                                    model1.AgentsID = agentBLL.GetIDByIDUser(userModel.UserID);
                                    model1.IsAgent  = 1;
                                    userBLL.Update(model1);

                                    lgk.Model.tb_journal journalInfo = new lgk.Model.tb_journal();
                                    journalInfo.UserID        = userModel.UserID;
                                    journalInfo.Remark        = "一次性购买 " + getParamInt("Fuwu2") + "元的产品,成为服务网点";
                                    journalInfo.RemarkEn      = "Cash withdrawal";
                                    journalInfo.InAmount      = 0;
                                    journalInfo.OutAmount     = 0;
                                    journalInfo.BalanceAmount = userBLL.GetMoney(userModel.UserID, "StockMoney");
                                    journalInfo.JournalDate   = DateTime.Now;
                                    journalInfo.JournalType   = 2;
                                    journalInfo.Journal01     = userModel.UserID;
                                    journalBLL.Add(journalInfo);
                                }
                            }
                            long    userid     = orderModel.UserID;
                            decimal totalMoney = orderModel.OrderTotal;
                            #endregion
                            if (getParamInt("Fuwu") == 1)
                            {
                                //报单中心奖

                                long    BD_UserID = userBLL.GetUserID(userBLL.GetModel(orderModel.UserID).User006);
                                decimal BD        = getParamAmount("Fuwu1") / 100 * totalMoney;

                                int isLock = userBLL.GetModel(BD_UserID).IsLock;
                                int Ag     = userBLL.GetModel(BD_UserID).IsAgent;
                                if (isLock == 0 && Ag == 1)
                                {
                                    decimal shouxufei = BD * getParamAmount("PingTai") / 100;
                                    BD -= shouxufei;
                                    decimal jiangjin = getParamAmount("JJ");
                                    decimal zhongzi  = getParamAmount("ZZ");
                                    decimal xiaofei  = getParamAmount("XF");
                                    decimal JJ       = BD * jiangjin / 100;
                                    decimal ZZ       = BD * zhongzi / 100;
                                    decimal XF       = BD * xiaofei / 100;
                                    UpdateAccount("Emoney", BD_UserID, JJ, 1);          //奖金
                                    UpdateAccount("AllBonusAccount", BD_UserID, ZZ, 1); //种子
                                    if (XF > 0)
                                    {
                                        UpdateAccount("AllBonusAccount", BD_UserID, XF, 1);//种子
                                        lgk.Model.tb_journal journal1 = new lgk.Model.tb_journal();
                                        journal1.UserID        = BD_UserID;
                                        journal1.Remark        = "服务网点获得" + (BD + shouxufei) + ",其中扣除平台手续费" + shouxufei + ",剩余" + xiaofei + "%进入消费积分";
                                        journal1.RemarkEn      = "";
                                        journal1.InAmount      = XF;
                                        journal1.OutAmount     = 0;
                                        journal1.BalanceAmount = userBLL.GetMoney(BD_UserID, "BonusAccount");;
                                        journal1.JournalDate   = DateTime.Now;
                                        journal1.JournalType   = 3;
                                        journal1.Journal01     = 0;
                                        journalBLL.Add(journal1);
                                    }

                                    lgk.Model.tb_journal journal = new lgk.Model.tb_journal();
                                    journal.UserID        = BD_UserID;
                                    journal.Remark        = "服务网点获得" + (BD + shouxufei) + ",其中扣除平台手续费" + shouxufei + ",剩余" + jiangjin + "%进入奖金积分";
                                    journal.RemarkEn      = "";
                                    journal.InAmount      = JJ;
                                    journal.OutAmount     = 0;
                                    journal.BalanceAmount = userBLL.GetMoney(BD_UserID, "Emoney");;
                                    journal.JournalDate   = DateTime.Now;
                                    journal.JournalType   = 1;
                                    journal.Journal01     = 0;
                                    journalBLL.Add(journal);

                                    journal.UserID        = BD_UserID;
                                    journal.Remark        = "服务网点获得" + (BD + shouxufei) + ",其中扣除平台手续费" + shouxufei + ",剩余" + zhongzi + "%进入电子积分";
                                    journal.RemarkEn      = "";
                                    journal.InAmount      = ZZ;
                                    journal.OutAmount     = 0;
                                    journal.BalanceAmount = userBLL.GetMoney(BD_UserID, "StockMoney");;
                                    journal.JournalDate   = DateTime.Now;
                                    journal.JournalType   = 2;
                                    journal.Journal01     = 0;
                                    journalBLL.Add(journal);

                                    SqlConnection conn = new SqlConnection(sconn);
                                    conn.Open();
                                    string sql_Add = "insert into tb_bonus(UserID,TypeID,Amount,Revenue,sf,AddTime,IsSettled,Source,SourceEn,SttleTime,FromUserID,Bonus005,Bonus006)";
                                    sql_Add += "values (" + BD_UserID + ",6," + (BD + shouxufei) + "," + shouxufei + "," + BD + ",getdate(),1,'" + journal.Remark + "','',getdate()," + userid + "," + jiangjin + "," + zhongzi + ");";
                                    SqlCommand cmd   = new SqlCommand(sql_Add, conn);
                                    int        reInt = cmd.ExecuteNonQuery();
                                    conn.Close();
                                }
                            }
                            ////还有运营中心 Yunying1
                            //if (getParamInt("Yunying") == 1)
                            //{
                            //        long YY_UserID = long.Parse(orderModel.Order5);
                            //    int isLock = userBLL.GetModel(YY_UserID).IsLock;
                            //    int Ag= agent1BLL.GetIDByIDUser(agent1BLL.GetIDByIDUser(YY_UserID));
                            //    if (isLock==0&&Ag==1)
                            //    {


                            //        decimal YY = getParamAmount("Yunying1") / 100 * totalMoney;

                            //        decimal shouxufei = YY * getParamAmount("PingTai") / 100;
                            //        YY -= shouxufei;
                            //        decimal jiangjin = getParamAmount("JJ");
                            //        decimal zhongzi = getParamAmount("ZZ");
                            //        decimal JJ = YY * jiangjin / 100;
                            //        decimal ZZ = YY * zhongzi / 100;
                            //        UpdateAccount("Emoney", YY_UserID, JJ, 1);//奖金
                            //        UpdateAccount("AllBonusAccount", YY_UserID, ZZ, 1);//种子

                            //        lgk.Model.tb_journal journal = new lgk.Model.tb_journal();
                            //        journal.UserID = YY_UserID;
                            //        journal.Remark = "运营中心奖获得" + (YY + shouxufei) + ",其中扣除平台手续费" + shouxufei + ",剩余" + jiangjin + "%进入奖金积分";
                            //        journal.RemarkEn = "";
                            //        journal.InAmount = JJ;
                            //        journal.OutAmount = 0;
                            //        journal.BalanceAmount = userBLL.GetMoney(YY_UserID, "Emoney"); ;
                            //        journal.JournalDate = DateTime.Now;
                            //        journal.JournalType = 1;
                            //        journal.Journal01 = 0;
                            //        journalBLL.Add(journal);

                            //        journal.UserID = YY_UserID;
                            //        journal.Remark = "运营中心奖获得" + (YY + shouxufei) + ",其中扣除平台手续费" + shouxufei + ",剩余" + zhongzi + "%进入种子积分";
                            //        journal.RemarkEn = "";
                            //        journal.InAmount = ZZ;
                            //        journal.OutAmount = 0;
                            //        journal.BalanceAmount = userBLL.GetMoney(YY_UserID, "AllBonusAccount"); ;
                            //        journal.JournalDate = DateTime.Now;
                            //        journal.JournalType = 4;
                            //        journal.Journal01 = 0;
                            //        journalBLL.Add(journal);

                            //        SqlConnection conn = new SqlConnection(sconn);
                            //        conn.Open();
                            //        string sql_Add1 = "insert into tb_bonus(UserID,TypeID,Amount,Revenue,sf,AddTime,IsSettled,Source,SourceEn,SttleTime,FromUserID,Bonus005,Bonus006)";
                            //        sql_Add1 += "values (" + YY_UserID + ",5," + (YY + shouxufei) + "," + shouxufei + "," + YY + ",getdate(),1,'" + journal.Remark + "','',getdate()," + userid + "," + jiangjin + "," + zhongzi + ");";
                            //        SqlCommand cmd = new SqlCommand(sql_Add1, conn);
                            //        int reInt1 = cmd.ExecuteNonQuery();
                            //        conn.Close();

                            //    }

                            //}
                            //用户账户更新
                            //MySQL(string.Format(" exec proc_Fenxiangjiang "+ orderModel.UserID+ ","+ orderModel.OrderTotal+ "" ));
                            //MySQL(string.Format(" exec proc_Yejijiang " + orderModel.UserID + "," + orderModel.OrderTotal + ""));
                            //MySQL(string.Format(" exec proc_YejiUp " + orderModel.UserID + "," + orderModel.OrderTotal + ""));
                            Response.Write("<script>alert('收货成功');location.href='OrderList.aspx';</script>");
                            return;
                            //ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('收货成功!');", true);
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('收货失败!');", true);
                            return;
                        }
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('此订单记录不存在!');", true);
                    return;
                }
            }
        }
Example #17
0
        /// <summary>
        /// 输入验证
        /// </summary>
        /// <returns></returns>
        protected bool RegValidate()
        {
            lgk.Model.tb_user  recommendInfo = new lgk.Model.tb_user();
            lgk.Model.tb_user  parentInfo    = new lgk.Model.tb_user();
            lgk.Model.tb_agent agentInfo     = new lgk.Model.tb_agent();

            if (iLocation == 0)
            {
                MessageBox.ShowBox(this.Page, "请扫描正确的二维码", Library.Enums.ModalTypes.warning);//请输入会员编号
                return(false);
            }

            if (txtUserCode.Value.Trim() == "")
            {
                MessageBox.ShowBox(this.Page, GetLanguage("PleaseNumber"), Library.Enums.ModalTypes.warning);//请输入会员编号
                return(false);
            }
            //if (!PageValidate.checkUserCode(txtUserCode.Value.Trim()))
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("MemberNumber") + "');", true);//会员编号必须由6-10位的英文字母或数字组成
            //    return false;
            //}

            if (GetUserID(txtUserCode.Value.Trim()) > 0)
            {
                MessageBox.ShowBox(this.Page, GetLanguage("Memberexists"), Library.Enums.ModalTypes.warning);//该会员编号已存在,请重新输入!

                return(false);
            }

            #region 密码
            if (txtPassword.Value.Trim() == "")
            {
                MessageBox.ShowBox(this.Page, GetLanguage("PasswordISNull"), Library.Enums.ModalTypes.warning);//登录密码不能为空

                return(false);
            }

            if (txtRegPassword.Value.Trim() == "")
            {
                MessageBox.ShowBox(this.Page, GetLanguage("ConfirmPasswordISNull"), Library.Enums.ModalTypes.warning);//确认密码不能为空

                return(false);
            }
            if (!txtPassword.Value.Trim().Equals(txtRegPassword.Value.Trim()))
            {
                MessageBox.ShowBox(this.Page, GetLanguage("TwoPasswordMatch"), Library.Enums.ModalTypes.warning);//两次输入的登录密码不一致

                return(false);
            }
            if (txtSecondPassword.Value.Trim() == "")
            {
                MessageBox.ShowBox(this.Page, GetLanguage("SecondaryISNUll"), Library.Enums.ModalTypes.warning);//二级密码不能为空

                return(false);
            }

            if (txtRegSecondPassword.Value.Trim() == "")
            {
                MessageBox.ShowBox(this.Page, GetLanguage("secondaryPasswordISNull"), Library.Enums.ModalTypes.warning);//确认二级密码不能为空

                return(false);
            }
            if (!txtSecondPassword.Value.Trim().Equals(txtRegSecondPassword.Value.Trim()))
            {
                MessageBox.ShowBox(this.Page, GetLanguage("TwoSecondaryMatch"), Library.Enums.ModalTypes.warning);//两次输入的二级密码不一致

                return(false);
            }

            #endregion

            #region 银行信息
            if (dropBank.SelectedValue == "0")
            {
                MessageBox.ShowBox(this.Page, "请选择开户银行", Library.Enums.ModalTypes.warning);
                return(false);
            }

            string strBankBranch = txtBankBranch.Value.Trim();
            if (string.IsNullOrEmpty(strBankBranch))
            {
                MessageBox.ShowBox(this.Page, "请输入银行支行", Library.Enums.ModalTypes.warning);
                return(false);
            }

            string strBankAccount = txtBankAccount.Value.Trim();
            if (string.IsNullOrEmpty(strBankAccount))
            {
                MessageBox.ShowBox(this.Page, "请输入银行账户", Library.Enums.ModalTypes.warning);
                return(false);
            }

            string strBankAccountUser = txtBankAccountUser.Value.Trim();
            if (string.IsNullOrEmpty(strBankAccountUser))
            {
                MessageBox.ShowBox(this.Page, "请输入开户姓名", Library.Enums.ModalTypes.warning);
                return(false);
            }
            #endregion

            #region 手机号码验证
            var strPhoneNum = this.txtPhoneNum.Value.Trim();

            if (!string.IsNullOrEmpty(strPhoneNum) && !PageValidate.RegexPhone(strPhoneNum))
            {
                MessageBox.ShowBox(this.Page, GetLanguage("PhoneMust"), Library.Enums.ModalTypes.error);//联系电话格式错误
                return(false);
            }

            //int userid = GetUserIDbByPhone(strPhoneNum);
            //if (userid > 0)
            //{
            //    MessageBox.ShowBox(this.Page, GetLanguage("PhoneRegExists"), Library.Enums.ModalTypes.info);//该手机号码已注册
            //    return false;
            //}

            int ct = GetPhoneNumber(strPhoneNum);
            if (ct >= 1)
            {
                MessageBox.ShowBox(this.Page, string.Format(GetLanguage("RegisterPhoneNumber")), Library.Enums.ModalTypes.warning);//该手机号码已注册
                return(false);
            }
            #endregion

            #region 身份证验证
            string strIdCode = txtIDNumber.Value.Trim();
            if (string.IsNullOrEmpty(strIdCode))
            {
                MessageBox.ShowBox(this.Page, string.Format("请输入身份证号码"), Library.Enums.ModalTypes.warning);//该身份证号注册
                return(false);
            }
            ct = GetIDCodeNumber(strIdCode);

            if (ct >= 1)
            {
                MessageBox.ShowBox(this.Page, string.Format(GetLanguage("RegisterIDCodeNumber")), Library.Enums.ModalTypes.warning);//该身份证号注册
                return(false);
            }

            #endregion

            string strAddress = txtAddress.Value.Trim();
            if (string.IsNullOrEmpty(strAddress))
            {
                MessageBox.ShowBox(this.Page, GetLanguage("AddressEmpty"), Library.Enums.ModalTypes.error);//收货地址不能为空
                return(false);
            }

            //if (dropQuestion.SelectedValue.Trim() == "0")
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("PleaseSelectQuestion") + "');", true);//请选择密保问题
            //    return false;
            //}
            //if (string.IsNullOrEmpty(txtAnswer.Text))
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("PleaseAnswer") + "');", true);//请输入密保答案
            //    return false;
            //}
            return(true);
        }