private void dataGridRendicionComisiones_CellContentClick(object sender, DataGridViewCellEventArgs e) { EmpresaPorFacturarDTO empresaPorFacturar = (EmpresaPorFacturarDTO)dataGridRendicionComisiones.CurrentRow.DataBoundItem; if (empresaPorFacturar.CantidadPublicaciones == 0) { MessageBox.Show("La Empresa elegida, no tiene publicaciones con compras sin rendir."); return; } if (e.ColumnIndex == dataGridRendicionComisiones.Columns.IndexOf(this.columnFacturar)) { Form publicacionesEmpresa = new PublicacionesDeEmpresa(empresaPorFacturar.Id); publicacionesEmpresa.ShowDialog(); btnActualizar_Click(null, null); } }
private List <EmpresaPorFacturarDTO> FromRowsToEmpresasToCheckIn(DataTable table) { List <EmpresaPorFacturarDTO> empresasToCheckIn = new List <EmpresaPorFacturarDTO>(); foreach (DataRow row in table.Rows) { EmpresaPorFacturarDTO empresaToCheckIn = new EmpresaPorFacturarDTO(); empresaToCheckIn.Id = GetValueOrNull <int>(row["Emp_Usuario"]); empresaToCheckIn.RazonSocial = GetValueOrNull <String>(row["Emp_Razon_Social"]); empresaToCheckIn.Cuit = GetValueOrNull <String>(row["Emp_Cuit"]); empresaToCheckIn.Ciudad = GetValueOrNull <String>(row["Emp_Ciudad"]); empresaToCheckIn.Localidad = GetValueOrNull <String>(row["Emp_Localidad"]); empresaToCheckIn.Direccion = GetValueOrNull <String>(row["Emp_Direccion"]); empresaToCheckIn.NroPiso = GetValueOrNull <decimal?>(row["Emp_Piso"]); empresaToCheckIn.Depto = GetValueOrNull <String>(row["Emp_Depto"]); empresaToCheckIn.MontoPorFacturar = GetValueOrNull <decimal?>(row["Monto Total Por Facturar"]); empresaToCheckIn.CantidadPublicaciones = GetValueOrNull <int>(row["Cantidad Publicaciones"]); empresasToCheckIn.Add(empresaToCheckIn); } return(empresasToCheckIn); }