private void dataGridViewX1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            DataGridViewRow row = dataGridViewX1.Rows[e.RowIndex];

            txtMadaily.Text         = row.Cells["Madaily"].Value.ToString();
            txtTendailybuudien.Text = row.Cells["Tendaily"].Value.ToString();
            txtDiachi.Text          = row.Cells["diachi"].Value.ToString();
            cmbHuyen.Text           = row.Cells["tenhuyen"].Value.ToString();
            cmbthuebao.Text         = row.Cells["tenthuebao"].Value.ToString();
            txtsohieu.Text          = row.Cells["sohieu"].Value.ToString();
            txtMadoanhnghiep.Text   = row.Cells["madoanhnghiep"].Value.ToString();

            lbDoanhnghiep.Text = row.Cells["tendoanhnghiep"].Value.ToString();
            QL_DoanhNghiep_InFo dn = prodoanhnghiep.timdoanhnghiep_baocao(lbDoanhnghiep.Text);

            lbDiachi.Text    = dn.DiaChi;
            lbDienthoai.Text = dn.DienThoai;
            lbEmail.Text     = dn.Email;
            lbFax.Text       = dn.Fax;
            lbTrangweb.Text  = dn.TrangWeb;

            txtdienthoai.Text = row.Cells["dienthoai"].Value.ToString();
            txtGhichu.Text    = row.Cells["ghichu"].Value.ToString();
            cmbXa.Text        = row.Cells["xa"].Value.ToString();
        }
        private void dataGridViewX1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            DataGridViewRow row = dataGridViewX1.Rows[e.RowIndex];

            txtMadichvu.Text       = row.Cells["madichvu"].Value.ToString();
            txtTendichvu.Text      = row.Cells["tendichvu"].Value.ToString();
            txtVanban.Text         = row.Cells["vanbancongbo"].Value.ToString();
            txtTendoanhnghiep.Text = row.Cells["doanhnghiep"].Value.ToString();
            txtMadoanhnghiep.Text  = row.Cells["madoanhnghiep"].Value.ToString();
            cmbTieuchuan.Text      = row.Cells["tieuchuanchatluong"].Value.ToString();

            if (row.Cells["thuocdanhmuc"].Value.ToString() == "Có")
            {
                chkCo.Checked = true;
            }
            else
            {
                chkKhong.Checked = true;
            }

            lbDoanhnghiep.Text = row.Cells["tendoanhnghiep"].Value.ToString();
            QL_DoanhNghiep_InFo dn = prodoanhnghiep.timdoanhnghiep_baocao(lbDoanhnghiep.Text);

            lbDiachi.Text    = dn.DiaChi;
            lbDienthoai.Text = dn.DienThoai;
            lbEmail.Text     = dn.Email;
            lbFax.Text       = dn.Fax;
            lbTrangweb.Text  = dn.TrangWeb;

            txtGhichu.Text = row.Cells["ghichu"].Value.ToString();
        }
        private void dataGridViewX1_CellEnter(object sender, DataGridViewCellEventArgs e)
        {
            DataGridViewRow row = dataGridViewX1.Rows[e.RowIndex];

            if (row.Cells["maduan"].Value.ToString() == "")
            {
                tool_them.Enabled    = true;
                tool_xoa.Enabled     = true;
                tool_sua.Enabled     = true;
                tool_luu.Enabled     = false;
                tool_thoat.Visible   = true;
                tool_xemlai.Visible  = false;
                tool_sua1.Enabled    = false;
                tool_luu1.Enabled    = false;
                tool_xemlai1.Enabled = false;
                tool_them1.Enabled   = false;
                tool_xoa1.Enabled    = false;
            }
            else
            {
                txtMaduan.Text        = row.Cells["maduan"].Value.ToString();
                txtTenduan.Text       = row.Cells["tenduan"].Value.ToString();
                txtDiadiem.Text       = row.Cells["diadiem"].Value.ToString();
                txtMadoanhnghiep.Text = row.Cells["madoanhnghiep"].Value.ToString();

                lbDoanhnghiep.Text = row.Cells["tendoanhnghiep"].Value.ToString();
                QL_DoanhNghiep_InFo dn = prodoanhnghiep.timdoanhnghiep_baocao(lbDoanhnghiep.Text);
                lbDiachi.Text    = dn.DiaChi;
                lbDienthoai.Text = dn.DienThoai;
                lbEmail.Text     = dn.Email;
                lbFax.Text       = dn.Fax;
                lbTrangweb.Text  = dn.TrangWeb;

                txtThoigian.Text       = row.Cells["thoigian"].Value.ToString();
                txtNanglucthietke.Text = row.Cells["nangluc"].Value.ToString();
                txtTongvon.Text        = row.Cells["tongvon"].Value.ToString();
                txtVondautu.Text       = row.Cells["vondautu"].Value.ToString();
                txtLuykevon.Text       = row.Cells["luykevon"].Value.ToString();
                txtGhichu.Text         = row.Cells["ghichu"].Value.ToString();
                cmbLoaiduan.Text       = row.Cells["loaiduan"].Value.ToString();

                tool_them.Enabled    = true;
                tool_xoa.Enabled     = true;
                tool_sua.Enabled     = true;
                tool_luu.Enabled     = false;
                tool_thoat.Visible   = true;
                tool_xemlai.Visible  = false;
                tool_sua1.Enabled    = true;
                tool_luu1.Enabled    = false;
                tool_xemlai1.Enabled = false;
                tool_them1.Enabled   = true;
                tool_xoa1.Enabled    = true;
            }
        }
        //tim trong form bao cao
        public QL_DoanhNghiep_InFo timdoanhnghiep_baocao(string ten)
        {
            DataTable           table = data.Timdoanhnghiep_baocao(ten);
            QL_DoanhNghiep_InFo dn    = new QL_DoanhNghiep_InFo();

            if (table.Rows.Count > 0)
            {
                dn.MaDoanhNghiep  = Convert.ToInt32(table.Rows[0]["MaDoanhNghiep"]);
                dn.TenDoanhNghiep = Convert.ToString(table.Rows[0]["TenDoanhNghiep"]);
                dn.DiaChi         = Convert.ToString(table.Rows[0]["DiaChi"]);
                dn.DienThoai      = Convert.ToString(table.Rows[0]["DienThoai"]);
                dn.Email          = Convert.ToString(table.Rows[0]["Email"]);
                dn.Fax            = Convert.ToString(table.Rows[0]["Fax"]);
                dn.TrangWeb       = Convert.ToString(table.Rows[0]["TrangWeb"]);
            }
            return(dn);
        }