Exemple #1
0
        private void loadDuLieu()
        {
            dgvDanhSach.Rows.Clear();
            DataTable dt = NhanVienControl.layDanhSach();

            for (int i = 0; i < dt.Rows.Count; ++i)
            {
                string date = String.Format("{0:dd/MM/yyyy}", dt.Rows[i][4]);
                dgvDanhSach.Rows.Add(new object[] { false, dt.Rows[i][0], dt.Rows[i][1], date, dt.Rows[i][2], dt.Rows[i][3], dt.Rows[i][5] });
            }
        }
Exemple #2
0
        private void loadDuLieu()
        {
            dgvDanhSach.Rows.Clear();
            DataTable dt = NhanVienControl.layDanhSach();

            lblnhanvien.Text = lblnhanvien.Text + dt.Rows.Count.ToString();

            for (int i = 0; i < dt.Rows.Count; ++i)
            {
                dgvDanhSach.Rows.Add(dt.Rows[i]["MaNV"], dt.Rows[i]["TenNV"], dt.Rows[i]["GioiTinh"], dt.Rows[i]["NgaySinh"], dt.Rows[i]["SDT"], dt.Rows[i]["Luong"]);
            }
        }
Exemple #3
0
        private void loadDSNhanVien()
        {
            DataTable       ds     = NhanVienControl.layDanhSach();
            List <NhanVien> listKM = new List <NhanVien>();

            for (int i = 0; i < ds.Rows.Count; ++i)
            {
                listKM.Add(new NhanVien
                {
                    MaNV  = Convert.ToInt32(ds.Rows[i]["MaNV"].ToString()),
                    TenNV = ds.Rows[i]["TenNV"].ToString(),
                });
            }
            cbNhanVien.DataSource    = listKM;
            cbNhanVien.DisplayMember = "TenNV";
        }
Exemple #4
0
        private void loadDSNV()
        {
            DataTable       dt   = NhanVienControl.layDanhSach();
            List <NhanVien> list = new List <NhanVien>();

            for (int i = 0; i < dt.Rows.Count; ++i)
            {
                list.Add(new NhanVien
                {
                    MaNV     = Convert.ToInt32(dt.Rows[i]["MaNV"].ToString()),
                    TenNV    = dt.Rows[i]["TenNV"].ToString(),
                    GioiTinh = dt.Rows[i]["GioiTinh"].ToString(),
                    NgaySinh = DateTime.Parse(dt.Rows[0]["NgaySinh"].ToString()),
                    SDT      = dt.Rows[0]["SDT"].ToString(),
                    Luong    = double.Parse(dt.Rows[0]["Luong"].ToString())
                });
            }
            cbNhanVien.DataSource    = list;
            cbNhanVien.DisplayMember = "TenNV";
        }