// GET: Meeting/Create public ActionResult Create() { MeetingModels ch = new MeetingModels(); ch.Meetings = service1.GetAllCat().ToSelectListItemM(); return(View(ch)); }
// GET: Meeting/Edit/5 public ActionResult Edit(int id) { meeting sc = service.GetMeetingById(id); MeetingModels cvm = new MeetingModels { Title = sc.Title, EndDate = sc.EndDate, StartDate = sc.StartDate, Description = sc.Description, }; return(View(cvm)); }
public ActionResult Edit(int id, MeetingModels sc) { { meeting c = service.GetMeetingById(id); c.EndDate = sc.EndDate; c.StartDate = sc.StartDate; c.Description = sc.Description; c.Title = sc.Title; service.updateMeeting(c); service.Commit(); return(RedirectToAction("Index")); } }
public ActionResult Create(MeetingModels meet, HttpPostedFileBase image) { meeting c = new meeting(); c.Image = image.FileName; c.Title = meet.Title; c.Private = meet.Private; c.Description = meet.Description; c.StartDate = meet.StartDate; c.EndDate = meet.EndDate; c.CategoryID = meet.CategoryID; if (ModelState.IsValid) { service.createMeeting(c); } var path = Path.Combine(Server.MapPath("~/content/upload"), image.FileName); image.SaveAs(path); return(RedirectToAction("Index")); }