Exemple #1
0
        public ActionResult EditTravel(EditModel edit, HttpPostedFileBase picture)
        {
            if (ModelState.IsValid)
            {
                _repository.Edit(edit, User.Identity.GetUserId());
            }

            if (picture == null)
            {
                return(View("Index"));
            }
            var filename = Path.GetFileName(picture.FileName);

            if (filename == null)
            {
                return(RedirectToAction("EditTravel", "Home"));
            }
            string path = Path.GetFileName(picture.FileName);

            path = "/Images/" + path;
            picture.SaveAs(Server.MapPath(path));
            var photo = new Photo
            {
                TravelId = edit.Id,
                Picture  = path
            };

            _repository.AddPhoto(photo);

            return(View("Index"));
        }
Exemple #2
0
 public void Delete(UserMaster entity)
 {
     entity.IsActive = false;
     userMasterRepository.Edit(entity);
 }