public void AddGiveaway(GiveawayEntry entry, ulong serverId) { GiveawaySchedulerData data = new GiveawaySchedulerData(entry, serverId); string json = JsonConvert.SerializeObject(data); m_scheduler.Add <GiveawayService>(entry.End, nameof(GiveawaySchedulerCallback), json); }
public ActionResult Create(EventSchedulerViewModel evm) { Event e = new Event(); e.Title = evm.EventModel.Title; e.Address = evm.EventModel.Address; e.NumberPlaces = evm.EventModel.NumberPlaces; e.Price = evm.EventModel.Price; e.Description = evm.EventModel.Description; e.Start = evm.EventModel.Start; e.End = evm.EventModel.End; e.OrganizedBy = evm.EventModel.OrganizedBy; eventService.Add(e); eventService.Commit(); foreach (Scheduler scheduler in listScheduler) { Scheduler s = new Scheduler() { Duration = scheduler.Duration, ProgramName = scheduler.ProgramName, EventId = e.EventId }; schedulerService.Add(s); schedulerService.Commit(); } try { // TODO: Add insert logic here return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Create(SchedulerViewModel svm) { Scheduler scheduler = new Scheduler(); scheduler.Duration = svm.Duration; scheduler.ProgramName = svm.ProgramName; // scheduler.Event = eventService.GetById(1); schedulerService.Add(scheduler); schedulerService.Commit(); try { // TODO: Add insert logic here return(View()); } catch { return(View()); } }