private void btnThemBanAn_Click(object sender, EventArgs e)
        {
            Form_ThemBanAn openf = new Form_ThemBanAn();

            openf.Mode = mode;
            if (openf.ShowDialog() == DialogResult.OK)
            {
                BanAn_BUS.ThemBanAn(openf.BanAn, maNH);
                gridBanAn.DataSource = BanAn_BUS.DocBanAn(maNH);
            }
        }
        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();;
                }
            }
        }
        public void CapNhaBanAn()
        {
            //int flag = 0;
            //int[] index = gridView_BanAn.GetSelectedRows();
            //if (index.Length > 0)
            //{

            //    string maBanAn = gridView_BanAn.GetRowCellValue(index[0], "MaBan").ToString();
            //    string maKV = gridView_BanAn.GetRowCellValue(index[0], "MaKhuVuc").ToString();
            //    string TrangThai = gridView_BanAn.GetRowCellValue(index[0], "TrangThai").ToString();
            //    if (maBanAn != null)
            //    {
            //        DTO.BanAn_DTO BanAn = new DTO.BanAn_DTO();
            //       BanAn.MaBan = int.Parse(maBanAn);
            //      // BanAn.MaKhuVuc = int.Parse(maKV);
            //      // BanAn.TrangThai = int.Parse(TrangThai);
            //        flag = BanAn_BUS.CapNhatBanAn(BanAn);
            //    }
            //}
            //if (flag != 0)
            BanAn_BUS.DocBanAn(maNH);
            DevExpress.XtraEditors.XtraMessageBox.Show("Cập nhật thành công", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
 private void btnXoaBanAn_Click(object sender, EventArgs e)
 {
     XoaBanAn();
     gridBanAn.DataSource = BanAn_BUS.DocBanAn(maNH);
 }