Beispiel #1
0
 public static void AddEventCategory(EventCategory newEventCategory)
 {
     using (ArgaamAnalyticsDataContext aadc = new ArgaamAnalyticsDataContext())
     {
         aadc.EventCategories.InsertOnSubmit(newEventCategory);
         aadc.SubmitChanges();
     }
 }
Beispiel #2
0
        public JsonResult AddEvent(Event globalEvent)
        {
            using (ArgaamAnalyticsDataContext aadc = new ArgaamAnalyticsDataContext())
            {
                aadc.Events.InsertOnSubmit(globalEvent);
                aadc.SubmitChanges();
            }

            return(Json("SUCCESS"));
        }
Beispiel #3
0
        public JsonResult DeleteEvent(int eventID)
        {
            using (ArgaamAnalyticsDataContext aadc = new ArgaamAnalyticsDataContext())
            {
                //var ge = (from rec in aadc.GlobalEvents
                //          where rec.GlobalEventID == eventID
                //          select rec).Single();

                var ge = new Event()
                {
                    EventID = eventID
                };

                aadc.Events.Attach(ge);
                aadc.Events.DeleteOnSubmit(ge);
                aadc.SubmitChanges();
            }

            return(Json("SUCCESS", JsonRequestBehavior.AllowGet));
        }