public ActionResult Create(EventsSites oEvenSitesList) { try { // TODO: Add insert logic here oEvenSitesList.NewEvent.Insert(); return(RedirectToAction("Index")); } catch (Exception ex) { ViewBag.Error = ex.Message; return(View()); } }
public ActionResult Edit(int id, EventsSites z) { try { // TODO: Add update logic here z.NewEvent.Update(id); return(RedirectToAction("Index")); } catch (Exception ex) { ViewBag.Error = ex.Message; return(View()); } }
// GET: Event/Edit/5 public ActionResult Edit(int id) { if (Session["employee"] == null) { return(RedirectToAction("Login", "Login", new { returnurl = HttpContext.Request.Url })); } else { EventsSites eSite = new EventsSites(); eSite.AllSites = new CSiteList(); eSite.AllSites.Load(); CEvents e = new CEvents(); e.LoadById(id); eSite.NewEvent = e; return(View(eSite)); } }
// GET: Event/Create public ActionResult Create() { if (Session["employee"] == null) { return(RedirectToAction("Login", "Login", new { returnurl = HttpContext.Request.Url })); } else { EventsSites oEvenSitesList = new EventsSites(); CSiteList allsites = new CSiteList(); allsites.Load(); oEvenSitesList.AllSites = allsites; oEvenSitesList.NewEvent = new CEvents(); return(View(oEvenSitesList)); } }