Ejemplo n.º 1
0
 private void simpleButton1_KeyPress(object sender, KeyPressEventArgs e)
 {
     if ((Keys)e.KeyChar == Keys.Enter)
     {
         string user = txtuserName.Text.ToString();
         string pass = txtPassWord.Text.ToString();
         Console.WriteLine(user + " " + pass);
         int login = BUS_QuanLyTaiKhoan.KiemTraLogin(user, pass);
         if (login == 0)
         {
             taiKhoan = BUS_QuanLyTaiKhoan.GetTaiKhoan(user, pass);
             nhanVien = BUS_NhanVien.GetNhanVien(taiKhoan.Cmnd);
             this.Hide();
             frmTrangChuQuanLy f = new frmTrangChuQuanLy(taiKhoan, nhanVien);
             f.Show();
         }
         else if (login == 1)
         {
             MessageBox.Show("Tên user không chính xác", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         else if (login == 2)
         {
             MessageBox.Show("Mật khẩu không chính xác", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         else
         {
             MessageBox.Show("Tài khoản đã bị block bởi admin");
         }
     }
 }
Ejemplo n.º 2
0
 public MuaHang(DTO_ThongTinTaiKhoan tk, DTO_NhanVienQuanLy nv)
 {
     InitializeComponent();
     this.taiKhoan = tk;
     this.nhanVien = nv;
     Load();
 }
Ejemplo n.º 3
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            string user = txtuserName.Text.ToString();
            string pass = txtPassWord.Text.ToString();

            Console.WriteLine(user + " " + pass);
            int login = BUS_QuanLyTaiKhoan.KiemTraLogin(user, pass);

            if (login == 0)
            {
                taiKhoan = BUS_QuanLyTaiKhoan.GetTaiKhoan(user, pass);
                nhanVien = BUS_NhanVien.GetNhanVien(taiKhoan.Cmnd);
                this.Hide();
                TrangChuQuanLy f = new TrangChuQuanLy(taiKhoan, nhanVien);
                f.Show();
            }
            else if (login == 1)
            {
                MessageBox.Show("Tên user không chính xác");
            }
            else if (login == 2)
            {
                MessageBox.Show("Mật khẩu không chính xác");
            }
            else
            {
                MessageBox.Show("Tài khoản đã bị block bởi admin");
            }
        }
Ejemplo n.º 4
0
        public PhieuXuat(DataTable Tb, DTO_ThongTinTaiKhoan tk, DTO_NhanVienQuanLy nv)
        {
            InitializeComponent();
            this.tb  = Tb;
            taiKhoan = tk;
            nhanVien = nv;

            Load();
        }
Ejemplo n.º 5
0
 public MoRongDaiLy(DTO_ThongTinTaiKhoan tk,DTO_NhanVienQuanLy nv)
 {
     InitializeComponent();
     this.taiKhoan = tk;
     this.nhanVien = nv;
     ThemLoaiDaiLy q = new ThemLoaiDaiLy(taiKhoan, nhanVien);
     pnlMoRong.Controls.Clear();
     pnlMoRong.Controls.Add(q);
     q.Show();
 }
Ejemplo n.º 6
0
        public frmTrangChuQuanLy(DTO_ThongTinTaiKhoan tk, DTO_NhanVienQuanLy nv)
        {
            InitializeComponent();
            //this.FormBorderStyle = FormBorderStyle.None;
            this.WindowState = FormWindowState.Maximized;
            btnBack.Visible  = false;
            rbTrangChu.AutoHideEmptyItems = true;

            taiKhoan = tk;
            nhanVien = nv;
        }
Ejemplo n.º 7
0
        public Admin(DTO_ThongTinTaiKhoan tk, DTO_NhanVienQuanLy nv)
        {
            InitializeComponent();
            this.taiKhoan = tk;
            this.nhanVien = nv;
            DoiMatKhau mk = new DoiMatKhau(taiKhoan, nhanVien);

            pnlAmin.Controls.Clear();
            pnlAmin.Controls.Add(mk);
            mk.Show();
        }
Ejemplo n.º 8
0
        public static DTO_NhanVienQuanLy GetNhanVien(string cmnd)
        {
            string    query    = "select * from NhanVienQL where CMND='" + cmnd + "'";
            DataTable dt       = ResultQuery.GetTableResult(conn, query);
            DataRow   r        = dt.Rows[0];
            string    ten      = r["TenNV"].ToString();
            DateTime  ngaySinh = Convert.ToDateTime(r["NgaySinh"]);

            string queQuan = r["QueQuan"].ToString();
            string sdt     = r["SDT"].ToString();

            DTO_NhanVienQuanLy tk = new DTO_NhanVienQuanLy(cmnd, ten, ngaySinh, queQuan, sdt);

            return(tk);
        }
Ejemplo n.º 9
0
        public QuanLyDaiLy(DTO_ThongTinTaiKhoan tk, DTO_NhanVienQuanLy nv)
        {
            InitializeComponent();

            taiKhoan = tk;
            nhanVien = nv;
            tb.Columns.Add("IdDL", typeof(int));
            tb.Columns.Add("IdLoaiDL", typeof(int));
            tb.Columns.Add("IdQuan", typeof(int));
            tb.Columns.Add("Tên đại lý", typeof(string));
            tb.Columns.Add("Loại đại lý", typeof(string));
            tb.Columns.Add("Số điện thoại", typeof(string));
            tb.Columns.Add("Quận", typeof(string));
            tb.Columns.Add("Ngày tiếp nhận", typeof(string));
            tb.Columns.Add("Người tiếp nhận", typeof(string));
            tb.Columns.Add("Tiền nợ", typeof(string));
            tb.Columns.Add("Địa chỉ", typeof(string));
            Load();
        }
Ejemplo n.º 10
0
 public DangKyTaiKhoancs(DTO_ThongTinTaiKhoan tk, DTO_NhanVienQuanLy nv)
 {
     InitializeComponent();
     this.taiKhoan = tk;
     this.nhanVien = nv;
 }
Ejemplo n.º 11
0
 public QuanLyMatHang(DTO_ThongTinTaiKhoan tk, DTO_NhanVienQuanLy nv)
 {
     InitializeComponent();
     Load();
 }