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")); }
public void Delete(UserMaster entity) { entity.IsActive = false; userMasterRepository.Edit(entity); }