Esempio n. 1
0
        public frmThemNhanVien(string tenTaiKhoan, string hoTen, DateTime ngaySinh, int gioiTinh, string sdt, string email, DateTime ngayVaoLam, string matKhau, int loaiTaiKhoan)
        {
            InitializeComponent();
            LoaiTaiKhoanDAL db = new LoaiTaiKhoanDAL();

            lueGioiTinh.Properties.DataSource        = db.SelectGioiTinh();
            lueGioiTinh.Properties.DisplayMember     = "Value";
            lueGioiTinh.Properties.ValueMember       = "ID";
            lueLoaiTaiKhoan.Properties.DataSource    = db.Select();
            lueLoaiTaiKhoan.Properties.DisplayMember = "TenLoai";
            lueLoaiTaiKhoan.Properties.ValueMember   = "ID";

            isUpdate                  = true;
            txtTenTaiKhoan.Text       = tenTaiKhoan;
            txtTenTaiKhoan.Enabled    = false;
            txtHoTen.Text             = hoTen;
            deNgaySinh.DateTime       = ngaySinh;
            deNgayVaoLam.DateTime     = ngayVaoLam;
            lueGioiTinh.EditValue     = gioiTinh;
            lueLoaiTaiKhoan.EditValue = loaiTaiKhoan;
            txtSDT.Text               = sdt;
            txtEmail.Text             = email;
            txtMatKhau.Text           = matKhau;
        }
        private void LoadLoaiTaiKhoan()
        {
            LoaiTaiKhoanDAL db = new LoaiTaiKhoanDAL();

            gcLoaiTK.DataSource = db.Select();
        }