public void btnSave_Click(object sender, EventArgs e) { hm.BLL.users bll = new hm.BLL.users(); string strErr = ""; if (this.txtuserName.Text.Trim().Length == 0) { strErr += "用户名不能为空!\\n"; } if (this.txtTrueName.Text.Trim().Length == 0) { strErr += "用户名不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int userId = int.Parse(this.lbluserId.Text); string userName = this.txtuserName.Text; string trueName = this.txtTrueName.Text; int deptId = int.Parse(this.ddrDept.SelectedValue); string deptName = this.ddrDept.Items[ddrDept.SelectedIndex].Text; int roleId = int.Parse(this.ddrRole.SelectedValue); string roleName = this.ddrRole.Items[ddrRole.SelectedIndex].Text; int sex = int.Parse(this.rblSex.SelectedValue); string tel = this.txttel.Text; string email = this.txtemail.Text; string qq = this.txtqq.Text; DateTime addTime = DateTime.Now; DateTime lastLoginTime = DateTime.Now; int status = int.Parse(this.ddrStatus.SelectedValue); hm.Model.users model = bll.GetModel(userId); model.userName = userName; model.trueName = trueName; model.roleId = roleId; model.roleName = roleName; model.sex = sex; model.tel = tel; model.email = email; model.qq = qq; model.addTime = addTime; model.lastLoginTime = lastLoginTime; model.status = status; bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }
private void ShowInfo(int userId) { hm.BLL.users bll = new hm.BLL.users(); hm.Model.users model = bll.GetModel(userId); this.lbluserId.Text = model.userId.ToString(); this.txtuserName.Text = model.userName; this.txtTrueName.Text = model.trueName; ddrRole.SelectedValue = model.roleId.ToString(); rblSex.SelectedValue = model.sex.ToString(); this.txttel.Text = model.tel; this.txtemail.Text = model.email; this.txtqq.Text = model.qq; ddrStatus.SelectedValue = model.status.ToString(); }
public void btnSave_Click(object sender, EventArgs e) { hm.BLL.users bllUser = new hm.BLL.users(); HttpCookie cookie = Request.Cookies["userId"]; if (null == cookie) { Response.Write("<script language=javascript>window.parent.location='../Login.aspx';</script>");// } else { string userId = cookie.Value; string oldPass = Maticsoft.Common.DEncrypt.DESEncrypt.Encrypt(txtPassword.Text.Trim(), ConfigHelper.GetConfigString("PassWordEncrypt")); string newPass = Maticsoft.Common.DEncrypt.DESEncrypt.Encrypt(txtNewPass.Text.Trim(), ConfigHelper.GetConfigString("PassWordEncrypt")); string reNewPass = Maticsoft.Common.DEncrypt.DESEncrypt.Encrypt(txtReNewPass.Text.Trim(), ConfigHelper.GetConfigString("PassWordEncrypt")); if (!newPass.Equals(reNewPass)) { MessageBox.Show(this, "新密码两次输入的不一致!"); return; } DataSet ds = bllUser.GetList("userId=" + userId + " and [password]='" + oldPass + "'"); if (ds.Tables[0].Rows.Count > 0) { Model.users model = bllUser.GetModel(int.Parse(userId)); if (model != null) { model.password = newPass; model.nickName = ""; model.address = ""; model.studyType = 1; model.score = 0; bllUser.Update(model); MessageBox.Show(this, "修改成功!"); } } else { MessageBox.Show(this, "密码输入错误,请重新输入!"); } } }
private void ShowInfo(int userId) { hm.BLL.users bll = new hm.BLL.users(); hm.Model.users model = bll.GetModel(userId); this.lbluserId.Text = model.userId.ToString(); this.lbluserName.Text = model.userName; this.lblpassword.Text = "******"; if (string.IsNullOrEmpty(model.roleName)) { this.lblroleName.Text = "用户"; } else { this.lblroleName.Text = model.roleName; } string sex = "男"; if ("0".Equals(model.sex.ToString())) { sex = "女"; } lbldeptName.Text = model.deptName; this.lblsex.Text = sex; this.lbltel.Text = model.tel; this.lblemail.Text = model.email; this.lblqq.Text = model.qq; this.lbladdTime.Text = model.addTime.ToString(); this.lbllastLoginTime.Text = model.lastLoginTime.ToString(); //this.lblstatus.Text = ClassHelper.GetSystemItemName(model.status.ToString());//(这个是读码表的,现在不存在码表) if (model.status.ToString() == "1") { this.lblstatus.Text = "正常"; } else { this.lblstatus.Text = "冻结"; } lblTrueName.Text = model.trueName; }
public void btnSave_Click(object sender, EventArgs e) { hm.BLL.users bllUser = new hm.BLL.users(); string userId = Common.Cookie.GetValue(StatusHelpercs.Cookie_Admin_UserId); if (string.IsNullOrEmpty(userId)) { Response.Write("<script language=javascript>window.parent.location='../Login.aspx';</script>");// } else { string oldPass = Maticsoft.Common.DEncrypt.DESEncrypt.Encrypt(txtPassword.Text.Trim(), ConfigHelper.GetConfigString("PassWordEncrypt")); string newPass = Maticsoft.Common.DEncrypt.DESEncrypt.Encrypt(txtNewPass.Text.Trim(), ConfigHelper.GetConfigString("PassWordEncrypt")); string reNewPass = Maticsoft.Common.DEncrypt.DESEncrypt.Encrypt(txtReNewPass.Text.Trim(), ConfigHelper.GetConfigString("PassWordEncrypt")); if (!newPass.Equals(reNewPass)) { MessageBox.Show(this, "新密码两次输入的不一致!"); return; } DataSet ds = bllUser.GetList("userId='" + userId + "' and password='******'"); if (ds.Tables[0].Rows.Count > 0) { Model.users model = bllUser.GetModel(int.Parse(userId)); if (model != null) { model.password = newPass; bllUser.Update(model); MessageBox.Show(this, "修改成功!"); } } else { MessageBox.Show(this, "密码输入错误,请重新输入!"); } } }
public void btnSave_Click(object sender, EventArgs e) { hm.BLL.users bllUser = new hm.BLL.users(); HttpCookie cookie = Request.Cookies["userId"]; if (null == cookie) { Response.Write("<script language=javascript>window.parent.location='../Login.aspx';</script>");// } else { Model.web_site model = bll.GetModelList("")[0]; model.webName = txtWebName.Text; model.title = txtWebTitle.Text; model.keywords = txtKeywords.Text; model.description = txtDes.Text; model.bottom = txtBottom.Text; model.qq = txtQQ.Text; model.logo = image1.ImageUrl; if (flLogo.HasFile) { string msg = Common.CommonHelper.Imageupload(flLogo, "logo"); if (msg.IndexOf('|') < 0) { MessageBox.Show(this, msg); return; } if (msg.Split('|')[0].Equals("1")) { model.logo = msg.Split('|')[1]; } } bll.Update(model); MessageBox.Show(this, "保存成功!"); } }
protected void btnSave_Click(object sender, EventArgs e) { hm.BLL.users bll = new hm.BLL.users(); string strErr = ""; if (this.txtuserName.Text.Trim().Length == 0) { strErr += "用户名不能为空!\\n"; } if (this.txtTrueName.Text.Trim().Length == 0) { strErr += "用户名不能为空!\\n"; } if (this.txtpassword.Text.Trim().Length == 0) { strErr += "密码不能为空!\\n"; } if (this.ddrPlace.SelectedValue == "0") { strErr += "请选择所属区域!\\n"; } if (this.ddrRole.SelectedValue == "0") { strErr += "请选择角色!\\n"; } if (bll.GetList("userName='******'").Tables[0].Rows.Count > 0) { strErr += "用户名重复!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string userName = this.txtuserName.Text; string password = this.txtpassword.Text; string trueName = this.txtTrueName.Text; int placeId = int.Parse(this.ddrPlace.SelectedValue); string placeName = this.ddrPlace.Items[ddrPlace.SelectedIndex].Text.Replace("┣", "").Replace("╍", "").Replace("?", ""); int roleId = int.Parse(this.ddrRole.SelectedValue); string roleName = this.ddrRole.Items[ddrRole.SelectedIndex].Text; int sex = int.Parse(this.rblSex.SelectedValue); string tel = this.txttel.Text; string email = this.txtemail.Text; string qq = this.txtqq.Text; DateTime addTime = DateTime.Now; DateTime lastLoginTime = DateTime.Now; int status = int.Parse(this.ddrStatus.SelectedValue); hm.Model.users model = new hm.Model.users(); model.userName = userName; model.password = Maticsoft.Common.DEncrypt.DESEncrypt.Encrypt(password, ConfigHelper.GetConfigString("PassWordEncrypt")); model.trueName = trueName; model.deptId = placeId; model.deptName = placeName; model.roleId = roleId; model.roleName = roleName; model.sex = sex; model.tel = tel; model.email = email; model.qq = qq; model.addTime = addTime; model.lastLoginTime = lastLoginTime; model.status = status; //model.address = txtAddress.Text; if (this.ddrRole.Items[ddrRole.SelectedIndex].Text.Equals("管理员")) { model.isAdmin = 1; } model.score = 0; bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["act"] == null) { if (Request.QueryString["userId"] == null) { MessageBox.ShowAndRedirect(this, "缺少参数", "/admin/users/userlist.aspx"); return; } else { string userId = Request.QueryString["userId"].ToString(); if (bll.GetList("userId=" + userId).Tables[0].Rows.Count > 0) { MessageBox.ShowAndRedirect(this, "此用户已经开通过店铺!", "/admin/users/userlist.aspx"); return; } hm.BLL.users ubll = new hm.BLL.users(); if (ubll.GetList("userId=" + userId).Tables[0].Rows.Count == 0) { MessageBox.ShowAndRedirect(this, "无此用户!", "/admin/users/userlist.aspx"); return; } } BLL.sysItem catBll = new BLL.sysItem(); ddrCat.DataTextField = "itemName"; ddrCat.DataValueField = "siId"; ddrCat.DataSource = ClassHelper.GetSystemItem(StatusHelpercs.Default_Item_StoreType); ddrCat.DataBind(); ddrCat.Items.Insert(0, new ListItem("请选择", "0")); provinceHtml = ClassHelper.getProvinceOptions(); } } if (RequsetAjax("showCity")) { // try { string code = Request.Form["code"].ToString(); string result = ClassHelper.getCityOptions(code); Response.Write("{\"status\":1,\"result\":\"" + result + "\"}"); } catch { Response.Write("{\"status\":0,\"msg\":\"失败!\"}"); } Response.End(); } if (RequsetAjax("showDistinct")) { // try { string code = Request.Form["code"].ToString(); string result = ClassHelper.getDistinceOptions(code); Response.Write("{\"status\":1,\"result\":\"" + result + "\"}"); } catch { Response.Write("{\"status\":0,\"msg\":\"失败!\"}"); } Response.End(); } }
protected void btnSave_Click(object sender, EventArgs e) { hm.BLL.users bll = new hm.BLL.users(); string strErr=""; if(this.txtuserName.Text.Trim().Length==0) { strErr+="用户名不能为空!\\n"; } if (this.txtTrueName.Text.Trim().Length == 0) { strErr += "用户名不能为空!\\n"; } if(this.txtpassword.Text.Trim().Length==0) { strErr+="密码不能为空!\\n"; } if (this.ddrPlace.SelectedValue == "0") { strErr += "请选择所属区域!\\n"; } if (this.ddrRole.SelectedValue == "0") { strErr += "请选择角色!\\n"; } if (bll.GetList("userName='******'").Tables[0].Rows.Count > 0) { strErr += "用户名重复!\\n"; } if(strErr!="") { MessageBox.Show(this,strErr); return; } string userName=this.txtuserName.Text; string password=this.txtpassword.Text; string trueName = this.txtTrueName.Text; int placeId = int.Parse(this.ddrPlace.SelectedValue); string placeName = this.ddrPlace.Items[ddrPlace.SelectedIndex].Text.Replace("┣", "").Replace("╍", "").Replace("?", ""); int roleId = int.Parse(this.ddrRole.SelectedValue); string roleName = this.ddrRole.Items[ddrRole.SelectedIndex].Text; int sex=int.Parse(this.rblSex.SelectedValue); string tel = this.txttel.Text; string email=this.txtemail.Text; string qq=this.txtqq.Text; DateTime addTime = DateTime.Now; DateTime lastLoginTime = DateTime.Now; int status = StatusHelpercs.User_Status_Normal; hm.Model.users model=new hm.Model.users(); model.userName=userName; model.password = Maticsoft.Common.DEncrypt.DESEncrypt.Encrypt(password, ConfigHelper.GetConfigString("PassWordEncrypt")); model.trueName = trueName; model.deptId = placeId; model.deptName = placeName; model.roleId=roleId; model.roleName=roleName; model.sex=sex; model.tel=tel; model.email=email; model.qq=qq; model.addTime=addTime; model.lastLoginTime=lastLoginTime; model.status=status; //model.address = txtAddress.Text; if (this.ddrRole.Items[ddrRole.SelectedIndex].Text.Equals("管理员")) { model.isAdmin = 1; } model.score = 0; bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功!","add.aspx"); }
public void btnSave_Click(object sender, EventArgs e) { hm.BLL.users bll = new hm.BLL.users(); string strErr=""; if (this.txtuserName.Text.Trim().Length == 0) { strErr += "用户名不能为空!\\n"; } if (this.txtTrueName.Text.Trim().Length == 0) { strErr += "真实姓名不能为空!\\n"; } if (this.ddrPlace.SelectedValue == "0") { strErr += "请选择所属区域!\\n"; } if (this.ddrRole.SelectedValue == "0") { strErr += "请选择角色!\\n"; } if(strErr!="") { MessageBox.Show(this,strErr); return; } int userId=int.Parse(this.lbluserId.Text); string userName = this.txtuserName.Text; string trueName = this.txtTrueName.Text; int placeId = int.Parse(this.ddrPlace.SelectedValue); string placeName = this.ddrPlace.Items[ddrPlace.SelectedIndex].Text; int roleId = int.Parse(this.ddrRole.SelectedValue); string roleName = this.ddrRole.Items[ddrRole.SelectedIndex].Text; int sex = int.Parse(this.rblSex.SelectedValue); string tel = this.txtuserName.Text; string email = this.txtemail.Text; string qq = this.txtqq.Text; int status = int.Parse(this.ddrStatus.SelectedValue); string password = Maticsoft.Common.DEncrypt.DESEncrypt.Encrypt(txtpassword.Text, ConfigHelper.GetConfigString("PassWordEncrypt")); hm.Model.users model = bll.GetModel(userId); model.userName=userName; model.trueName = trueName; model.deptId = placeId; model.deptName = placeName; model.roleId=roleId; model.roleName=roleName; model.sex=sex; model.tel=tel; model.email=email; model.qq=qq; model.status=status; model.tel = txttel.Text; model.password = password; bll.Update(model); string backurl = "list"; if (Request.Params["backurl"] != null && Request.Params["backurl"].Trim() != "") { backurl = Request.Params["backurl"].ToString(); } Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", backurl + ".aspx"); }
private void ShowInfo(int userId) { hm.BLL.users bll=new hm.BLL.users(); hm.Model.users model=bll.GetModel(userId); this.lbluserId.Text=model.userId.ToString(); this.txtuserName.Text=model.userName; this.txtTrueName.Text = model.trueName; ddrRole.SelectedValue = model.roleId.ToString(); rblSex.SelectedValue = model.sex.ToString(); this.txtemail.Text=model.email; this.txtqq.Text=model.qq; ddrStatus.SelectedValue = model.status.ToString(); ddrPlace.SelectedValue = model.deptId.Value.ToString(); txttel.Text = model.tel; txtpassword.Text = Maticsoft.Common.DEncrypt.DESEncrypt.Decrypt(model.password, ConfigHelper.GetConfigString("PassWordEncrypt")); }