Ejemplo n.º 1
0
        // GET: Assignment
        public ActionResult Index()
        {
            var userId  = Guid.Parse(User.Identity.GetUserId());
            var service = new AssignmentService(userId);
            var model   = service.GetAssignments();

            return(View(model));
        }
Ejemplo n.º 2
0
        public async Task <ActionResult <List <AssignmentDto> > > GetAssignments(int locationId, DateTimeOffset?start, DateTimeOffset?end)
        {
            if (!PermissionDataFiltersExtensions.HasAccessToLocation(User, Db, locationId))
            {
                return(Forbid());
            }

            var assignments = await AssignmentService.GetAssignments(locationId, start, end);

            return(Ok(assignments.Adapt <List <AssignmentDto> >()));
        }
Ejemplo n.º 3
0
        public IHttpActionResult Get()
        {
            AssignmentService assignmentService = CreateAssignmentService();
            var assignments = assignmentService.GetAssignments();

            string newLog     = "All Assignments Recieved";
            var    logService = CreateLogService();

            logService.LogCreate(newLog);

            return(Ok(assignments));
        }