// GET: Banking/Create public IActionResult CreateHour() { var model = new HourViewModel { Timer = null, ListBanking = _bankingRepository.GetComboBancas() }; return(View(model)); }
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)); }
public PartialViewResult GetAdminTrackerTable(string permission, string date) { WorkData = new HourViewModel(date, Administracija.Models.ActiveSession.Current.ActiveUser.IDWorker, int.Parse(permission)); return(PartialView("_HoursTableAdmin", WorkData)); }