public ActionResult Delete(int id) { try { service.DeleteSponsor(id); return RedirectToAction("Index"); } catch { var sponsor = service.GetSponsor(id); Sponsor model = new Sponsor() { ID = sponsor.ID, EventID = sponsor.EventID, Name = sponsor.Name, Description = sponsor.Description, SponsorshipLevel = sponsor.SponsorshipLevel, WebsiteUrl = sponsor.WebsiteUrl, ImageUrl = sponsor.ImageUrl }; return View("Details", model); } }
public ActionResult Create(Sponsor sponsor) { try { service.CreateSponsor(new CodeCampService.Sponsor() { EventID = sponsor.EventID, Name = sponsor.Name, Description = sponsor.Description, SponsorshipLevel = sponsor.SponsorshipLevel, WebsiteUrl = sponsor.WebsiteUrl, Image = ConvertToByes(Request.Files["Logo"]) }); return RedirectToAction("Index"); } catch (Exception ex) { return View(sponsor); } }
// // GET: /Sponsor/Details/5 public ActionResult Details(int id) { var sponsor = service.GetSponsor(id); Sponsor model = new Sponsor() { ID = sponsor.ID, EventID = sponsor.EventID, Name = sponsor.Name, Description = sponsor.Description, SponsorshipLevel = sponsor.SponsorshipLevel, WebsiteUrl = sponsor.WebsiteUrl, ImageUrl = sponsor.ImageUrl }; return View(model); }
public ActionResult Create(int eventid) { Sponsor model = new Sponsor() { EventID = eventid }; return View(model); }
public ActionResult Edit(int id) { var sponsor = service.GetSponsor(id); Sponsor model = new Sponsor() { ID = sponsor.ID, EventID = sponsor.EventID, Name = sponsor.Name, Description = sponsor.Description, SponsorshipLevel = sponsor.SponsorshipLevel, WebsiteUrl = sponsor.WebsiteUrl, Logo = sponsor.Image == null ? null : new Infrastructure.WebImageOCC(sponsor.Image), }; return View(model); }