public ActionResult Update(Gallery objgal, int id) { try { db = new DenimEntities(); Gallery gal = db.Galleries.Find(id); gal.EventId = objgal.EventId; gal.ImageName = objgal.ImageName; db.Entry(gal); db.SaveChanges(); } catch { } Gallery objEvents = new Gallery(); objEvents.imageList = db.Galleries.ToList(); return(View("Index", objEvents.imageList)); //objGallery = new Gallery(); //ViewBag.Event = new SelectList(db.Events, "Id", "Note", objGallery.EventId); //return View(); }
public ActionResult Edit([Bind(Include = "Id,Title,Description,Date,status")] News news) { if (ModelState.IsValid) { db.Entry(news).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(news)); }
public ActionResult Edit([Bind(Include = "Id,Date,Note,Status")] Event @event) { if (ModelState.IsValid) { db.Entry(@event).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(@event)); }
public ActionResult Update(News objEvnt, int id) { try { db = new DenimEntities(); News obj = db.News.Find(id); obj.Title = objEvnt.Title; obj.Date = objEvnt.Date; obj.Description = objEvnt.Description; db.Entry(obj); db.SaveChanges(); } catch { } obj.NewsList = db.News.ToList(); return(View("Index", obj.NewsList)); }
public ActionResult Update(Event objEvnt, int id) { try { db = new DenimEntities(); Event objEvent = db.Events.Find(id); objEvent.Note = objEvnt.Note; objEvent.Date = objEvnt.Date; objEvent.Status = objEvnt.Status; db.Entry(objEvent); db.SaveChanges(); } catch { } Event objEvents = new Event(); objEvents.eventList = db.Events.ToList(); return(View("Index", objEvents.eventList)); }