Example #1
0
        public async Task <IHttpActionResult> Reagents(long labId)
        {
            var(_, isLabManager) = await GetLab(labId);

            return(JsonWithPermissions(new
            {
                Results = await LabsDao.ListReagents(this, labId)
            }, true, isLabManager, isLabManager));
        }
Example #2
0
        public async Task <ActionResult> Reagents(Lab lab)
        {
            var userId  = HttpContext.User.Identity.GetUserId();
            var results = await LabsDao.ListReagents(this, lab.LabId);

            var model = new LabsReagentsViewModel
            {
                Lab          = lab,
                UsedReagents = results,
                IsLabManager = lab.UserIsLabManager(userId)
            };

            return(View(model));
        }