// ---------- DoanhThu


        private void fAdmin_FormClosing(object sender, FormClosingEventArgs e)
        {
            // Đức thêm đoạn code load lại bàn và các món ăn khi tắt form Admin
            fQuanLyDatMon f = new fQuanLyDatMon();

            f.LoadTable();
        }
Example #2
0
        private void btnDangNhap_Click(object sender, EventArgs e)
        {
            /*
             * if (txtTaiKhoan.Text=="" || txtMatKhau.Text=="")
             * {
             *  MessageBox.Show("Tài khoản và mật khẩu là bắt buộc", "Cảnh báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             * } else if (txtTaiKhoan.Text == "admin" && txtMatKhau.Text == "123456")
             * {
             *  MessageBox.Show("Đăng nhập thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
             *  fTableManager fTableManager = new fTableManager();
             *  this.Hide();
             *  fTableManager.ShowDialog();
             *  this.Show();
             * } else
             * {
             *  MessageBox.Show("Sai tài khoản hoặc mật khẩu", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             * }
             */
            string username = txtTaiKhoan.Text;
            string password = txtMatKhau.Text;

            if (Login(username, password))
            {
                Account       loginAccount  = aDAL.GetAccountByUserName(username);
                fQuanLyDatMon fTableManager = new fQuanLyDatMon(loginAccount);
                this.Hide();
                fTableManager.ShowDialog();
                this.Show();
            }
        }
Example #3
0
        private void btnDangNhap_Click(object sender, EventArgs e)
        {
            /*
             * if (txtTaiKhoan.Text=="" || txtMatKhau.Text=="")
             * {
             *  MessageBox.Show("Tài khoản và mật khẩu là bắt buộc", "Cảnh báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             * } else if (txtTaiKhoan.Text == "admin" && txtMatKhau.Text == "123456")
             * {
             *  MessageBox.Show("Đăng nhập thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
             *  fTableManager fTableManager = new fTableManager();
             *  this.Hide();
             *  fTableManager.ShowDialog();
             *  this.Show();
             * } else
             * {
             *  MessageBox.Show("Sai tài khoản hoặc mật khẩu", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             * }
             */
            fQuanLyDatMon fTableManager = new fQuanLyDatMon();

            this.Hide();
            fTableManager.ShowDialog();
            this.Show();
        }