Ejemplo n.º 1
0
        public async Task <IActionResult> CreateUnit(int groupId)
        {
            Log.Called(nameof(CreateUnit));

            if (!await CanUserVisitPage(groupId))
            {
                return(RedirectToAction("AccessError", "Home"));
            }

            var dto = new CreateOrEditUnitDTO
            {
                Colors            = await _colorFacade.GetColorsAsync <ColorDTO>(),
                UnitGroups        = await _ugFacade.GetUnitGroupNamesByUserId <UnitGroupNameDTO>(UserInfoManager.UserId),
                UnitTypes         = await _unitTypeFacade.GetUnitTypesAsync <UnitTypeDTO>(),
                SelectedUnitGroup = await _ugFacade.GetUnitGroupByIdAsync <UnitGroupNameDTO>(groupId),
                Unit = new UnitFullDTO()
            };

            return(View(dto));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> CreateGroup()
        {
            Log.Called(nameof(CreateGroup), UserInfoManager.UserId.ToString());

            if (!(UserInfoManager.UserId != Constants.NO_ID && UserInfoManager.CanUserAccessPage(UserInfoManager.UserId)))
            {
                return(RedirectToAction("AccessError", "Home"));
            }

            var dto = new CreateGroupDTO
            {
                Colors = await _colorFacade.GetColorsAsync <ColorDTO>()
            };

            return(View(dto));
        }
Ejemplo n.º 3
0
 public async Task <List <ColorDTO> > GetColors()
 {
     return(await _colorFacade.GetColorsAsync <ColorDTO>());
 }