protected void btnconfirm_Click(object sender, EventArgs e) { string id = Session["id"].ToString(); cususerEntity user = new cususerEntity(); user.Id = id; user.Username = this.txtuser.Text; user.Password = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(this.txtpass.Text.Trim(),"md5"); int i = userBll.updateCusnote(user); { js("更新成功!"); } }
/// <summary> /// ��ü�¼��Ϣ�� /// </summary> /// <param name="id"></param> /// <returns></returns> public static cususerEntity getcusnoteInfo(string id) { cususerEntity note = new cususerEntity(); string sql = "select * from custom_user where id=" + id; using (SqlDataReader dr = SqlHelper.ExecuteReader(DataBll.conString.constr, CommandType.Text, sql)) { if (dr.Read()) { note.Id = dr["id"].ToString(); note.Username = dr["username"].ToString(); note.Password = dr["password"].ToString(); } } return note; }
protected void Button1_Click(object sender, EventArgs e) { if (this.txtusername.Text == "") { js("用户名不能为空!"); } else { cususerEntity user = new cususerEntity(); user.Username = this.txtusername.Text.Trim(); user.NickName = CommonLib.GetPYM(this.txtusername.Text.Trim()); user.Rid = this.droprole.SelectedItem.Value; user.Password = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(this.txtpassword.Text.Trim(), "md5"); int i = userBll.insertCusnote(user); if (i > 0) { binddata(1, pageSize); } } }
/// <summary> /// �������� /// </summary> /// <param name="note"></param> /// <returns></returns> public static int updateCusnote(cususerEntity note) { string sql = "update custom_user set username='******',password='******' where id=" + note.Id.ToString(); return SqlHelper.ExecuteNonQuery(DataBll.conString.constr, CommandType.Text, sql); }
/// <summary> ///�����¼��Ϣ /// </summary> /// <param name="note"></param> /// <returns></returns> public static int insertCusnote(cususerEntity note) { string sql = "insert into custom_user ( username,password,rid,NickName) values"; sql += "('" + note.Username + "','" + note.Password + "','" + note.Rid + "','" + note.NickName + "')"; return SqlHelper.ExecuteNonQuery(DataBll.conString.constr, CommandType.Text, sql); }