示例#1
0
        private void loadDuLieu()
        {
            dgvDanhSach.Rows.Clear();
            DataTable dt = KhachHangControl.layDanhSach();

            for (int i = 0; i < dt.Rows.Count; ++i)
            {
                dgvDanhSach.Rows.Add(new object[] { false, dt.Rows[i][0], dt.Rows[i][1], dt.Rows[i][2], dt.Rows[i][3] });
            }
        }
示例#2
0
        private void loadDuLieu()
        {
            dgvDanhSach.Rows.Clear();
            DataTable dt = KhachHangControl.layDanhSach();

            lblCountCustomer.Text = lblCountCustomer.Text + dt.Rows.Count.ToString();
            for (int i = 0; i < dt.Rows.Count; ++i)
            {
                dgvDanhSach.Rows.Add(new object[] { false, dt.Rows[i]["MaKH"], dt.Rows[i]["TenKH"], dt.Rows[i]["DiaChi"], dt.Rows[i]["SDT"] });
            }
        }
示例#3
0
        private void loadDSKH()
        {
            DataTable        dt   = KhachHangControl.layDanhSach();
            List <KhachHang> list = new List <KhachHang>();

            for (int i = 0; i < dt.Rows.Count; ++i)
            {
                list.Add(new KhachHang
                {
                    MaKH   = Convert.ToInt32(dt.Rows[i]["MaKH"].ToString()),
                    TenKH  = dt.Rows[i]["TenKH"].ToString(),
                    DiaChi = dt.Rows[0]["DiaChi"].ToString(),
                    SDT    = dt.Rows[0]["SDT"].ToString()
                });
            }
            cbKhachHang.DataSource    = list;
            cbKhachHang.DisplayMember = "TenKH";
        }