public void LlenarClase(Entidades.CuadresVendedorDetalles d) { Entidades.CuadresVendedores c = new CuadresVendedores(); d.Vendido = Utilidades.TOINT(VendidoTextBox.Text); d.Subsidios = Utilidades.ValidarIdEntero(SubcidioDropDownList1.SelectedValue); d.Pagos = Utilidades.ValidarIdEntero(PagosDropDownList2.SelectedValue); d.Gastos = Utilidades.ValidarIdEntero(GastosDropDownList.SelectedValue); d.Monto = Utilidades.TOINT(TextBox2.Text); d.Comision = Utilidades.TOINT(ComisionTextBox.Text); d.Pendiente = Utilidades.TOINT(PendienteTextBox.Text); d.Ganancia = Utilidades.TOINT(GananciaTextBox.Text); foreach (GridViewRow dr in GridView.Rows) { c.AgregarDetalle(Convert.ToInt16(dr.Cells[0].Text), Convert.ToInt32(dr.Cells[1].Text), Convert.ToInt32(dr.Cells[2].Text), Convert.ToInt32(dr.Cells[3].Text), Convert.ToInt32(dr.Cells[4].Text), Convert.ToInt32(dr.Cells[5].Text), Convert.ToInt32(dr.Cells[6].Text)); } }