private Inscripcion LlenaClase() { Inscripcion inscripcion = new Inscripcion(); inscripcion.InscripcionId = Convert.ToInt32(IdNumericUpDown.Value); inscripcion.Fecha = FechaDateTimePicker.Value; inscripcion.EstudianteId = Convert.ToInt32(EstudianteComboBox.SelectedValue); inscripcion.Monto = Convert.ToInt32(MontoTextBox.Text); foreach (DataGridViewRow item in DetalleDataGridView.Rows) { inscripcion.AgregarDetalle( Convert.ToInt32(item.Cells["Id"].Value), Convert.ToInt32(item.Cells["InscripcionId"].Value), Convert.ToInt32(item.Cells["AsignaturaId"].Value), item.Cells["Descripcion"].Value.ToString(), Convert.ToInt32(item.Cells["PrecioCredito"].Value), Convert.ToInt32(item.Cells["Monto"].Value) ); } return(inscripcion); }