private void LoadPostInvoiceDetails() { List <PostInvoiceDetails_DTO> listInvoice = PostInvoiceDetails_BUS.LoadPostInvoiceDetails(Convert.ToInt32(txtIDBillImport.Text)); dtgvListOfDetailProductImport.DataSource = listInvoice; txtTotal.Text = Convert.ToString(dtgvInfoListOfBillImport.CurrentRow.Cells["TotalPrice"].Value); if (dtgvListOfDetailProductImport.Rows.Count != 1) { dtgvListOfDetailProductImport.Columns["TransID"].Visible = false; } }
private void dtgvInfoListOfBillImport_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex >= 0 && e.RowIndex >= 0) { txtIDBillImport.Text = Convert.ToString(dtgvInfoListOfBillImport.CurrentRow.Cells["TransID"].Value); txtVendorId.Text = Convert.ToString(dtgvInfoListOfBillImport.CurrentRow.Cells["VendorID"].Value); cmbIDAgency.Text = Convert.ToString(dtgvInfoListOfBillImport.CurrentRow.Cells["VendorName"].Value); dtpkDateTimeImport.Text = Convert.ToString(dtgvInfoListOfBillImport.CurrentRow.Cells["CreateDate"].Value); cmbIDBillImportDetail.Text = txtIDBillImport.Text; txtTotal.Text = Convert.ToString(dtgvInfoListOfBillImport.CurrentRow.Cells["TotalPrice"].Value); List <PostInvoiceDetails_DTO> listInvoice = PostInvoiceDetails_BUS.LoadPostInvoiceDetails(Convert.ToInt32(txtIDBillImport.Text)); dtgvListOfDetailProductImport.DataSource = listInvoice; if (dtgvListOfDetailProductImport.Rows.Count > 1) { dtgvListOfDetailProductImport.Columns["TransID"].Visible = false; } } }