コード例 #1
0
        // GET: Banking/Create
        public IActionResult CreateHour()
        {
            var model = new HourViewModel
            {
                Timer       = null,
                ListBanking = _bankingRepository.GetComboBancas()
            };

            return(View(model));
        }
コード例 #2
0
        public IActionResult Create([FromBody] Hour hour)
        {
            var model = new HourViewModel();

            try
            {
                model             = mapper.Map <HourViewModel>(hourService.AddHour(hour));
                model.MessageType = MessageTypeEnum.success;
                model.Message     = "Hora creada";
            }
            catch (ExtraHoursException)
            {
                model.MessageType = MessageTypeEnum.warning;
                model.Message     = "La cantidad de horas ingresadas supera las 8 permitidas por actividad.";
            }
            catch (Exception)
            {
                model.MessageType = MessageTypeEnum.danger;
                model.Message     = "Error en la aplicación";
            }

            model.ShowMessage = true;
            return(Json(model));
        }
コード例 #3
0
 public PartialViewResult GetAdminTrackerTable(string permission, string date)
 {
     WorkData = new HourViewModel(date, Administracija.Models.ActiveSession.Current.ActiveUser.IDWorker, int.Parse(permission));
     return(PartialView("_HoursTableAdmin", WorkData));
 }