Ejemplo n.º 1
0
        public ActionResult Index()
        {
            var userId = Identity.GetUserId(User.Identity);

            ViewBag.DirectoryId = _directoryService.GetRootField(userId)
                                  .FieldId;
            return(View());
        }
Ejemplo n.º 2
0
        public ActionResult Details(Guid fieldId)
        {
            Guid userId = Identity.GetUserId(User.Identity);

            return(Json(_directoryService
                        .GetFieldDetails(userId, fieldId),
                        JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 3
0
        public ActionResult IndexDetails(Guid directoryId)
        {
            var userId = Identity.GetUserId(User.Identity);

            ViewBag.DirectoryId = directoryId;
            return(PartialView("_Directory", _directoryService
                               .GetAvailableFields(userId, directoryId)));
        }
Ejemplo n.º 4
0
        public ActionResult Index()
        {
            var userId = Identity.GetUserId(User.Identity);

            ViewBag.DirectoryId = _directoryService.GetRootField(userId)
                                  .FieldId;
            return(PartialView("_Directory", _directoryService
                               .GetAvailableFields(userId)));
        }
Ejemplo n.º 5
0
 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));
     }
 }
Ejemplo n.º 6
0
 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));
     }
 }