private void GetStudentActualInscription() { using (SCPPContext context = new SCPPContext()) { inscription = context.Inscripción.FirstOrDefault(i => i.Matriculaestudiante == student.Matricula && i.Estatus.Equals("Cursando")); } }
public void TestInitialize() { testInscription = new Inscripción { Estatus = "TestSolo", Fecha = thisDay, Periodo = "FEB2021 - JUL2021", Tipo = "Example 1", }; testInscriptionList = new List <Inscripción>() { new Inscripción { Estatus = "Test", Fecha = thisDay, Periodo = "FEB2021 - JUL2021", Tipo = "Example 2", }, new Inscripción { Estatus = "Test", Fecha = thisDay, Periodo = "FEB2021 - JUL2021", Tipo = "Example 3", } }; }
private void InscriptionsList_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { DataGrid dataGrid = sender as DataGrid; inscriptionSelected = (Inscripción)dataGrid.SelectedItems[0]; CheckSelecctions(); } catch (ArgumentOutOfRangeException) { inscriptionSelected = null; } }
private void InscriptionList_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { DataGrid dataGrid = sender as DataGrid; inscriptionSelected = (Inscripción)dataGrid.SelectedItems[0]; if (inscriptionSelected != null) { GetExpedientButton.IsEnabled = true; } } catch (ArgumentOutOfRangeException) { // Catch necesario al seleccionar de la tabla y dar clic en registrar } }
public GestionarExpediente(Inscripción inscription) { try { pageIsLoad = false; InitializeComponent(); this.inscription = inscription; FillTextBoxes(); GetSesion(); ChangeComponentsVisibility(); GetDocuments(); Loaded += GestionarExpediente_Loaded; } catch (EntityException) { Restarter.RestarSCPP(); } }
private void AssignButton_Click(object sender, System.Windows.RoutedEventArgs e) { try { if (proyectSelected == null && studentSelected == null) { return; } MessageBoxResult confirmation = CustomMessageBox.ShowYesNo("¿Seguro que desea asignar al ESTUDIANTE " + studentSelected.Nombre + " " + studentSelected.Apellidopaterno + " con matricula " + studentSelected.Matricula + " al PROYECTO " + proyectSelected.Nombre + "?", "Confirmación", "Si", "No"); var assignDone = false; if (confirmation == MessageBoxResult.Yes) { Inscripción newInscription = CreateInscription(studentSelected.Matricula, proyectSelected.Clave); Expediente newExpedient = CreateExpedient(newInscription.InscripciónID); assignDone = true; } else { return; } if (assignDone == true) { MessageBoxResult result = CustomMessageBox.ShowYesNo("La asignación ha sido realizada con éxito.", "Asignación", "Generar oficio de asignación", "Finalizar"); if (result == MessageBoxResult.Yes) { var mainWindow = (MainWindow)Application.Current.MainWindow; mainWindow?.ChangeView(new GenerarOficioAsignacion(studentSelected)); return; } else { CancelButton_Click(new object(), new RoutedEventArgs()); } } } catch (EntityException) { Restarter.RestarSCPP(); } }
private Inscripción CreateInscription(string matricula, int clave) { var inscription = new Inscripción { Estatus = "Cursando", Fecha = thisDay, Periodo = periodo, Tipo = "A tiempo", Matriculaestudiante = matricula, Claveproyecto = clave }; using (SCPPContext context = new SCPPContext()) { context.Inscripción.Add(inscription); context.SaveChanges(); } return(inscription); }
public void CreateTestInscription() { using (SCPPContext context = new SCPPContext()) { testInscription = context.Inscripción.FirstOrDefault(i => i.Estatus.Equals("TestExpediente")); if (testInscription == null) { Inscripción inscripcion = new Inscripción() { Estatus = "TestExpediente", Fecha = thisDay, Periodo = "FEB2021 - JUL2021", Tipo = "Example 1" }; context.Inscripción.Add(inscripcion); context.SaveChanges(); testInscription = context.Inscripción.FirstOrDefault(i => i.Estatus.Equals("TestExpediente")); } } }
private void UnasingStudent() { try { using (SCPPContext context = new SCPPContext()) { var group = context.Grupo.Where(a => a.Nrc == actualGroup.Nrc).FirstOrDefault(); Inscripción inscripcion = context.Inscripción.Where(i => i.GrupoID == group.GrupoID && i.Matriculaestudiante == studentSelected.Matricula).FirstOrDefault(); inscripcion.GrupoID = null; context.SaveChanges(); studentsCollection.Clear(); GetStudents(); } } catch (EntityException) { Restarter.RestarSCPP(); } }
public EntregarReporte(Inscripción inscription) { InitializeComponent(); ComboBoxKind.ItemsSource = kindOfReport; this.inscription = inscription; }