Exemple #1
0
 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("更新成功!");
     }
 }
Exemple #2
0
 /// <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;
 }
Exemple #3
0
 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);
         }
     }
 }
Exemple #4
0
 /// <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);
 }
Exemple #5
0
 /// <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);
 }