Exemple #1
0
 public ActionResult CheckPassword(FilePasswordModel model)
 {
     if (ModelState.IsValid)
     {
         if (model.Password == model.FilePassword)
         {
             return(RedirectToAction("ShowFile", "Home",
                                     new { sha = model.Sha, acceptPass = false }));
         }
         ModelState.AddModelError("", "Неправильный пароль");
     }
     return(View());
 }
Exemple #2
0
        public ActionResult CheckPassword(string sha)
        {
            var file = UnitOfWork.Files.GetFile(sha);

            if (file == null)
            {
                return(HttpNotFound());
            }
            var model = new FilePasswordModel
            {
                FilePassword = file.Password,
                Sha          = file.Sha
            };

            return(View(model));
        }