예제 #1
0
        public static void TaoTK(ArrayList list)
        {
            string tk = UserName();
            string mk = Password();

            list.Add(new DangNhap(tk, mk));
            DangNhap_DAL.GhiFile(list);
        }
예제 #2
0
        public static void TaoTK(ArrayList list)
        {
            //tạo tải khoản
            string tk = UserName();
            string mk = Password();

            //ghi tài khoản vào danh sách mảng
            list.Add(new DangNhap(tk, mk));
            //ghi tài khoản vào cơ sở dữ liệu
            DangNhap_DAL.ghiFile(list);
        }
예제 #3
0
        private void frmKhachHang_Load(object sender, EventArgs e)
        {
            DangNhap_DAL dn = new DangNhap_DAL();

            if (dn.MaNhomPer(DangNhap_DAL.UserName))
            {
                pnControl.Enabled = true;
            }
            else
            {
                pnControl.Enabled = false;
            }
            dataGridViewKH.DataSource = kh.LoadDLKhachHang();
        }
예제 #4
0
        private void frmNhaSanXuat_Load(object sender, EventArgs e)
        {
            DangNhap_DAL dn = new DangNhap_DAL();

            if (dn.MaNhomPer(DangNhap_DAL.UserName))
            {
                pnControl.Enabled = true;
            }
            else
            {
                pnControl.Enabled = false;
            }
            dataGridViewNSX.DataSource = nsx.LoadDLNSX();
        }
예제 #5
0
        private void frmLoaiSanPham_Load(object sender, EventArgs e)
        {
            DangNhap_DAL dn = new DangNhap_DAL();

            if (dn.MaNhomPer(DangNhap_DAL.UserName))
            {
                pnControl.Enabled = true;
            }
            else
            {
                pnControl.Enabled = false;
            }
            dataLoaiSP.DataSource = qlkho.LoadDLLoaiSP();
        }
예제 #6
0
        private void frmNhaCungCap_Load(object sender, EventArgs e)
        {
            DangNhap_DAL dn = new DangNhap_DAL();

            if (dn.MaNhomPer(DangNhap_DAL.UserName))
            {
                pnControl.Enabled = true;
            }
            else
            {
                pnControl.Enabled = false;
            }
            dataGridViewNCC.DataSource = ncc.LoadDLNCC();
            //LoadSTTDataGirdView();
        }
예제 #7
0
        public static bool DangNhap(ArrayList list)
        {
            bool kt = false;

            DangNhap_DAL.DocFile(list);
            string tk = UserName();
            string mk = Password();

            foreach (DangNhap dangnhap in list)
            {
                if (tk.Equals(dangnhap.User) && mk.Equals(dangnhap.Password))
                {
                    kt = true;
                }
            }
            return(kt);
        }
예제 #8
0
        public static void Chon(ArrayList arrayList)
        {
            int chon;

            while (true)
            {
                Menu();
                chon = int.Parse(Console.ReadLine());
                Console.Clear();
                if (chon == 3)
                {
                    break;
                }
                switch (chon)
                {
                case 1:
                    bool kt = true;
                    if (kt == Login.DangNhap(arrayList))
                    {
                        Console.WriteLine("Đăng nhập thành công");
                        //menu main
                        RunProgram.Run();
                    }
                    else
                    {
                        Console.WriteLine("Đăng nhập thất bại");
                    }
                    Console.ReadKey();
                    Console.Clear();
                    break;

                case 2:
                    Login.TaoTK(arrayList);
                    DangNhap_DAL.GhiFile(arrayList);
                    Console.Clear();
                    break;

                default: break;
                }
            }
        }
예제 #9
0
 public static string LayMaQuyenHan(string maCanLay) => DangNhap_DAL.LayMaQuyenHan(maCanLay);
예제 #10
0
 public static string DoiMatKhau(string maNV, string tendangnhap, string matkhau) => DangNhap_DAL.DoiMatKhau(maNV, tendangnhap, matkhau);
예제 #11
0
 public static string LayTenDangNhap_MatKhau(string tendangnhap, string matkhau) => DangNhap_DAL.LayTenDangNhap_MatKhau(tendangnhap, matkhau);