public ActionResult AddPosition(DiveRepo.DiveTracker dive, HttpPostedFileBase billeder) { dive.Billeder = null; if (billeder != null) { Uploader uploader = new Uploader(); string path = Request.PhysicalApplicationPath + "/Content/"; string fil = uploader.UploadImage(billeder, path, 255, true); dive.Billeder = System.IO.Path.GetFileName(fil); } else { ViewBag.MSG = "Der er Ikke valgt et billede"; } Df.Insert(dive); return(RedirectToAction("AddPosition")); }
public ActionResult Edit(DiveRepo.DiveTracker DT) { Df.Update(DT); return(RedirectToAction("Index")); }