示例#1
0
        // GET: NotificacionController/Edit/5
        public async Task <ActionResult> Edit(int id)
        {
            INotificacionService servicioNotificaciones = ObtenerServicio();
            NotificacionEntity   notificacionAsync      = await servicioNotificaciones.GetNotificacionAsync(id);

            return(View(notificacionAsync));
        }
示例#2
0
        // GET: NotificacionController
        public async Task <ActionResult> Index()
        {
            INotificacionService      servicioNotificaciones = ObtenerServicio();
            List <NotificacionEntity> notificacionesAsync    = await servicioNotificaciones.GetNotificacionesAsync();

            return(View(notificacionesAsync));
        }
示例#3
0
 public HomeController(ILogger <HomeController> logger,
                       INotificacionService notificacionService
                       )
 {
     _logger = logger;
     _notificacionService = notificacionService;
 }
示例#4
0
        private INotificacionService ObtenerServicio()
        {
            var services = new ServiceCollection();

            services.UseServices();
            var serviceProvider = services.BuildServiceProvider();
            INotificacionService servicioProductos = serviceProvider.GetRequiredService <INotificacionService>();

            return(servicioProductos);
        }
示例#5
0
 public OperacionService(HigoContext higoContext, INotificacionService notificacionService,
                         IVehiculoService vehiculoService, IEstadoService estadoService, VehiculoUtils vehiculoUtils,
                         CambioEstadoOperacionValidator cambioEstadoValidator)
 {
     this.higoContext           = higoContext;
     this.notificacionService   = notificacionService;
     this.vehiculoService       = vehiculoService;
     this.estadoService         = estadoService;
     this.vehiculoUtils         = vehiculoUtils;
     this.cambioEstadoValidator = cambioEstadoValidator;
 }
示例#6
0
        public async Task <ActionResult> Delete(int id, IFormCollection collection)
        {
            try
            {
                INotificacionService servicioNotificaciones = ObtenerServicio();
                await servicioNotificaciones.DeleteNotificacionAsync(id);

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                return(View());
            }
        }
示例#7
0
        public async Task <ActionResult> Edit(int id, IFormCollection collection)
        {
            try
            {
                INotificacionService servicioNotificaciones = ObtenerServicio();
                string             strAux = DateTime.Now.ToString();
                NotificacionEntity pe     = new NotificacionEntity()
                {
                    Id          = int.Parse(collection["Id"].ToString()),
                    Descripcion = collection["Descripcion"],
                    Fecha       = DateTime.Parse(collection["Fecha"].ToString()),
                    Tipo        = collection["Id"].ToString(),
                };

                NotificacionEntity pm = await servicioNotificaciones.UpdateNotificacionAsync(pe);

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                return(View());
            }
        }
示例#8
0
 public NotificacionesController(INotificacionService notificacionService)
 {
     this.notificacionService = notificacionService;
 }
 public void SetUp()
 {
     _service = new NotificacionService();
 }
示例#10
0
 public DataService(IBodegaRepository bodega, INotificacionService notificacionService, ILogService logService)
 {
     _bodega              = bodega;
     _logService          = logService;
     _notificacionService = notificacionService;
 }
示例#11
0
 public NotificacionesController(INotificacionService services, INotificacionQueries queries)
 {
     _queries  = queries ?? throw new ArgumentNullException(nameof(queries));
     _services = services ?? throw new ArgumentNullException(nameof(services));
 }