private void dgnotasV_SelectionChanged(object sender, SelectionChangedEventArgs e) { Enable(true); notasvalores = new NotasValores(); notasvalores = dgnotasV.SelectedItem as NotasValores; if (notasvalores != null) { cb1TV.Text = notasvalores.Primer_Trimestre; cb2TV.Text = notasvalores.Segundo_Trimestre; cb3TV.Text = notasvalores.Tercer_Trimestre; cbValores.SelectedValue = notasvalores.ValoresId; } }
// FINALIZA LA PROGRAMACION DE NOTAS //INICIA LA PROGMACION DE NOTAS VALORES private void btnGuardarnotasvalores_Click(object sender, RoutedEventArgs e) { if (cb1TV.Text != "") { NotasValores _valor = new NotasValores(); _valor.Primer_Trimestre = cb1TV.Text; _valor.Segundo_Trimestre = cb2TV.Text; _valor.Tercer_Trimestre = cb3TV.Text; _valor.MatriculaId = id; _valor.ValoresId = Convert.ToInt64(cbValores.SelectedValue); notasvaloresBL.Create(_valor); UpdateGrid(); Enable(false); } else { MessageBox.Show("Los campos son obligatorios", "Guardar", MessageBoxButton.OK, MessageBoxImage.Error); } }
public void Delete(NotasValores pnotasValores) { uow.NotasValoresRepository.Delete(pnotasValores); uow.SaveChanges(); }