public ActionResult Index() { var userId = Identity.GetUserId(User.Identity); ViewBag.DirectoryId = _directoryService.GetRootField(userId) .FieldId; return(View()); }
public ActionResult Details(Guid fieldId) { Guid userId = Identity.GetUserId(User.Identity); return(Json(_directoryService .GetFieldDetails(userId, fieldId), JsonRequestBehavior.AllowGet)); }
public ActionResult IndexDetails(Guid directoryId) { var userId = Identity.GetUserId(User.Identity); ViewBag.DirectoryId = directoryId; return(PartialView("_Directory", _directoryService .GetAvailableFields(userId, directoryId))); }
public ActionResult Index() { var userId = Identity.GetUserId(User.Identity); ViewBag.DirectoryId = _directoryService.GetRootField(userId) .FieldId; return(PartialView("_Directory", _directoryService .GetAvailableFields(userId))); }
public ActionResult Create(Guid rootId, string directoryName) { try { var userId = Identity.GetUserId(User.Identity); _directoryService.CreateDirectory(userId, rootId, directoryName); return(IndexDetails(rootId)); } catch (Exception ex) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } }
public ActionResult Update(IEnumerable <HttpPostedFileBase> files, Guid directoryId) { try { var fileViewModel = AutoMapper.Mapper.Map <IEnumerable <FileViewModel> >(files); Guid userId = Identity.GetUserId(User.Identity); _fieldService.CreateField(userId, directoryId, fileViewModel); return(RedirectToAction("IndexDetails", "Directory", new { directoryId = directoryId })); } catch { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } }