示例#1
0
 public void Ad()
 {
     Model.Admin admin = new Model.Admin();
     admin.adname = Request.QueryString["name"].ToString();
     BLL.AdminBLL ub = new BLL.AdminBLL();
     ub.Login(admin);
 }
示例#2
0
 public JsonResult Login(Admin admin)
 {
     info.ResultType = ResultInfo.BaseResultType.Error;
     if (Session["AdminInfo"] != null)
     {
         //跳转
         info.ResultType = ResultInfo.BaseResultType.Exists;
         info.DataObj    = "";
         info.Msg        = "已登录,请刷新页面!";
     }
     else
     {
         if (string.IsNullOrWhiteSpace(admin.Account))
         {
             info.Msg = "请输入用户名!";
         }
         else if (string.IsNullOrWhiteSpace(admin.PassWord))
         {
             info.Msg = "请输入密码!";
         }
         else if (string.IsNullOrWhiteSpace(admin.VerifyCode))
         {
             info.Msg = "请输入验证码!";
         }
         if (Session["VerifyCodeUsersLogin"] == null)
         {
             info.Msg = "服务器程序出错,请刷新页面重新登录!";
         }
         else
         {
             if (Session["VerifyCodeUsersLogin"].ToString().ToLower() != admin.VerifyCode.ToLower())
             {
                 info.Msg = "验证码输入错误!";
             }
             else
             {
                 info = bll.Login(admin);
                 if (info.ResultType == ResultInfo.BaseResultType.Success)
                 {
                     Session["AdminInfo"] = info.DataObj as Admin;
                 }
             }
         }
     }
     return(Json(info));
 }
示例#3
0
 protected void Button1_Click1(object sender, EventArgs e)
 {
     Model.Admin admin = new Model.Admin();
     admin.adname     = Request["inputAccount"].ToString().Trim();
     admin.adpassword = Request["inputPassword"].ToString().Trim();
     BLL.AdminBLL ub = new BLL.AdminBLL();
     if (ub.Login(admin))
     {
         string name;
         name = "../admin/admin.aspx?name=" + Request["inputAccount"].ToString().Trim();
         Response.Redirect(name);
     }
     else
     {
         Response.Write("<script>alert('登陆失败')</script>");
     }
 }
示例#4
0
文件: FrmLogin.cs 项目: Wriprin/Buyee
 private void button1_Click(object sender, EventArgs e)
 {
     BLL.AdminBLL objUB = new BLL.AdminBLL();
     BLL.UsersBLL objUU = new BLL.UsersBLL();
     if (objUB.Login(textBox1.Text, textBox2.Text))
     {
         LoginOk = true;
         this.Close();
     }
     else if (objUU.Login(textBox1.Text, textBox2.Text))
     {
         LoginYes = true;
         this.Close();
         //SetTxtEvent(textBox1.Text);
     }
     else
     {
         MessageBox.Show("Access Denied!");
         LoginOk = false;
     }
 }