Exemplo n.º 1
0
 public IActionResult Create(TrajectDetailViewModel vm)
 {
     if (ModelState.IsValid)
     {
         TrajectViewModelConverter trajectViewModelConverter = new TrajectViewModelConverter();
         Traject t  = trajectViewModelConverter.ViewModelToTraject(vm);
         decimal id = repo.CreateTraject(t);
         return(RedirectToAction("Details", new { id }));
     }
     return(View());
 }
Exemplo n.º 2
0
 public HomeController(IConfiguration configuration)
 {
     ticketContext    = new MSSQLTicketContext(configuration.GetConnectionString("DefaultConnection"));
     ticketRepo       = new TicketRepository(ticketContext);
     ticketConverter  = new TicketViewModelConverter();
     stationContext   = new MSSQLStationContext(configuration.GetConnectionString("DefaultConnection"));
     stationRepo      = new StationRepository(stationContext);
     stationConverter = new StationViewModelConverter();
     trajectContext   = new MSSQLTrajectContext(configuration.GetConnectionString("DefaultConnection"));
     trajectRepo      = new TrajectRepository(trajectContext);
     trajectConverter = new TrajectViewModelConverter();
 }
Exemplo n.º 3
0
 public TrajectController(IConfiguration configuration)
 {
     context   = new MSSQLTrajectContext(configuration.GetConnectionString("DefaultConnection"));
     repo      = new TrajectRepository(context);
     converter = new TrajectViewModelConverter();
 }