Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        siteUrl = SiteConfig.SiteInfo.SiteUrl;
        if (siteUrl.Substring(siteUrl.Length - 1, 1) == "/")
        {
            siteUrl = siteUrl.Substring(0, siteUrl.Length - 1);
        }
        info            = buser.GetLogin();
        UserNameLb.Text = info.UserName;
        uName.Text      = info.UserName;
        double        GradeVar = info.UserExp;
        M_PointGrounp pointmod = pointBll.SelectPintGroup((int)info.UserExp);

        if (string.IsNullOrEmpty(pointmod.GroupName))
        {
            UserLvLb.Text = "";
        }
        else
        {
            UserLvLb.Text = "[" + pointmod.GroupName + "]";
        }
        LvIcon_Span.Attributes["class"] = pointmod.ImgUrl;
        GroupPic gp    = new GroupPic();
        M_Uinfo  binfo = buser.GetUserBaseByuserid(info.UserID);

        UserAddressLb.Text  = binfo.Address;
        UserSignLb.Text     = binfo.Sign;
        UserRegTimeLb.Text  = info.RegTime.ToString();
        UserYeLb.Text       = info.Purse.ToString();
        UserJfLb.Text       = info.UserExp.ToString();
        UserJbLb.Text       = info.SilverCoin.ToString();
        imgUserPic.ImageUrl = getproimg(binfo.UserFace);
        MyBind();
        MyDataBind();
    }
Esempio n. 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         switchID.Value = HttpUtility.HtmlEncode(Request.QueryString["sel"]);
         if (!buser.CheckLogin())
         {
             function.WriteErrMsg("请先<a href=/User/Login.aspx>登录</a>!", "/User/Login.aspx");
         }
         if (SiteConfig.UserConfig.UserMobilAuth.Equals("0"))
         {
             tbMobile.Enabled = false;
         }
         M_UserInfo mu = buser.GetLogin();
         UserFace_Hid.Value    = Path.GetFileName(mu.UserFace);
         tbUserFace.Text       = mu.UserFace;
         CompanyName.Text      = mu.CompanyName;
         UserFace_Img.ImageUrl = mu.UserFace;
         SFile_Up.FileUrl      = mu.UserFace;
         //CompanyGroup是否为企业用户组0-否 1-是
         //if (gpBll.GetByID(Convert.ToInt32(mu.GroupID)).CompanyGroup == 1)
         //{
         //    DivCompany.Visible = true;
         //    txtCompanyName.Text = mu.CompanyName;
         //    txtCompanyDescribe.Text = mu.CompanyDescribe;
         //}
         M_Uinfo binfo = buser.GetUserBaseByuserid(mu.UserID);
         if (!binfo.IsNull)
         {
             tbTrueName.Text         = mu.TrueName;
             txtHonName.Text         = mu.HoneyName;
             tbUserSex.SelectedValue = binfo.UserSex ? "1" : "0";
             address.Value           = binfo.Province + "," + binfo.City + "," + binfo.County;
             tbAddress.Text          = binfo.Address;
             tbBirthday.Text         = binfo.BirthDay;
             tbFaceWidth.Text        = binfo.FaceWidth.ToString();
             tbFaceHeight.Text       = binfo.FaceHeight.ToString();
             tbFax.Text              = binfo.Fax;
             tbHomepage.Text         = binfo.HomePage;
             tbHomePhone.Text        = binfo.HomePhone;
             tbIDCard.Text           = binfo.IDCard;
             tbMobile.Text           = binfo.Mobile;
             tbMSN.Text              = binfo.MSN;
             tbOfficePhone.Text      = binfo.OfficePhone;
             tbPrivacy.SelectedValue = binfo.Privating.ToString();
             tbQQ.Text      = binfo.QQ;
             tbSign.Text    = binfo.Sign;
             tbUC.Text      = binfo.UC;
             tbZipCode.Text = binfo.ZipCode;
             //公司信息与职务
             Position.Text = binfo.Position;
         }
         lblHtml.Text = fieldBll.InputallHtml(0, 0, new ModelConfig()
         {
             Fields  = SiteConfig.UserConfig.RegFieldsMustFill + "," + SiteConfig.UserConfig.RegFieldsSelectFill,
             Source  = ModelConfig.SType.UserRegister,
             ValueDT = buser.GetUserBaseByuserid(mu.UserID.ToString())
         });
     }
 }
Esempio n. 3
0
        protected string GetUserName(string UserID)
        {
            M_UserInfo uinfo     = ull.GetUserByUserID(DataConverter.CLng(UserID));
            M_Uinfo    ubaseinfo = ull.GetUserBaseByuserid(DataConverter.CLng(UserID));

            return(uinfo.UserName);
        }
Esempio n. 4
0
        public IActionResult Mobile_2()
        {
            string mobile   = RequestEx["NewMobile_T"];
            string key      = RequestEx["NewVCode_hid"];
            string vcode    = RequestEx["NewVCode"];
            string checknum = RequestEx["NewCheckNum_T"];

            basemu            = buser.GetUserBaseByuserid(mu.UserID);
            ViewBag.newmoblie = mobile;
            Step = 2;
            if (string.IsNullOrEmpty(NewCheckNum))
            {
                ShowAlert("校验码不存在,请重新发送校验码"); return(View("Mobile"));
            }
            else if (!checknum.Equals(NewCheckNum))
            {
                ShowAlert("校验码不匹配"); return(View("Mobile"));
            }
            else if (buser.IsExist("ume", mobile))
            {
                ShowAlert("该手机号已存在"); return(View("Mobile"));
            }
            else if (!RegexHelper.IsMobilPhone(mobile))
            {
                ShowAlert("手机格式不正确"); return(View("Mobile"));
            }
            else
            {
                basemu.Mobile = mobile;
                buser.UpdateBase(basemu);
            }
            return(WriteOK("修改手机号成功", "/User/Info/UserInfo"));
        }
Esempio n. 5
0
        public IActionResult UserBase_Edit()
        {
            DataTable dt = ubfbll.Select_All();
            DataTable table;

            try
            {
                table = Call.GetDTFromMVC(dt, Request);
            }
            catch (Exception e)
            {
                return(WriteErr(e.Message));
            }
            mu.UserFace    = HttpUtility.HtmlEncode(RequestEx["UserFace_T"]);
            mu.HoneyName   = HttpUtility.HtmlEncode(RequestEx["txtHonName"]);
            mu.CompanyName = HttpUtility.HtmlEncode(RequestEx["CompanyName"]);
            mu.TrueName    = HttpUtility.HtmlEncode(RequestEx["tbTrueName"]);
            M_Uinfo binfo = buser.GetUserBaseByuserid(mu.UserID);

            binfo.Address  = RequestEx["tbAddress"];
            binfo.BirthDay = RequestEx["tbBirthday"];
            binfo.UserFace = mu.UserFace;
            binfo.Fax      = RequestEx["tbFax"];
            binfo.HomePage = RequestEx["tbHomepage"];
            //binfo.ICQ = Server.HtmlEncode(tbICQ.Text.Trim());
            binfo.HomePhone   = RequestEx["tbHomePhone"];
            binfo.IDCard      = RequestEx["tbIDCard"];
            binfo.Mobile      = HttpUtility.HtmlEncode(RequestEx["tbMobile"]);
            binfo.OfficePhone = RequestEx["tbOfficePhone"];
            binfo.Privating   = DataConvert.CLng(RequestEx["tbPrivacy"]);
            //binfo.PHS = Server.HtmlEncode(tbPHS.Text.Trim());
            binfo.QQ      = RequestEx["tbQQ"];
            binfo.Sign    = RequestEx["tbSign"];
            binfo.UC      = RequestEx["tbUC"];
            binfo.UserSex = DataConverter.CBool(RequestEx["tbUserSex"]);
            //binfo.Yahoo = Server.HtmlEncode(tbYahoo.Text.Trim());
            binfo.ZipCode   = HttpUtility.HtmlEncode(RequestEx["tbZipCode"]);
            binfo.HoneyName = mu.HoneyName;
            binfo.TrueName  = mu.TrueName;
            string[] adrestr = GetParam("address").Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            binfo.Province = adrestr[0];
            binfo.City     = adrestr[1];
            binfo.County   = adrestr[2];
            binfo.Position = HttpUtility.HtmlEncode(RequestEx["Position"]);
            buser.UpDateUser(mu);
            if (binfo.IsNull)
            {
                binfo.UserId = mu.UserID;
                buser.AddBase(binfo);
            }
            else
            {
                buser.UpdateBase(binfo);//更新用户信息
            }
            if (table.Rows.Count > 0)
            {
                buser.UpdateUserFile(binfo.UserId, table);
            }
            return(WriteOK("修改成功", "UserBase"));
        }
Esempio n. 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     mu = buser.GetLogin();
     if (!IsPostBack)
     {
         ucMod = ucBll.SelModelByUserID(mu.UserID);
         if (ucMod == null)//无对应权限,则是默认权限
         {
         }
         else//拥有权限
         {
             SetChk();
         }
         uinfoMod      = buser.GetUserBaseByuserid(mu.UserID);
         TrueName.Text = mu.HoneyName;
         if (uinfoMod.UserSex)
         {
             UserSex.SelectedValue = "1";
         }
         else
         {
             UserSex.SelectedValue = "2";
         }
         UserPhone.Text = uinfoMod.Mobile;
         UserTel.Text   = uinfoMod.HomePhone;
         Branch.Text    = groupBll.GetGroupNameByIDS(mu.GroupID.ToString());
         StatusT.Text   = mu.State == 0 ? "在职" : "离职";
     }
 }
Esempio n. 7
0
        public IActionResult GetPassWord_Mobile()
        {
            if (!VerifyHelper.Check(RequestEx["VCode_hid"]))
            {
                return(WriteErr("验证码不正确", "/User/Change/GetPassword"));
            }
            M_UserInfo mu     = GetUserByName(RequestEx["TxtUserName"]);
            M_Uinfo    basemu = buser.GetUserBaseByuserid(mu.UserID);

            if (string.IsNullOrEmpty(basemu.Mobile))
            {
                return(WriteErr("用户未设置手机号,无法通过手机号找回"));
            }
            string code   = function.GetRandomString(6, 2);
            string mobile = basemu.Mobile;

            if (mobileBll.CheckMobile(HttpContext, mobile))
            {
                CommonReturn ret = SMS_Helper.SendVCode(mobile, code, SMSConfig.Instance.Tlp_GetBack);
                //添加一条发送手机短信记录
                mobileBll.Insert(new M_Safe_Mobile()
                {
                    Phone = mobile, VCode = code, Source = "GetPassWord_Mobile", UserID = mu.UserID, UserName = mu.UserName, SysRemind = ret.err
                });
            }
            else
            {
                return(WriteErr("短信发送次数超过上限!"));
            }
            UserMobile  = mobile;
            GetPwdUName = mu.UserName;
            GetPwdStep  = "mobile_code";
            return(View("GetPassWord"));
        }
Esempio n. 8
0
        public ActionResult GetPassWord_Mobile()
        {
            if (!ZoomlaSecurityCenter.VCodeCheck(Request.Form["VCode_hid"], Request.Form["VCode"]))
            {
                function.WriteErrMsg("验证码不正确", "/User/Change/GetPassword"); return(Content(""));
            }
            M_UserInfo mu     = GetUserByName(Request.Form["TxtUserName"]);
            M_Uinfo    basemu = buser.GetUserBaseByuserid(mu.UserID);

            if (string.IsNullOrEmpty(basemu.Mobile))
            {
                function.WriteErrMsg("用户未设置手机号,无法通过手机号找回"); return(Content(""));
            }
            string code    = function.GetRandomString(6, 2);
            string content = "【" + SiteConfig.SiteInfo.SiteName + "】,你正在使用找回密码服务,校验码:" + code;

            SendWebSMS.SendMessage(basemu.Mobile, content);
            //短信信息存入数据库
            M_Message messInfo = new M_Message();

            messInfo.Title    = "验证码:找回密码";
            messInfo.PostDate = DataConverter.CDate(DateTime.Now.ToLocalTime().ToString());
            messInfo.Content  = content;
            messInfo.Receipt  = "";
            messInfo.MsgType  = 3;
            messInfo.status   = 1;
            messInfo.Incept   = mu.UserID.ToString();
            B_Message.Add(messInfo);

            mu.seturl = code;
            buser.UpdateByID(mu);
            GetPwdStep = "mobile_code";
            return(View("GetPassWord"));
        }
Esempio n. 9
0
    public void Submit_B_Click(object sender, EventArgs e)
    {
        string result = CheckUserName(UserName_T.Text.Replace(" ", ""));

        if (result.Equals("disabled"))
        {
            function.WriteErrMsg("该用户名禁止注册,请输入不同的用户名!");
        }
        else if (result.Equals("false"))
        {
            function.WriteErrMsg("该用户名已被他人占用,请输入不同的用户名");
        }

        M_UserInfo mu     = buser.GetLogin();
        M_Uinfo    baseMu = buser.GetUserBaseByuserid(mu.UserID);

        if (baseMu.IsNull)
        {
            baseMu.UserId = mu.UserID;
            mu.UserBase   = baseMu;
        }
        mu.UserName = UserName_T.Text;
        mu.UserPwd  = StringHelper.MD5(Password_T.Text);
        mu.Email    = Email_T.Text;
        mu.GroupID  = 2;
        mu.RoomID   = 1;

        buser.UpdateByID(mu);
        buser.UpdateBase(baseMu);
        function.WriteSuccessMsg("操作成功!", "/User/Default1.aspx");
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     B_User.CheckIsLogged(Request.RawUrl);
     if (!IsPostBack)
     {
         M_UserInfo mu     = buser.GetLogin();
         M_Uinfo    basemu = buser.GetUserBaseByuserid(mu.UserID);
         if (basemu != null)
         {
             Mobile_T.Text   = basemu.Mobile;
             Email_T.Text    = mu.Email;
             CompName_T.Text = mu.CompanyName;
             QQ_T.Text       = basemu.QQ;
         }
         M_User_Plat upMod = upBll.SelReturnModel(mu.UserID);
         if (upMod != null && upMod.Status != -1)
         {
             ShowRemind("你已开通能力中心,不需要再申请");
         }
         else if (alyBll.IsExist("plat_applyopen", mu.UserID))
         {
             ShowRemind("你提交的审请正在审核中...");
         }
     }
 }
Esempio n. 11
0
        /// <summary>
        /// 用于创建公司,审核认证
        /// </summary>
        public void NewByUserDT(M_Plat_Comp compMod, DataTable userDT)
        {
            B_Plat_Group gpBll = new B_Plat_Group();

            for (int i = 0; i < userDT.Rows.Count; i++)
            {
                string gname = userDT.Rows[i]["gname"].ToString();
                string uname = userDT.Rows[i]["uname"].ToString();
                string honey = userDT.Rows[i]["honey"].ToString();
                if (string.IsNullOrEmpty(uname))
                {
                    continue;
                }
                M_UserInfo newmu = buser.NewUser(uname, "111111");
                newmu.HoneyName = honey;
                newmu.UserID    = buser.Add(newmu);
                M_Uinfo basemu = buser.NewBase(newmu);
                buser.AddBase(basemu);
                //----能力相关信息
                M_Plat_Group gpMod = gpBll.NewGroup(gname, compMod.ID, newmu.UserID);
                M_User_Plat  upMod = NewUser(newmu, compMod);
                gpMod.ID  = gpBll.Insert(gpMod);
                upMod.Gid = gpMod.ID.ToString();
                Insert(upMod);
            }
        }
Esempio n. 12
0
        //直接修改手机号,需要后端配置
        public IActionResult Mobile_Free()
        {
            if (!SiteConfig.UserConfig.UserMobilAuth.Equals("1"))
            {
                return(WriteErr("未允许自由修改手机号"));
            }
            string page   = "MobileFree";
            string mobile = RequestEx["NewMobile_T"];

            basemu         = buser.GetUserBaseByuserid(mu.UserID);
            ViewBag.mu     = mu;
            ViewBag.basemu = basemu;
            if (buser.IsExist("ume", mobile))
            {
                ShowAlert("该手机号已存在"); return(View(page));
            }
            else if (!RegexHelper.IsMobilPhone(mobile))
            {
                ShowAlert("手机格式不正确"); return(View(page));
            }
            else
            {
                basemu        = buser.GetUserBaseByuserid(mu.UserID);
                basemu.Mobile = mobile;
                buser.UpdateBase(basemu);
            }
            return(WriteOK("修改手机号成功", "/User/Info/UserInfo"));
        }
Esempio n. 13
0
        public ActionResult GetPassWord_Mobile()
        {
            if (!VerifyHelper.Check(Request.Form["VCode_hid"]))
            {
                function.WriteErrMsg("验证码不正确", "/User/Change/GetPassword"); return(Content(""));
            }
            M_UserInfo mu     = GetUserByName(Request.Form["TxtUserName"]);
            M_Uinfo    basemu = buser.GetUserBaseByuserid(mu.UserID);

            if (string.IsNullOrEmpty(basemu.Mobile))
            {
                function.WriteErrMsg("用户未设置手机号,无法通过手机号找回"); return(Content(""));
            }
            string code    = function.GetRandomString(6, 2);
            string content = "你正在使用找回密码服务,校验码:" + code;
            string mobile  = basemu.Mobile;

            if (mobileBll.CheckMobile(mobile))
            {
                string ret = SendWebSMS.SendMessage(mobile, content);
                //添加一条发送手机短信记录
                mobileBll.Insert(new M_Safe_Mobile()
                {
                    Phone = mobile, VCode = code, Source = "GetPassWord_Mobile", UserID = mu.UserID, UserName = mu.UserName, SysRemind = ret
                });
            }
            else
            {
                function.WriteErrMsg("短信发送次数超过上限!"); return(null);
            }
            UserMobile  = mobile;
            GetPwdUName = mu.UserName;
            GetPwdStep  = "mobile_code";
            return(View("GetPassWord"));
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            Stream srdPreview  = FileUpload1.FileContent;
            string filecontent = StreamtoString(srdPreview);

            string[] linetxt = filecontent.Split(new string[] { "\n" }, StringSplitOptions.RemoveEmptyEntries);


            for (int i = 1; i < linetxt.Length; i++)
            {
                string userinfo = linetxt[i];

                string[] userarr = linetxt[i].Split(new string[] { "\t" }, StringSplitOptions.None);
                for (int ii = 0; ii < userarr.Length; ii++)
                {
                    if (buser.GetUserIDByUserName(userarr[0].ToString()).UserID == 0)
                    {
                        M_UserInfo userinfos = new M_UserInfo();
                        userinfos.GroupID  = gll.DefaultGroupID();
                        userinfos.UserName = userarr[0].ToString();
                        userinfos.Email    = userarr[1].ToString();
                        //userinfos.UserExp = DataConverter.CLng(userarr[2].ToString());
                        if (userpwd.Text == "")
                        {
                            userinfos.UserPwd = StringHelper.MD5("admin888");
                        }
                        else
                        {
                            userinfos.UserPwd = StringHelper.MD5(userpwd.Text);
                        }
                        userinfos.TrueName = userarr[3].ToString();
                        int     userid = buser.AddModel(userinfos);
                        M_Uinfo uinfos = new M_Uinfo();
                        uinfos.UserId = DataConverter.CLng(userid);

                        uinfos.BirthDay     = userarr[4].ToString();
                        uinfos.Address      = userarr[5].ToString();
                        uinfos.OfficePhone  = userarr[6].ToString();
                        uinfos.HomePhone    = userarr[7].ToString();
                        uinfos.Fax          = userarr[8].ToString();
                        uinfos.ZipCode      = userarr[9].ToString();
                        uinfos.Mobile       = userarr[10].ToString();
                        uinfos.UserSex      = DataConverter.CBool(userarr[11].ToString());
                        uinfos.QQ           = userarr[12].ToString();
                        uinfos.MSN          = userarr[13].ToString();
                        uinfos.IDCard       = userarr[14].ToString();
                        uinfos.HomePage     = userarr[15].ToString();
                        uinfos.Province     = userarr[16].ToString();
                        uinfos.County       = userarr[17].ToString();
                        uinfos.WorkProvince = userarr[18].ToString();
                        uinfos.WorkCounty   = userarr[19].ToString();
                        buser.AddBase(uinfos);
                    }
                }
            }
            Label1.Text = "<font color=green>导入成功!</font>";
        }
Esempio n. 15
0
    //Excel导出
    protected void Export_Click(object sender, EventArgs e)
    {
        //if (ViewState["tableinfo"] != null)
        //{
        StringBuilder sb       = new StringBuilder();
        string        titles   = "会员名,Email,会员积分,真实姓名,生日,联系地址,办公电话,家庭电话,传真号码,邮编,手机号,性别,QQ号码,MSN号码,身份证号码,个人主页,籍省,户籍县市,工作所在省,工作所在县市";
        string        fildname = "UserName,Email,UserExp,TrueName,BirthDay,Address,OfficePhone,HomePhone,Fax,ZipCode,Mobile,UserSex,QQ,MSN,IDCard,HomePage,Province,County,workProvince,workCity";

        string[]  usertit   = titles.Split(',');
        string[]  userfild  = fildname.Split(',');
        DataTable viewtable = buser.SelAll();

        sb.Append(titles.Replace(",", "\t"));
        sb.Append("\n");
        for (int ii = 0; ii < viewtable.Rows.Count; ii++)
        {
            int     UserID = DataConverter.CLng(viewtable.Rows[ii]["UserID"].ToString());
            M_Uinfo ustino = buser.GetUserBaseByuserid(UserID);
            if (ustino.UserId == 0)
            {
                ustino.UserId = UserID;
                buser.AddBase(ustino);
            }
            DataTable uinfo = buser.GetUserBaseByuserid(UserID.ToString());
            if (uinfo != null && uinfo.Rows.Count > 0)
            {
                for (int i = 0; i < userfild.Length; i++)
                {
                    if (i == 11)
                    {
                        if (Convert.ToBoolean(uinfo.Rows[0][userfild[i]]))
                        {
                            sb.Append("男\t");
                        }
                        else
                        {
                            sb.Append("女\t");
                        }
                    }
                    else
                    {
                        sb.Append(uinfo.Rows[0][userfild[i]] + "\t");
                    }
                }
            }
            sb.Append("\n");
        }
        Response.Clear();
        Response.Buffer      = true;
        Response.ContentType = "application/vnd.ms-excel";
        Response.AddHeader("Content-Disposition", "attachment;filename=UserInfo(" + DateTime.Now.ToString() + ").xls");
        Response.Charset         = "UTF-8";
        Response.ContentEncoding = Encoding.Default;
        Response.Write(sb.ToString());
        Response.End();
        //}
    }
Esempio n. 16
0
        //用户信息验证,身份证号,生日等
        private bool CheckUserInfo(M_Uinfo basemu)
        {
            if (string.IsNullOrEmpty(basemu.IDCard))
            {
                return(true);
            }
            if (buser.IsExitcard(basemu.IDCard))
            {
                //("该身份证号已被注册,请输入不同的身份证号!");
                return(false);
            }
            bool foundMatch = false;

            try
            {
                foundMatch = Regex.IsMatch(basemu.IDCard, @"^\d{17}([0-9]|X)$");
                if (foundMatch)
                {
                    string   birth   = basemu.IDCard.Substring(6, 8).Insert(6, "-").Insert(4, "-");
                    DateTime time    = new DateTime();
                    DateTime newDate = DateTime.Now.AddYears(-120);
                    DateTime now     = DateTime.Now;
                    if (DateTime.TryParse(birth, out time) == false)
                    {
                        //("该身份证生日不正确!");
                        return(false);
                    }
                    else
                    {
                        DateTime data1 = Convert.ToDateTime(birth);
                        TimeSpan ts    = newDate - data1;
                        TimeSpan ts2   = data1 - now;
                        if (ts.Days > 0)
                        {
                            //("您超过了120岁?请核对身份证号。");
                            return(false);
                        }
                        else if (ts2.Days > 0)
                        {
                            //("您还没出生吧?请核对身份证号。");
                            return(false);
                        }
                    }
                }
                else
                {
                    //("该身份证格式不正确!");
                    return(false);
                }
            }
            catch (ArgumentException)
            {
                return(true);
            }
            return(true);
        }
Esempio n. 17
0
    public void Submit_B_Click(object sender, EventArgs e)
    {
        string mobile = mobile_txt.Text;
        string code   = mobile_code.Text;
        //string result = CheckUserName(UserName_T.Text.Replace(" ", ""));
        //if (result.Equals("disabled")) { function.WriteErrMsg("该用户名禁止注册,请输入不同的用户名!"); }
        //else if (result.Equals("false")) { function.WriteErrMsg("该用户名已被他人占用,请输入不同的用户名"); }

        M_UserInfo mu     = buser.GetLogin();
        M_Uinfo    baseMu = buser.GetUserBaseByuserid(mu.UserID);

        string serverCode = Cache["mobile_code_" + mobile] as string;

        if (mu.IsNull)
        {
            function.WriteErrMsg("用户未登录!");
        }
        else if (string.IsNullOrEmpty(mobile))
        {
            function.WriteErrMsg("手机号不能为空!");
        }
        else if (!regHelp.IsMobilPhone(mobile))
        {
            function.WriteErrMsg("手机格式不正确!");
        }
        else if (string.IsNullOrEmpty(code))
        {
            function.WriteErrMsg("校验码为空!");
        }
        else if (serverCode == null || string.IsNullOrEmpty(serverCode))
        {
            function.WriteErrMsg("无对应的校验码信息!");
        }
        else if (!serverCode.Equals(code, StringComparison.CurrentCultureIgnoreCase))
        {
            function.WriteErrMsg("校验码不匹配");
        }
        else
        {
            mu.UserPwd = StringHelper.MD5(Password_T.Text);
            mu.GroupID = 2;
            mu.RoomID  = 1;

            if (baseMu.IsNull)
            {
                baseMu.UserId = mu.UserID;
                mu.UserBase   = baseMu;
            }
            baseMu.Mobile = mobile;
            buser.UpdateByID(mu);
            buser.UpdateBase(baseMu);
            Cache["mobile_code_" + mobile] = "";
            function.WriteSuccessMsg("注册成功!", "/User/Default1.aspx");
        }
    }
Esempio n. 18
0
    protected void Button1_Click1(object sender, EventArgs e)
    {
        double     money = 5;
        M_UserInfo mu    = buser.GetLogin();
        DataTable  pubdt = SqlHelper.ExecuteTable(CommandType.Text, "select * from ZL_Pub_code where PubUserID=" + mu.UserID + " And Pubstart=1 And DATEDIFF(MINUTE,PubAddTime,GETDATE())<=5", null);

        if (pubdt.Rows.Count > 0)
        {
            function.WriteErrMsg("五分钟之内只能购买一次!");
        }
        else
        {
            DataTable bmdt = SqlHelper.ExecuteTable("select * from ZL_CommonModel left join ZL_C_yjbl on ItemID=ID where ModelID=51 And Status=99 And bm=" + bm.Text);
            if (bmdt.Rows.Count > 0)
            {
                DataTable bmudt = SqlHelper.ExecuteTable("select * from ZL_Pub_code where Pubstart=1 And bm=" + bm.Text);
                if (bmudt.Rows.Count > 0)
                {
                    function.WriteErrMsg("该编码已使用,请重新输入!");
                }
                else
                {
                    pubMod = pubBll.SelReturnModel(PubID);
                    string    Mdata = "[{PubContentid:'" + bm.Text + "',PubTitle:'业绩信息',PubContent:'" + PubContent.Text + "',bm:'" + bm.Text + "'}]";
                    DataTable dt    = JsonConvert.DeserializeObject <DataTable>(Mdata);
                    ForDataColumn(pubMod, dt);
                    DataRow dr = dt.Rows[0];
                    if (DBCenter.Insert(pubMod.PubTableName, BLLCommon.GetFields(dr), BLLCommon.GetParas(dr), BLLCommon.GetParameters(dr)) > 0)
                    {
                        M_Uinfo umub = buser.GetUserBaseByuserid(mu.UserID);
                        switch (umub.Province)
                        {
                        case "北京":
                            money = 10;
                            break;

                        default:
                            break;
                        }
                        buser.ChangeVirtualMoney(mu.UserID, new M_UserExpHis()
                        {
                            score     = 10,
                            ScoreType = 1,
                            detail    = "销售产品获得资金:" + money + ",业绩编码:" + bm.Text
                        });
                        function.WriteSuccessMsg("销售成功!", "/User/Info/ConsumeDetail1.aspx?SType=1");
                    }
                }
            }
            else
            {
                function.WriteErrMsg("该编码无效,请重新输入!");
            }
        }
    }
Esempio n. 19
0
    protected void Button3_Click(object sender, EventArgs e)
    {
        int            id       = DataConverter.CLng(Request.QueryString["id"]);
        M_UserInfo     userinfo = Uinfo.GetUserByUserID(id);
        M_Uinfo        users    = Uinfo.GetUserBaseByuserid(id);
        B_Client_Basic bsc      = new B_Client_Basic();
        M_Client_Basic client   = new M_Client_Basic();
        //通过客户姓名获取客户信息
        DataTable dt = new DataTable();

        dt = bsc.SelByName(userinfo.UserName.Trim());
        if (dt == null || dt.Rows.Count <= 0) //如果找不到客户则升级
        {
            client.Flow          = 0;
            client.Client_Source = "在线注册";
            client.Client_Area   = users.Province;
            client.P_name        = userinfo.UserName;
            client.Add_Date      = DateTime.Now;
            client.Code          = DataSecurity.MakeFileRndName();
            client.Add_Name      = userinfo.TrueName;
            client.Title         = "在线注册";
            M_Client_Penson person  = new M_Client_Penson();
            B_Client_Penson bperson = new B_Client_Penson();
            person.Flow       = 0;
            person.Code       = client.Code;
            person.Birthday   = DataConverter.CDate(users.BirthDay);
            person.city       = users.County;
            person.country    = users.Country;
            person.Fax_phone  = users.Fax;
            person.Home_Phone = users.HomePhone;
            person.Homepage   = users.HomePage;
            person.ICQ_Code   = users.ICQ;
            person.Id_Code    = users.IDCard;
            person.MSN_Code   = users.MSN;
            person.Native     = users.Province;
            person.province   = users.County;
            person.QQ_Code    = users.QQ;
            person.Telephone  = users.Mobile;
            person.UC_Code    = users.UC;
            person.Work_Phone = users.OfficePhone;
            person.YaoHu_Code = users.Yahoo;
            person.ZipCodeW   = users.ZipCode;
            bsc.GetInsert(client);
            bperson.GetInsert(person);
            function.WriteSuccessMsg("升级成功,请进入客户管理系统管理客户信息!");
        }
        else  //否则就提示
        {
            Response.Redirect("EditCus.aspx?id=" + id);
        }
        if (dt != null)
        {
            dt.Dispose();
        }
    }
Esempio n. 20
0
        public ActionResult UserBase()
        {
            M_Uinfo basemu = buser.GetUserBaseByuserid(mu.UserID);

            ViewBag.modelhtml = fieldBll.InputallHtml(0, 0, new ModelConfig()
            {
                Fields  = SiteConfig.UserConfig.RegFieldsMustFill + "," + SiteConfig.UserConfig.RegFieldsSelectFill,
                Source  = ModelConfig.SType.UserRegister,
                ValueDT = buser.GetUserBaseByuserid(mu.UserID.ToString())
            });
            ViewBag.gpMod  = gpBll.SelReturnModel(mu.GroupID);
            ViewBag.basemu = basemu;
            return(View());
        }
Esempio n. 21
0
        //发送手机验证码(步骤1或步骤2的)
        public string SendValidCode(string key, string vcode, string mobile)
        {
            if (!B_User.CheckIsLogged(Request.RawUrl))
            {
                return(null);
            }
            B_Safe_Mobile mbBll = new B_Safe_Mobile();

            basemu   = buser.GetUserBaseByuserid(buser.GetLogin().UserID);
            CheckNum = ""; NewCheckNum = "";
            switch (Step)
            {
            case 2:
                NewCheckNum   = function.GetRandomString(6, 2).ToLower();
                basemu.Mobile = mobile;
                break;

            default:
                CheckNum = function.GetRandomString(6, 2).ToLower();
                break;
            }
            if (!ZoomlaSecurityCenter.VCodeCheck(key, vcode))
            {
                retMod.retmsg = "验证码不正确";
            }
            else
            {
                if (mbBll.CheckMobile(basemu.Mobile))
                {
                    string content = "【" + SiteConfig.SiteInfo.SiteName + "】你正在使用修改手机号服务,校验码:" + CheckNum + NewCheckNum;
                    SendWebSMS.SendMessage(basemu.Mobile, content);
                    M_Message messInfo = new M_Message();
                    messInfo.Sender  = basemu.UserId.ToString();
                    messInfo.Title   = "验证码:修改手机号[" + basemu.Mobile + "]";
                    messInfo.Content = content;
                    messInfo.Receipt = "";
                    messInfo.MsgType = 2;
                    messInfo.status  = 1;
                    messInfo.Incept  = basemu.UserId.ToString();
                    B_Message.Add(messInfo);
                    retMod.retcode = M_APIResult.Success;
                    retMod.retmsg  = "校验码已成功发送到你的手机";
                }
                else
                {
                    retMod.retmsg = "禁止向该号码发送短信,请联系管理员";
                }
            }
            return(retMod.ToString());
        }
Esempio n. 22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                WxAPI  wxapi = WxAPI.Code_Get();
                string code  = Request.QueryString["code"] ?? "";
                if (string.IsNullOrEmpty(code))
                {
                    return;
                }
                string     result = APIHelper.GetWebResult("https://api.weixin.qq.com/sns/oauth2/access_token?appid=" + wxapi.AppId.APPID + "&secret=" + wxapi.AppId.Secret + "&code=" + code + "&grant_type=authorization_code");
                JObject    obj    = (JObject)JsonConvert.DeserializeObject(result);
                string     openid = obj["openid"].ToString();
                Appinfo    umod   = appBll.SelModelByOpenID(openid, "wechat");
                M_UserInfo mu     = new M_UserInfo();
                if (umod == null)
                {
                    umod = new Appinfo();
                    M_WX_User wuMod = wxuserBll.SelForOpenid(wxapi.AppId.ID, openid);
                    if (wuMod == null)
                    {
                        wuMod = wxapi.GetWxUserModel(openid);
                        wxuserBll.Insert(wuMod);
                    }
                    mu.UserName  = "******" + DateTime.Now.ToString("yyyyMMddHHmmss") + function.GetRandomString(2).ToLower();
                    mu.UserPwd   = StringHelper.MD5(function.GetRandomString(6));
                    mu.Email     = function.GetRandomString(10) + "@random.com";
                    mu.HoneyName = wuMod.Name;
                    mu.TrueName  = wuMod.Name;
                    mu.UserID    = buser.Add(mu);

                    umod.UserID     = mu.UserID;
                    umod.SourcePlat = "wechat";
                    umod.OpenID     = wuMod.OpenID;
                    appBll.Insert(umod);
                    M_Uinfo mubase = new M_Uinfo();
                    mubase.UserId = mu.UserID;
                    buser.AddBase(mubase);
                }
                else
                {
                    mu = buser.SelReturnModel(umod.UserID);
                }
                //设置为登录状态
                buser.SetLoginState(mu);
                Response.Redirect(RUrl);
            }
        }
Esempio n. 23
0
        public ActionResult UserBase()
        {
            M_Uinfo basemu = buser.GetUserBaseByuserid(mu.UserID);

            ViewBag.gpMod  = gpBll.SelReturnModel(mu.GroupID);
            ViewBag.basemu = basemu;
            DataTable   valueDT = DBCenter.SelTop(1, "UserID", "*", "ZL_UserBase", "UserID=" + mu.UserID, "");
            ModelConfig modcfg  = new ModelConfig()
            {
                Source = ModelConfig.SType.Admin, ValueDT = valueDT
            };
            VM_FieldModel model = new VM_FieldModel(ubBll.Select_All(), modcfg);

            ViewBag.htmlMod = model;
            return(View(mu));
        }
Esempio n. 24
0
    //发送校验号
    protected void SendEMail_Btn_Click(object sender, EventArgs e)
    {
        M_Uinfo basemu = buser.GetUserBaseByuserid(buser.GetLogin().UserID);

        CheckNum = function.GetRandomString(6, 2).ToLower();
        //CheckNum = "111111";
        if (!ZoomlaSecurityCenter.VCodeCheck(Request.Form["VCode_hid"], VCode.Text))
        {
            ShowAlert("验证码不正确"); return;
        }
        else
        {
            SendWebSMS.SendMessage(basemu.Mobile, "【" + SiteConfig.SiteInfo.SiteName + "】你正在使用修改手机号服务,校验码:" + CheckNum);
            ShowInfo("校验码已成功发送到你的手机");
        }
    }
Esempio n. 25
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         M_Uinfo basemu = buser.GetUserBaseByuserid(buser.GetLogin().UserID);
         SMobile_T.Text = basemu.Mobile;
         if (string.IsNullOrEmpty(basemu.Mobile))
         {
             step2_div.Visible = true;
         }
         else
         {
             step1_div.Visible = true;
         }
     }
 }
Esempio n. 26
0
    public string GetUserInfo(string str)
    {
        int id = DataConvert.CLng(Eval("CUser"));

        if (str.Equals("groupName"))
        {
            userinfo = buser.GetUserByUserID(id);
            return(bgp.GetByID(DataConverter.CLng(userinfo.GroupID)).GroupName);
        }
        else if (str.Equals("count"))
        {
            DataTable dt = new DataTable();
            dt = barBll.SelByCateID(id.ToString(), 2);
            return(dt.Rows.Count + "");
        }
        else if (str.Equals("userBirth"))
        {
            users = buser.GetUserBaseByuserid(id);
            return(users.BirthDay);
        }
        else if (str.Equals("userExp"))
        {
            userinfo = buser.GetUserByUserID(id);
            return(userinfo.UserExp + "");
        }
        else if (str.Equals("userSex"))
        {
            users = buser.GetUserBaseByuserid(id);
            if ((users.UserSex + "") == "False")
            {
                return("女");
            }
            else
            {
                return("男");
            }
        }
        else if (str.Equals("regTime"))
        {
            DateTime datetime = tpuserBll.GetLogin().RegTime;
            return(datetime.Year + "-" + datetime.Month + "-" + datetime.Day);
        }
        else
        {
            return("");
        }
    }
Esempio n. 27
0
        public IActionResult Index()
        {
            if (!buser.CheckUserStatus(mu, ref err))
            {
                return(WriteErr(err));
            }
            M_Uinfo basemu = buser.GetUserBaseByuserid(mu.UserID);
            //--------------------------------------------------
            B_Search  shBll      = new B_Search();
            DataTable dt         = shBll.SelByUserGroup(mu.GroupID);
            string    userapptlp = "<div class='col-xl-2 col-lg-2 col-md-2 col-sm-4 col-4 @mobile user_menuBox'><div class='user_menu'><a target='@target' href='@fileUrl'>@ico<br/>@name</a></div></div>";
            string    onthertlp  = "<li><a target='@target' href='@fileUrl'>@ico<span>@name</span></a></li>";
            string    userhtml   = "";
            string    ontherhtml = "";

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DataRow dr      = dt.Rows[i];
                string  fileUrl = DataConvert.CStr(dr["fileUrl"]).ToLower();
                if (fileUrl.Contains(".aspx"))
                {
                    continue;
                }
                if (fileUrl.Contains("/office") || fileUrl.Contains("markdown") || fileUrl.Contains("/design/") || fileUrl.Contains("userday"))
                {
                    continue;
                }
                string targetlink = GetLinkTarget(dr["OpenType"].ToString());
                string mobileStr  = DataConvert.CLng(dr["mobile"]) == 1 ? "" : "d-none d-sm-block";
                if (DataConverter.CLng(dr["EliteLevel"]) == 1)//抽出推荐应用
                {
                    userhtml += ReplaceData(userapptlp, dr).Replace("@target", targetlink).Replace("@mobile", mobileStr);
                }
                else
                {
                    ontherhtml += ReplaceData(onthertlp, dr).Replace("@target", targetlink);
                }
            }
            ViewBag.userhtml   = MvcHtmlString.Create(userhtml);
            ViewBag.ontherhtml = MvcHtmlString.Create(ontherhtml);
            //---------------------
            ViewBag.mu     = mu;
            ViewBag.basemu = basemu;
            return(View(mu));
        }
Esempio n. 28
0
        //发送手机验证码(步骤1或步骤2的)
        public string SendValidCode(string key, string vcode, string mobile)
        {
            B_Safe_Mobile mbBll = new B_Safe_Mobile();

            basemu   = buser.GetUserBaseByuserid(mu.UserID);
            CheckNum = ""; NewCheckNum = "";
            switch (Step)
            {
            case 2:
                NewCheckNum   = function.GetRandomString(6, 2).ToLower();
                basemu.Mobile = mobile;
                break;

            default:
                CheckNum = function.GetRandomString(6, 2).ToLower();
                break;
            }
            if (!VerifyHelper.Check(RequestEx["VCode_hid"]))
            {
                retMod.retmsg = "验证码不正确";
            }
            else
            {
                if (mbBll.CheckMobile(HttpContext, basemu.Mobile))
                {
                    string content = "你正在使用修改手机号服务,校验码:" + CheckNum + NewCheckNum;

                    M_Message messInfo = new M_Message();
                    messInfo.Sender  = basemu.UserId;
                    messInfo.Title   = "验证码:修改手机号[" + basemu.Mobile + "]";
                    messInfo.Content = content;
                    messInfo.MsgType = 2;
                    messInfo.status  = 1;
                    messInfo.Incept  = basemu.UserId.ToString();
                    new B_Message().GetInsert(messInfo);
                    retMod.retcode = M_APIResult.Success;
                    retMod.retmsg  = "校验码已成功发送到你的手机";
                }
                else
                {
                    retMod.retmsg = "禁止向该号码发送短信,请联系管理员";
                }
            }
            return(retMod.ToString());
        }
Esempio n. 29
0
        public void SyncUB(M_User_Plat model)
        {
            M_Uinfo ubMod = buser.GetUserBaseByuserid(model.UserID);

            ubMod.UserId   = model.UserID;
            ubMod.Position = model.Post;
            ubMod.Mobile   = model.Mobile;
            ubMod.UserFace = model.UserFace;
            ubMod.TrueName = model.TrueName;
            if (ubMod.IsNull)
            {
                buser.AddBase(ubMod);
            }
            else
            {
                buser.UpdateBase(ubMod);
            }
        }
Esempio n. 30
0
    //-----------------Step2
    protected void SendNewEmail_Btn_Click(object sender, EventArgs e)
    {
        M_Uinfo basemu = buser.GetUserBaseByuserid(buser.GetLogin().UserID);

        NewMobile = NewMobile_T.Text.Trim();
        //if (buser.IsExist("ume", NewMobile)) { ShowAlert("该手机号已存在"); return; }
        NewCheckNum = function.GetRandomString(6, 2).ToLower();
        //NewCheckNum = "111111";
        if (!ZoomlaSecurityCenter.VCodeCheck(Request.Form["NewVCode_hid"], NewVCode.Text))
        {
            ShowAlert("验证码不正确" + Request.Form["NewVCode_hid"] + ":" + NewVCode.Text); return;
        }
        else
        {
            SendWebSMS.SendMessage(NewMobile_T.Text, "【" + SiteConfig.SiteInfo.SiteName + "】校验码:" + NewCheckNum);
            ShowInfo("校验码已成功发送到你的新手机!");
        }
    }