예제 #1
0
 public Form_SanPham(string masp, Form_Admin2 grandparent, int x)
 {
     this.grandparent = grandparent;
     InitializeComponent();
     this._masp = masp;
     c          = 1;
 }
예제 #2
0
        //
        //Các hàm đặc biệt
        //

        private void do_Login()
        {
            if (Account.Instance.Login(txtUsername.Text, txtPass.Text) > 0 && Account.Instance.CheckType(txtUsername.Text) == false)
            {
                Account.Instance.userName = txtUsername.Text;
                Account.Instance.passWord = txtPass.Text;
                this.parent.lblName.Text  = "Xin chào " + Account.Instance.userName;
                this.parent.ThongTinGioHang();
                Account.Instance.numberNotify =
                    Data.Instance.CheckThongBao("thongbaoxacnhan_xem", false);

                this.Close();
            }
            else if (Account.Instance.Login(txtUsername.Text, txtPass.Text) > 0 && Account.Instance.CheckType(txtUsername.Text) == true)
            {
                Account.Instance.userName = txtUsername.Text;
                Account.Instance.passWord = txtPass.Text;
                this.Hide();
                Form_Admin2 f = new Form_Admin2();
                this.parent.Hide();
                f.ShowDialog();
                this.parent.Show();
                this.Show();
                this.txtPass.Text = "";
            }
            else
            {
                lblErrorLogin.Visible = true;;
            }
        }