Exemplo n.º 1
0
 public void UploadEditedFile(FileSyncContent content)
 {
     _filesRepository.EditFile(new File
     {
         Data        = content.Data,
         Description = content.Description,
         FileContent = content.FileContent,
         FileName    = content.FileName,
         FileType    = content.FileType,
         Id          = content.Id,
         UserId      = content.UserId
     });
 }
Exemplo n.º 2
0
        public ActionResult Edit(File file)
        {
            if (ModelState.IsValid)
            {
                //make sure the edited file has the same user profile assigned to it
                file.User = _usersRepository.GetUserProfileByName(User.Identity.Name.ToLower());
                file.Data = DateTime.Now;
                //save the changes
                _filesRepository.EditFile(file);

                return(RedirectToAction("Index"));
            }
            return(View(file));
        }