public ActionResult Edit(Establishment establishment, HttpPostedFileBase image) { if (ModelState.IsValid) { if (image != null) { establishment.ImageMimeType = image.ContentType; establishment.ImageData = new byte[image.ContentLength]; image.InputStream.Read(establishment.ImageData, 0, image.ContentLength); } _establishmentRepository.SaveEstablishment(establishment); // TODO: _establishmentRepository.Add(establishment); TempData["message"] = string.Format("Establishment {0} has been saved", establishment.Name); return(RedirectToAction("Index")); } else { // there is something wrong with the data values return(View(establishment)); } }
public Establishment SaveEstablishment(Establishment mEstablishment) { return(establishmentRepository.SaveEstablishment(mEstablishment)); }