예제 #1
0
        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"));
        }
예제 #2
0
 public ActionResult Edit(DiveRepo.DiveTracker DT)
 {
     Df.Update(DT);
     return(RedirectToAction("Index"));
 }