Exemplo n.º 1
0
 public bool isLogin(tb_login login)
 {
     if (ld.isLogin(login)==0)
     {
         return false;
     }
     else
     {
         return true;
     }
 }
Exemplo n.º 2
0
 public List<tb_login> selLogin()
 {
     tb_login login=null;
     string sel = "select ID,Name,LoginDate,Lock from tb_login";
     List<ArrayList> list = sqlDal.sqlDr(sel, null, null);
     List<tb_login> loginList = new List<tb_login>();
     foreach (ArrayList obj in list)
     {
         login = new tb_login();
         login.Id = (int)obj[0];
         login.Name = obj[1].ToString();
         login.LoginDate = (DateTime)obj[2];
         login._lock1 = (int)obj[3];
         loginList.Add(login);
     }
     return loginList;
 }
Exemplo n.º 3
0
 protected void btnReg_Click(object sender, EventArgs e)
 {
     tb_login login = new tb_login();
     if (txtUser.Text.Trim() != "")
     {
         if (lb.isUserName(txtUser.Text.Trim()))
         {
             login.Name = txtUser.Text;
             login.Pass = txtPsw1.Text;
             if (rdoMan.Checked)
             {
                 login.Sex = "男";
             }
             else
             {
                 login.Sex = "女";
             }
             login.PassSolution = txtSolu.Text;
             login.PassQuestion = txtQues.Text;
             login.Zname = txtTureName.Text;
             login.Idcard = txtPersonNum.Text;
             login.Email = txtMail.Text;
             if (lb.addLogin(login) > 0)
             {
                 Session["UserName"] = login.Name;
                 Response.Write("<script>alert('注册成功!');location='index.aspx'</script>");
             }
             else
             {
                 Response.Write("<script>alert('注册失败!')</script>");
             }
         }
         else
         {
             Response.Write("<script>alert('用户名已存在!');location='Registe.aspx'</script>");
         }
     }
     else
     {
         Response.Write("<script>alert('用户名不能为空!');location='Registe.aspx'</script>");
     }
 }
Exemplo n.º 4
0
 protected void btnLogin_Click(object sender, ImageClickEventArgs e)
 {
     if (txtUser.Text.Trim() != "" && txtPsw.Text.Trim()!="")
     {
         tb_login login = new tb_login();
         login.Name = txtUser.Text.Trim();
         login.Pass = txtPsw.Text.Trim();
         if (lb.isLogin(login))
         {
             Session["UserName"] = login.Name;
             Response.Redirect("Manage/manageIndex.aspx");
         }
         else
         {
             Response.Write("<script>alert('登陆失败!');location='manageLogin.aspx'</script>");
         }
     }
     else
     {
         Response.Write("<script>alert('用户名或密码不能为空!');location='manageLogin.aspx'</script>");
     }
 }
Exemplo n.º 5
0
 protected void btnLogin_Click(object sender, ImageClickEventArgs e)
 {
     tb_login login=new tb_login();
     login.Name=txtUser.Text;
     login.Pass=txtPsw.Text;
     if (txtCheckNum.Text==Session["ValidateCode"].ToString())
     {
         if (lb.isLogin(login))
         {
             Session["UserName"] = login.Name;
             Response.AddHeader("Refresh", "0");
         }
         else
         {
             Response.Write("<script>alert('用户名或密码错误!')</script>");
             Response.AddHeader("Refresh", "0");
         }
     }
     else
     {
         Response.Write("<script>alert('验证码错误!')</script>");
         Response.AddHeader("Refresh", "0");
     }
 }
Exemplo n.º 6
0
 public int addLogin(tb_login login)
 {
     return ld.addLogin(login);
 }
Exemplo n.º 7
0
 public int isLogin(tb_login login)
 {
     return (int)sqlDal.sqlOneDr("select count(*) from tb_login where convert(varchar,Name)=@Name and convert(varchar,Pass)=@Pass and Lock=0",
         new string[] { "@Name", "@Pass" },
         new string[] { login.Name, login.Pass });
 }
Exemplo n.º 8
0
 public int addLogin(tb_login login)
 {
     return sqlDal.sqlUpdate("insert into tb_login(Name,Pass,Zname,Sex,Email,IDcard,PassQuestion,PassSolution) values(@Name,@Pass,@Zname,@Sex,@Email,@IDcard,@PassQuestion,@PassSolution)",
         new string[]{"@Name","@Pass","@Zname","@Sex","@Email","@IDcard","@PassQuestion","@PassSolution"},
         new string[]{login.Name,login.Pass,login.Zname,login.Sex,login.Email,login.Idcard,login.PassQuestion,login.PassSolution});
 }