Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string action = Web9long.Web.Util.Form("action");
        switch (action)
        {
            case "checklogin":
                string username = Web9long.Web.Util.Form("username");
                string pwd = Web9long.Web.Util.Form("password");
                string code = Web9long.Web.Util.Form("verifycode").Trim();
                string ExpiresDate = Web9long.Web.Util.Form("ExpiresDate");
                string rs=string.Empty;

                if (code.ToLower() != Session["VerCode"].ToString().ToLower().Trim())
                {
                    rs = "验证码错误";
                }
                else
                {
                    bool rember = ExpiresDate.Trim() == "1";
                    SYS_ManageInfo ety = ManageDAL.ManageTryLogin(username, pwd, rember, out rs);
                    EmptyTable et = new EmptyTable();
                    et.TableCondition().TableName = "Sys_Managelog";
                    et.Set("user_name", username);
                    et.Set("login_ip", Web9long.Web.Util.AgentIp());
                    et.Set("note",rs==string.Empty?"成功登录":rs);
                    using (SiteBLL bll = new SiteBLL())
                    {
                        bll.Insert(et);
                    }
                }
                Response.Write(rs);
                Response.End();
                break;
        }
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        bll = new SiteBLL();
        EmptyTable ety = new EmptyTable();
        string action = Web9long.Web.Util.Form("actype");
        string sql = string.Empty;

        switch (action)
        {
           #region 注册个人会员
            case"1":
                //验证用户是否存在
                string username = Web9long.Web.Util.Form("txtUserName");
                username = Web9long.DB.SQLUtility.Replace(username).Trim();
                sql = "select *  from US_UserInfo where UI_UserName='******'";
                DataTable dt=bll.GetDataTable(sql);
                if (dt!=null&&dt.Rows.Count>0) Web9long.Web.Clew.AlertBack("注册名已经存在");
                ety.TableCondition().TableName = "US_UserInfo";
                ety.Set("UI_UserName", username);
                ety.Set("UI_Mobile", Web9long.DB.SQLUtility.Replace(Web9long.Web.Util.Form("txtMobile")));
                ety.Set("UI_UserPwd", Web9long.Encrypt.MD5(Web9long.Web.Util.Form("txtPassword").Trim()));
                bll.Insert(ety);
                Response.Redirect("../user/userregok.aspx?username="******"2":
                username = Web9long.Web.Util.Form("txtUserName");
                username = Web9long.DB.SQLUtility.Replace(username).Trim();
                string pwd = Web9long.Web.Util.Form("txtPassword").Trim();
                bool rember = Web9long.Web.Util.Form("chkRemember")!="";
                string result=string.Empty;
                bool rs = UserDal.UserTryLogin(username, pwd, rember, out result);
                if (rs)
                    Response.Redirect("../user/index.aspx");
                else
                    Web9long.Web.Clew.AlertBack(result);
                break;

            #endregion

           #region 修改密码
            case "3":
                username = Web9long.Web.Util.Form("username");
                username = Web9long.DB.SQLUtility.Replace(username).Trim();
                pwd = Web9long.Web.Util.Form("txtOldPassword").Trim();
                rs = UserDal.UserTryLoin(username, pwd);
                if (!rs) Web9long.Web.Clew.AlertBack("原密码错误!");
                pwd = Web9long.Web.Util.Form("txtPassword").Trim();
                rs = UserDal.UpdatePwd(username, pwd);
                if (rs) Web9long.Web.Clew.Alert("修改密码成功", "../user/changepwd.aspx");
                else Web9long.Web.Clew.Alert("修改密码失败", "../user/changepwd.aspx");
                break;
           #endregion

            #region 注册专家

            case "5":
                username = Web9long.Web.Util.Form("txtUserName");
                username = Web9long.DB.SQLUtility.Replace(username).Trim();
                sql = "select *  from DoctorUserInfo where OF_DocUserName='******'";
                dt=bll.GetDataTable(sql);
                if (dt!=null&&dt.Rows.Count>0) Web9long.Web.Clew.AlertBack("注册名已经存在");
                ety.TableCondition().TableName = "DoctorUserInfo";
                ety.Set("OF_DocUserName", username);
                ety.Set("OF_DocMobile", Web9long.DB.SQLUtility.Replace(Web9long.Web.Util.Form("txtMobile")));
                ety.Set("OF_DocTrueName", Web9long.DB.SQLUtility.Replace(Web9long.Web.Util.Form("txtTureName")));
                ety.Set("OF_DocEmail", Web9long.DB.SQLUtility.Replace(Web9long.Web.Util.Form("txtEmail")));
                string tel = Web9long.DB.SQLUtility.Replace(Web9long.Web.Util.Form("txtquhao")) +"-"+ Web9long.DB.SQLUtility.Replace(Web9long.Web.Util.Form("txtTelphone")) +"-"+ Web9long.DB.SQLUtility.Replace(Web9long.Web.Util.Form("txtFenji"));
                ety.Set("OF_DocTel", tel);
                ety.Set("OF_DocUserPwd", Web9long.Encrypt.MD5(Web9long.Web.Util.Form("txtPassword").Trim()));
                bll.Insert(ety);
                Response.Redirect("../user/RegDoctor2.aspx?username="******"6":
                ety.TableCondition().TableName = "DoctorUserInfo";
                ety.TableCondition().Where = string.Format("OF_DocUserName='******'", Web9long.DB.SQLUtility.Replace(Web9long.Web.Util.Form("docUsername")));
                ety.Set("OF_DocProvice", Web9long.DB.SQLUtility.Replace(Web9long.Web.Util.Form("province")));
                ety.Set("OF_DocCity", Web9long.DB.SQLUtility.Replace(Web9long.Web.Util.Form("city")));
                ety.Set("OF_DocHosptol", Web9long.DB.SQLUtility.Replace(Web9long.Web.Util.Form("txthospital")));
                ety.Set("OF_DocOffice", Web9long.DB.SQLUtility.Replace(Web9long.Web.Util.Form("txtoffice")));
                bll.Update(ety);
                Response.Redirect("../user/RegDoctorOK.aspx?username="******"docUsername"));




                break;
            #endregion 

        }

    }