public void ThemLoaiBanAn() { Form_ThemLoaiBanAn openf = new Form_ThemLoaiBanAn(); openf.Mode = mode; if (openf.ShowDialog() == DialogResult.OK) { LoaiBanAn_BUS.ThemLoaiBanAn(openf.LoaiBA); gridLoaiBA.DataSource = LoaiBanAn_BUS.DocLoaiBanAn(); } }
private void UCtrlQLDanhSachBanAn_Load(object sender, EventArgs e) { gridLoaiBA.DataSource = LoaiBanAn_BUS.DocLoaiBanAn(); gridKhuVuc.DataSource = KhuVuc_BUS.DocKhuVuc(); gridBanAn.DataSource = BanAn_BUS.DocBanAn(maNH); DataTable dt = LoaiBanAn_BUS.DocLoaiBanAn(); if (dt.Rows.Count > 0) { ArrayMaBan = new string[dt.Rows.Count]; for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = dt.Rows[i]; ArrayMaBan[i] = dr[0].ToString();; } } }
private void Form_ThemBanAn_Load(object sender, EventArgs e) { cbbKhuVuc.Properties.Items.Clear(); DataTable dt = KhuVuc_BUS.DocKhuVuc(); if (dt.Rows.Count > 0) { ArrayMaKV = new int[dt.Rows.Count]; for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = dt.Rows[i]; cbbKhuVuc.Properties.Items.Add(dr[1]); ArrayMaKV[i] = (int)dr[0]; } } // cbbNhaHang.Properties.Items.Clear(); //DataTable dt1 = KhuVuc_BUS.LayNhaHang(); //if (dt.Rows.Count > 0) //{ // ArrayMaNH = new string[dt1.Rows.Count]; // for (int i = 0; i < dt1.Rows.Count; i++) // { // DataRow dr = dt1.Rows[i]; // cbbNhaHang.Properties.Items.Add(dr[1]); // ArrayMaNH[i] = dr[0].ToString(); // } //} cbbSucChua.Properties.Items.Clear(); DataTable dt2 = LoaiBanAn_BUS.DocLoaiBanAn(); if (dt.Rows.Count > 0) { ArrayLoaiBan = new string[dt2.Rows.Count]; for (int i = 0; i < dt2.Rows.Count; i++) { DataRow dr = dt2.Rows[i]; cbbSucChua.Properties.Items.Add(dr[1]); ArrayLoaiBan[i] = dr[0].ToString(); } } }
private void btnXoaLoaiBA_Click(object sender, EventArgs e) { XoaLoaiBanAn(); gridLoaiBA.DataSource = LoaiBanAn_BUS.DocLoaiBanAn(); }