public ActionResult AdmButikkenEditResult(int ID, string Navn, string Tekst, int Pris, HttpPostedFileBase IMG) { if (IMG != null && Tekst != null && Navn != null) { Uploader U = new Uploader(); int width = 350; string path = Request.PhysicalApplicationPath + "Content/IMG/"; string File = U.UploadImage(IMG, path, width, true); Vare_info vi = new Vare_info(); vi.ID = ID; vi.Pris = Pris; vi.Tekst = Tekst; vi.Navn = Navn; vi.IMG = Path.GetFileName(File); vif.Update(vi); ViewBag.MSG = "updateret"; } else { ViewBag.MSG = "prøv igen og husk at udfylde all felter"; } return(RedirectToAction("AdmButikken")); }
public ActionResult AdmButikkenResult(HttpPostedFileBase IMG, string Navn, int Pris, string Tekst) { Uploader U = new Uploader(); int width = 500; string path = Request.PhysicalApplicationPath + "Content/IMG/"; string File = U.UploadImage(IMG, path, width, true); Vare_info vi = new Vare_info(); vi.IMG = Path.GetFileName(File); vi.Navn = Navn; vi.Pris = Pris; vi.Tekst = Tekst; vif.Insert(vi); return(RedirectToAction("AdmButikken")); }