Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Session["User"].Equals(""))
     {
         TaiKhoan    tkUs       = new TaiKhoan();
         TaiKhoanBUL tkBUL      = new TaiKhoanBUL();
         int         maNhanDuoc = int.Parse(Convert.ToString(Session["User"]));
         tkUs                   = tkBUL.getUserInfo(maNhanDuoc);
         HyperLink2.Text        = "Xin chào: " + tkUs.TenTaiKhoan;
         HyperLink2.NavigateUrl = "Profile.aspx?Id=" + maNhanDuoc;
     }
 }
Exemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["Status"] != "")
     {
         TaiKhoan    tkUs       = new TaiKhoan();
         TaiKhoanBUL tkBUL      = new TaiKhoanBUL();
         int         maNhanDuoc = int.Parse(Session["Status"].ToString());
         tkUs       = tkBUL.getUserInfo(maNhanDuoc);
         lbTen.Text = tkUs.TenTaiKhoan;
     }
     else
     {
         Response.Redirect("Login.aspx");
     }
 }
Exemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     param = int.Parse(Request.QueryString["Id"].ToString());
     if (Request.QueryString["Action"].ToString().Equals("Edit"))
     {
         //load usercontrol
         instance = Page.LoadControl("EditForm.ascx");
         Panel1.Controls.Add(instance);
     }
     else
     {
         TaiKhoanBUL tkDel = new TaiKhoanBUL();
         tkDel.del(param);
         Response.Redirect("Admin_Account.aspx");
     }
 }
Exemplo n.º 4
0
        protected void Button1_Click1(object sender, EventArgs e)
        {
            TaiKhoanBUL tkBUL = new TaiKhoanBUL();

            if (tkBUL.KiemTraUser(txtUser.Text, txtPass.Text) == true)
            {
                Response.Write("<script>alert('Đăng nhập thành công!')</script>");
                int ma = tkBUL.getMa();
                Session["User"] = ma.ToString();
                Response.Redirect("Index.aspx");
            }
            else
            {
                string err = tkBUL.getNotification();
                Response.Write("<script>alert('" + err + "')</script>");
            }
        }
Exemplo n.º 5
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            TaiKhoan taiKhoanThem = new TaiKhoan();

            taiKhoanThem.MaTaiKhoan  = int.Parse(txtMa.Text);
            taiKhoanThem.TenTaiKhoan = txtTen.Text;
            taiKhoanThem.MatKhau     = txtPass.Text;
            taiKhoanThem.QuyenHan    = txtRole.Text;
            taiKhoanThem.TrangThai   = drStt.SelectedValue;

            TaiKhoanBUL tkBULThem = new TaiKhoanBUL();

            if (tkBULThem.themUser(taiKhoanThem) == true)
            {
                Response.Write("Thêm thành công!");
                Response.Redirect("Dasboard.aspx");
            }
            else
            {
                Response.Write("Lỗi không thêm được!");
            }
        }
Exemplo n.º 6
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            string      result   = "";
            TaiKhoan    taiKhoan = new TaiKhoan();
            TaiKhoanBUL tkBUL    = new TaiKhoanBUL();

            taiKhoan.TenTaiKhoan = txtUser.Text;
            taiKhoan.MatKhau     = txtPassword.Text;

            if (tkBUL.KiemTraDangNhap(taiKhoan.TenTaiKhoan, taiKhoan.MatKhau) == true)
            {
                lbResult.Text     = "Đăng nhập thành công!";
                lbScript.Text     = "<script>$('.alert').removeClass('hidden')</script>";
                Session["Status"] = tkBUL.getMa().ToString();
                Response.Redirect("Dasboard.aspx");
            }
            else
            {
                Session["Status"] = "";
                result            = tkBUL.getNotification();
                lbResult.Text     = result;
                lbScript.Text     = "<script>$('.alert').removeClass('hidden')</script>";
            }
        }