protected void btnConfirm_Click(object sender, EventArgs e) { if (IsUserAlreadyLogin) { if (!XiHuan_UserFacade.IsUserValid(CurrentUserName, txtOldPassWord.Text)) { Alert("原密码不正确"); return; } else { XiHuan_UserInfoEntity modifypwd = XiHuan_UserInfoEntityAction.RetrieveAXiHuan_UserInfoEntity(CurrentUserId); if (modifypwd != null) { modifypwd.OrignalPwd = txtNewPassWord.Text.Trim(); modifypwd.Md5Pwd = CommonMethod.MD5Encrypt(txtNewPassWord.Text.Trim()); modifypwd.Save(); Alert("恭喜:您的密码已成功修改!"); } } } else { MemberCenterPageRedirect("", "modifypwd"); } }
protected void lnkLogin_Click(object sender, EventArgs e) { #region 验证 if (username.Value.Trim().Length == 0) { Alert("请输入您的换客名!"); Select(username); return; } if (userpwd.Value.Trim().Length == 0) { Alert("请输入您的密码!"); Select(userpwd); return; } #endregion #region 系统登陆 if (XiHuan_UserFacade.IsUserValid(username.Value, userpwd.Value)) { int uid = XiHuan_UserFacade.GetIdByName(username.Value); DateTime dt = DateTime.MinValue; if (autologin.Checked) { dt = DateTime.Now.AddDays(14); } CommonMethod.AddLoginCookie(uid, username.Value, dt); string path = CommonMethod.FinalString(Request["path"]); if (path.Length > 0) { Response.Redirect(Server.UrlDecode(path)); } else { Response.Redirect("membercenter.aspx"); } } else { Alert("换客名或密码不正确,请重试!"); return; } #endregion }
protected void btnLogin_Click1(object sender, EventArgs e) { #region 务器端验证 if (txtUserName.Text.Trim().Length == 0) { Alert("请输入您的换客名!"); Select(txtUserName); return; } if (txtPwd.Text.Trim().Length == 0) { Alert("请输入您的密码!"); Select(txtPwd); return; } #endregion #region 系统登陆 if (XiHuan_UserFacade.IsUserValid(txtUserName.Text, txtPwd.Text)) { int uid = XiHuan_UserFacade.GetIdByName(txtUserName.Text); DateTime dt = DateTime.MinValue; if (chkAutoLogin.Checked) { dt = DateTime.Now.AddDays(14); } CommonMethod.AddLoginCookie(uid, txtUserName.Text, dt); Alert("您已成功登录,请在窗口关闭后继续刚才的操作 ^_^!"); ExecScript("parent.ymPrompt.close();"); } else { Alert("换客名或密码不正确,请重试!"); return; } #endregion }
protected void btnSubmit_Click(object sender, ImageClickEventArgs e) { #region 验证 if (txtUserName.Text.Trim().Length == 0) { Alert("请输入您的换客名!"); Select(txtUserName); return; } if (txtPwd.Text.Trim().Length == 0) { Alert("请输入您的密码!"); Select(txtPwd); return; } #endregion #region 换客登陆 string usernmae = Microsoft.JScript.GlobalObject.unescape(hidUserName.Value.Trim()); string pwd = Microsoft.JScript.GlobalObject.unescape(hidPwd.Value.Trim()); if (XiHuan_UserFacade.IsUserValid(usernmae, pwd)) { int uid = XiHuan_UserFacade.GetIdByName(usernmae); DateTime dt = DateTime.MinValue; if (chkAutoLogin.Checked) { dt = DateTime.Now.AddDays(14); } CommonMethod.AddLoginCookie(uid, usernmae, dt); Response.Redirect("membercenter.aspx"); } else { Alert("用户名或密码不正确,请重试!"); ExecScript("window.location='login.aspx';"); } #endregion }
private void AddNotes() { #region 验证 string username = CommonMethod.FinalString(Request["username"]); string userpass = CommonMethod.FinalString(Request["pwd"]); if (!IsUserAlreadyLogin) { if (username.Length == 0) { CommonMethod.ResponseAjaxContent(this.Page, "needusername"); return; } if (userpass.Length == 0) { CommonMethod.ResponseAjaxContent(this.Page, "needpwd"); return; } } #endregion #region 留言提交 XiHuan_GuestBookEntity newguest = new XiHuan_GuestBookEntity(); newguest.ToId = CommonMethod.ConvertToInt(Request["oid"], 0); newguest.ToName = GlobalObject.unescape(CommonMethod.FinalString(Request["oname"])); newguest.GoodsId = CommonMethod.ConvertToInt(Request["gid"], 0);; newguest.GoodsName = GlobalObject.unescape(CommonMethod.FinalString(Request["gname"])); if (IsUserAlreadyLogin) { newguest.FromId = CurrentUserId; newguest.FromName = CurrentUserName; } else { if (XiHuan_UserFacade.IsUserValid(username, userpass)) { CommonMethod.AddLoginCookie(XiHuan_UserFacade.GetIdByName(username), username, DateTime.MinValue); newguest.FromName = username; newguest.FromId = XiHuan_UserFacade.GetIdByName(username); } else { CommonMethod.ResponseAjaxContent(this.Page, "notvaliduser"); return; } } newguest.Content = GlobalObject.unescape(CommonMethod.FinalString(Request["content"])); newguest.IsScerect = CommonMethod.FinalString(Request["issceret"]) == "true" ? (byte)1 : (byte)0; newguest.CreateDate = DateTime.Now; newguest.IsChecked = 0; newguest.Save(); SendMailFacade.sendEmail(CommonMethodFacade.GetConfigValue("NoticeEmail"), "有人在喜换网留言了", "有人在喜换网留言了,快去审核吧!"); if (CommonMethod.FinalString(Request["type"]).Equals("1")) { CommonMethod.readAspxAndWriteHtmlSoruce("showdetail.aspx?id=" + newguest.GoodsId, CommonMethod.FinalString(Request["url"])); } CommonMethod.ResponseAjaxContent(this.Page, "ok"); #endregion }