private void init_load() { if (FloginUser != null) { Model_F_User model = new Model_F_User(); model = bll_f_user.GetModel(FloginUser.UserId); if (model == null) { return; } labUserName.Text = model.UserName; txtTrueUserName.Text = model.TrueName; ddlSex.SelectedValue = model.Sex; txtEmail.Text = model.Email; txtMoblie.Text = model.Mobile; ddlSubject.SelectedValue = model.Subject; txtAge.Text = (model.Birthday != null ? DateTime.Parse(model.Birthday.ToString()).ToString("yyyy-MM-dd") : ""); BindProvince(); ddlProvince.SelectedValue = model.Province; BindCity(); ddlCity.SelectedValue = model.City; BindCountry(); ddlCountry.SelectedValue = model.County; } }
protected void btnConfirm_Click(object sender, EventArgs e) { try { BLL_F_User bll = new BLL_F_User(); Model_F_User model = new Model_F_User(); string oldPass = txtOldPass.Text.Trim(); string newPass = txtNewPass.Text.Trim(); model = bll.GetModel(FloginUser.UserName, Rc.Common.StrUtility.DESEncryptLogin.EncryptString(oldPass)); if (model == null) { ClientScript.RegisterStartupScript(this.GetType(), "save", "<script type='text/javascript'>layer.msg('原始密码不正确',{icon:2,time:2000});</script>"); return; } model.Password = Rc.Common.StrUtility.DESEncryptLogin.EncryptString(newPass); if (bll.Update(model)) { ClientScript.RegisterStartupScript(this.GetType(), "save", "<script type='text/javascript'>layer.msg('密码修改成功',{icon:1,time:1000},function(){window.location.href='../index.aspx';});</script>"); } else { ClientScript.RegisterStartupScript(this.GetType(), "save", "<script type='text/javascript'>layer.msg('密码修改失败',{icon:2,time:2000});</script>"); } } catch (Exception) { ClientScript.RegisterStartupScript(this.GetType(), "save", "<script type='text/javascript'>layer.msg('保存失败',{icon:2,time:2000});</script>"); } }
protected void Page_Load(object sender, EventArgs e) { SchoolId = Request["SchoolId"].Filter(); UserId = Request["UserId"].Filter(); if (!IsPostBack) { if (string.IsNullOrEmpty(UserId)) { Response.Write("参数错误!"); } else { user = bll_user.GetModel(UserId); DataTable dt = new DataTable(); string strWhere = string.Empty; //学科 strWhere = " D_Type='7' order by d_order"; dt = new BLL_Common_Dict().GetList(strWhere).Tables[0]; Rc.Cloud.Web.Common.pfunction.SetDdlEmpty(ddlSubject, dt, "D_Name", "Common_Dict_ID", "--请选择--"); //身份 strWhere = " D_Type='15' order by d_order "; Rc.Cloud.Web.Common.pfunction.SetDdlEmpty(ddlUserPost, new BLL_Common_Dict().GetList(strWhere).Tables[0], "D_Name", "Common_Dict_ID", "--请选择--"); } } }
/// <summary> /// 修改时的默认值 /// </summary> protected void loadData() { model_f_user = bll_f_user.GetModel(UserId); if (model_f_user == null) { return; } else { ddlUserPost.SelectedValue = model_f_user.UserPost; txtUserName.Text = model_f_user.UserName; txtTrueName.Text = model_f_user.TrueName; txtAge.Text = (model_f_user.Birthday != null ? DateTime.Parse(model_f_user.Birthday.ToString()).ToString("yyyy-MM-dd") : ""); ddlSex.SelectedValue = model_f_user.Sex; txtEmail.Text = model_f_user.Email; txtMobile.Text = model_f_user.Mobile; ddlSubject.SelectedValue = model_f_user.Subject; txtExpirationDate.Text = (model_f_user.ExpirationDate != null ? DateTime.Parse(model_f_user.ExpirationDate.ToString()).ToString("yyyy-MM-dd") : ""); } }
protected void Page_Load(object sender, EventArgs e) { userid = Request.QueryString["UserId"].Filter(); if (!IsPostBack) { DataTable dt = new DataTable(); string strWhere = string.Empty; strWhere = " D_Type='15' order by d_order "; Rc.Cloud.Web.Common.pfunction.SetDdlEmpty(ddlUserPost, new Rc.BLL.Resources.BLL_Common_Dict().GetList(strWhere).Tables[0], "D_Name", "Common_Dict_ID", "--请选择--"); BLL_F_User bll = new BLL_F_User(); Model_F_User model = new Model_F_User(); model = bll.GetModel(userid); txtTureName.Text = model.TrueName; txtUserName.Text = model.UserName; ddlUserPost.SelectedValue = model.UserPost; } }
protected void btnConfirm_Click(object sender, EventArgs e) { try { BLL_F_User bll = new BLL_F_User(); Model_F_User model = new Model_F_User(); string UserName = txtUserName.Text.Trim(); string PassWord = txtPassWord.Text.Trim(); model = bll.GetModel(UserName, Rc.Common.StrUtility.DESEncryptLogin.EncryptString(PassWord)); if (model == null) { ClientScript.RegisterStartupScript(this.GetType(), "Save", "<script type='text/javascript'>layer.ready(function(){layer.msg('账号或密码不正确,请重新填写',{icon:4,time:2000,offset:'10px'})})</script>"); return; } else { BLL_StudentToParent Sbll = new BLL_StudentToParent(); Model_StudentToParent Smodel = new Model_StudentToParent(); DataTable dt = Sbll.GetList("Student_ID='" + model.UserId + "' and parent_id='" + FloginUser.UserId + "'").Tables[0]; if (model.UserIdentity == "S" && dt.Rows.Count == 0) { Smodel.StudentToParent_ID = Guid.NewGuid().ToString(); Smodel.Parent_ID = FloginUser.UserId; Smodel.Student_ID = model.UserId; Smodel.CreateTime = DateTime.Now; if (Sbll.Add(Smodel)) { ClientScript.RegisterStartupScript(this.GetType(), "Save", "<script type='text/javascript'>layer.ready(function(){layer.msg('添加成功',{icon:1,time:2000,offset:'10px'},function(){parent.window.location.reload()})})</script>"); } } else { ClientScript.RegisterStartupScript(this.GetType(), "Save", "<script type='text/javascript'>layer.ready(function(){layer.msg('账号不正确或此账号已绑定',{icon:4,time:2000,offset:'10px'})})</script>"); return; } } } catch (Exception ex) { ClientScript.RegisterStartupScript(this.GetType(), "Save", "<script type='text/javascript'>layer.ready(function(){layer.msg('" + ex.Message + "',{icon:4,time:2000,offset:'10px'})})</script>"); } }
protected void btnSubmit_Click(object sender, EventArgs e) { try { BLL_F_User bll = new BLL_F_User(); Model_F_User model = new Model_F_User(); model = bll.GetModel(userid); if (model != null) { string UserName = txtUserName.Text.Trim(); if (string.IsNullOrEmpty(UserName)) { ClientScript.RegisterStartupScript(this.GetType(), "save", "<script type='text/javascript'>layer.ready(function () {layer.msg('请输入登录名',{icon:2,time:2000});})</script>"); return; } if (bll.GetRecordCount("UserId<>'" + userid + "' and UserName='******'") > 0) { ClientScript.RegisterStartupScript(this.GetType(), "save", "<script type='text/javascript'>layer.ready(function () {layer.msg('登录名已存在,请重新输入',{icon:2,time:2000});})</script>"); return; } model.UserName = UserName; model.TrueName = txtTureName.Text.Trim(); model.UserPost = ddlUserPost.SelectedValue; if (bll.Update(model)) { ClientScript.RegisterStartupScript(this.GetType(), "save", "<script type='text/javascript'>layer.ready(function () {layer.msg('修改成功',{icon:1,time:1000},function(){parent.loadData();parent.layer.close(index);});})</script>"); } else { ClientScript.RegisterStartupScript(this.GetType(), "save", "<script type='text/javascript'>layer.ready(function () {layer.msg('修改失败',{icon:2,time:2000});})</script>"); } } else { ClientScript.RegisterStartupScript(this.GetType(), "save", "<script type='text/javascript'>layer.msg('修改失败',{icon:2,time:2000});</script>"); } } catch (Exception ex) { ClientScript.RegisterStartupScript(this.GetType(), "save", "<script type='text/javascript'>layer.msg('修改失败',{icon:2,time:2000});</script>"); } }
public static string resettingPwd(string UserId) { try { Model_F_User modelFUser = (Model_F_User)HttpContext.Current.Session["FLoginUser"]; string userId = modelFUser.UserId; Model_F_User user = new Model_F_User(); BLL_F_User bll = new BLL_F_User(); user = bll.GetModel(UserId.Filter()); if (user != null) { user.Password = Rc.Common.StrUtility.DESEncryptLogin.EncryptString("123456"); } Model_Msg modelMsg = new Model_Msg(); modelMsg.MsgId = Guid.NewGuid().ToString(); modelMsg.MsgEnum = MsgEnum.Notice.ToString(); modelMsg.MsgTypeEnum = MsgTypeEumn.Private.ToString(); modelMsg.ResourceDataId = ""; modelMsg.MsgTitle = string.Format("您的密码被【{0}】老师重置为123456", string.IsNullOrEmpty(modelFUser.TrueName) ? modelFUser.UserName : modelFUser.TrueName); modelMsg.MsgContent = string.Format("您的密码被【{0}】老师重置为123456", string.IsNullOrEmpty(modelFUser.TrueName) ? modelFUser.UserName : modelFUser.TrueName); modelMsg.MsgStatus = MsgStatus.Unread.ToString(); modelMsg.MsgSender = userId; modelMsg.MsgAccepter = UserId; modelMsg.CreateTime = DateTime.Now; modelMsg.CreateUser = userId; if (bll.resettingPwd(user, modelMsg)) { return("1"); } else { return("0"); } } catch (Exception) { return("0"); } }
protected void btnSubmit_Click(object sender, EventArgs e) { try { BLL_F_User bll = new BLL_F_User(); Model_F_User model = new Model_F_User(); model = bll.GetModel(userid); if (model != null) { //string oldPass = txt_oldpassword.Text.Trim(); string newPass = txt_newpassword.Text.Trim(); //model = bll.GetModel(model.UserName, Rc.Common.StrUtility.DESEncryptLogin.EncryptString(oldPass)); //if (model == null) //{ // ClientScript.RegisterStartupScript(this.GetType(), "save", "<script type='text/javascript'>layer.msg('原始密码不正确',{icon:2,time:2000});</script>"); // return; //} model.Password = Rc.Common.StrUtility.DESEncryptLogin.EncryptString(newPass); if (bll.Update(model)) { ClientScript.RegisterStartupScript(this.GetType(), "save", "<script type='text/javascript'>layer.msg('密码修改成功',{icon:1,time:1000},function(){parent.layer.close(index);});</script>"); } else { ClientScript.RegisterStartupScript(this.GetType(), "save", "<script type='text/javascript'>layer.msg('密码修改失败',{icon:2,time:2000});</script>"); } } else { ClientScript.RegisterStartupScript(this.GetType(), "save", "<script type='text/javascript'>layer.msg('密码修改失败',{icon:2,time:2000});</script>"); } } catch (Exception ex) { ClientScript.RegisterStartupScript(this.GetType(), "save", "<script type='text/javascript'>layer.msg('密码修改失败',{icon:2,time:2000});</script>"); } }