Пример #1
0
        public ActionResult Edit(int id, EventModel Event)
        {
            try
            {
                // TODO: Add update logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
Пример #2
0
        public ActionResult Create(EventModel  Event)
        {
            try
            {
                // TODO: Add insert logic here
                Event.eventNew(Functions.loggedUser.get_id());

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
Пример #3
0
        //
        // GET: /Event/
        public ActionResult Index()
        {
            EventModel events = new EventModel();

            return View(events.upcoming(Functions.loggedUser.get_id()));
        }
Пример #4
0
        public List<EventModel> ParseMulti(JArray jObject)
        {
            try
            {
                List<EventModel> Events = new List<EventModel>();

                foreach (JObject item in jObject)
                {
                    EventModel newEvent = new EventModel();

                    newEvent._id = (String)item["_id"];
                    newEvent._rev = (String)item["_rev"];
                    newEvent.Timestamp = (DateTime)item["timestamp"];
                    newEvent.description = (String)item["description"];
                    Events.Add(newEvent);
                }
                return Events;
            }
            catch (Exception ex)
            {
                return null;
            }
        }