public async Task <IHttpActionResult> Reagents(long labId) { var(_, isLabManager) = await GetLab(labId); return(JsonWithPermissions(new { Results = await LabsDao.ListReagents(this, labId) }, true, isLabManager, isLabManager)); }
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)); }