예제 #1
0
        public ActionResult EventEdit(int id)
        {
            if (id == 0)
            {
                return(HttpNotFound());
            }
            var letezoEvent = _context.FoNaptar.Find(id);
            var vm          = new MainCalendarViewModel()
            {
                events = letezoEvent
            };

            return(View("EventEdit", vm));
        }
예제 #2
0
 public ActionResult Edit(MainCalendarViewModel Event)
 {
     if (Event.events.EventId == 0)
     {
         _context.FoNaptar.Add(Event.events);
     }
     else
     {
         var letezoEvent = _context.FoNaptar.Single(m => m.EventId == Event.events.EventId);
         letezoEvent.Subject     = Event.events.Subject;
         letezoEvent.Description = Event.events.Description;
         letezoEvent.Start       = Event.events.Start;
         letezoEvent.End         = Event.events.End;
     }
     _context.SaveChanges();
     return(RedirectToAction("Calendar"));
 }