Exemplo n.º 1
0
        private void formThongke_Click(object sender, EventArgs e)
        {
            GUI_Thongke tk = new GUI_Thongke(TK);

            this.Hide();
            tk.ShowDialog();
            this.Close();
        }
Exemplo n.º 2
0
        private void btnCancel_Click(object sender, EventArgs e)
        {
            string sTmp = "";
            bool   flg  = true;

            if (!vl.Required(txtUser.Text))
            {
                sTmp = sTmp + "Vui lòng điền tên đăng nhập!\n";
                flg  = false;
            }
            if (!vl.Required(txtPass.Text))
            {
                sTmp = sTmp + "Vui lòng điền mật khẩu!\n";
                flg  = false;
            }
            if (flg)
            {
                try
                {
                    TK = db.TAIKHOANs.Single(st => st.TENDANGNHAP.Equals(txtUser.Text) && st.MATKHAU.Equals(txtPass.Text));
                    if (TK.QUYEN.Equals("Giám đốc"))
                    {
                        GUI_Thongke tk = new GUI_Thongke(TK);
                        this.Hide();
                        tk.ShowDialog();
                        this.Close();
                    }
                    else if (TK.QUYEN.Equals("Nhân viên bán hàng"))
                    {
                        QLHD.GUI_POS sp = new QLHD.GUI_POS(TK, "Login");
                        this.Hide();
                        sp.ShowDialog();
                        this.Close();
                    }
                    else if (TK.QUYEN.Equals("Quản lý chi nhánh"))
                    {
                        QLNH.GUI_DX sp = new QLNH.GUI_DX(TK);
                        this.Hide();
                        sp.ShowDialog();
                        this.Close();
                    }
                    else if (TK.QUYEN.Equals("Nhân viên kiểm kho"))
                    {
                        QLNH.GUI_NHTS sp = new QLNH.GUI_NHTS(TK);
                        this.Hide();
                        sp.ShowDialog();
                        this.Close();
                    }
                    else if (TK.QUYEN.Equals("Thư ký"))
                    {
                        Dexuat.GUI_DX sp = new Dexuat.GUI_DX(TK);
                        this.Hide();
                        sp.ShowDialog();
                        this.Close();
                    }
                }
                catch
                {
                    MessageBox.Show("Tên đăng nhập hoặc mật khẩu không chính xác!");
                    txtPass.Text = "";
                }
            }
            else
            {
                MessageBox.Show(sTmp);
            }
        }