public ActionResult Edit(Event event_)
        {
            if (string.IsNullOrEmpty(event_.title))
            {
                EventFilter eventFilter = new EventFilter()
                {
                    Id = event_.Id
                };

                event_ = _EventService.GetEvent(eventFilter);

                return View(event_);
            }

            event_.end = _ConvertToFullCalendarFormat(event_.start, event_.endTime);
            event_.start = _ConvertToFullCalendarFormat(event_.start, event_.startTime);

            _EventService.EditEvent(event_);

            return RedirectToAction("Index");
        }
Ejemplo n.º 2
0
 public List<Event> GetEvents(EventFilter eventFilter = null)
 {
     using (IBusinessProvider provider = base.CreateBusinessProvider())
     using (IEventBusinessProvider prov = provider.CreateEventBusinessProvider())
         return prov.GetEvents(eventFilter);
 }
 List<Event> IEventBusinessProvider.GetEvents(EventFilter eventFilter = null)
 {
     using (IDataProvider provider = base.CreateDataProvider())
     using (IEventRepository repository = provider.CreateEventRepository())
         return repository.GetEvents(eventFilter);
 }
 public Event GetEvent(EventFilter eventFilter = null)
 {
     using (IDataProvider provider = base.CreateDataProvider())
     using (IEventRepository repository = provider.CreateEventRepository())
         return repository.GetEvent(eventFilter);
 }
        public ActionResult GetEvents(double start, double end)
        {
            var fromDate = ConvertFromUnixTimestamp(start);
            var toDate = ConvertFromUnixTimestamp(end);

            EventFilter eventFilter = new EventFilter()
            {
                Start = fromDate,
                End = toDate
            };

            var eventList = from e in _EventService.GetEvents(eventFilter)
                            select new
                            {
                                id = e.Id,
                                title = e.title,
                                start = e.start,
                                end = e.end,
                                allDay = e.start.Contains("T") ? false : true
                            };

            var rows = eventList.ToArray();

            return Json(rows, JsonRequestBehavior.AllowGet);
        }
        public ActionResult Index(string month, string year)
        {
            if (LoggedPETiano.GetLogedPETiano() == null)
                return RedirectToAction("Index", "Login");

            _PopulateDropdownMonth();
            _PopulateDropdownYear();

            int monthNew = string.IsNullOrEmpty(month) ? DateTime.Now.Month : (int)Extension.GetValueFromDescription<EMonth>(month);
            int yearNew = string.IsNullOrEmpty(year) ? DateTime.Now.Year : Convert.ToInt32(year);

            DateTime start = new DateTime(yearNew, monthNew, 1);
            DateTime end = new DateTime(yearNew, monthNew + 1 > 12 ? 1 : monthNew + 1, 1);

            EventFilter eventFilter = new EventFilter()
            {
                Start = start,
                End = end
            };

            List<Event> events = _EventService.GetEvents(eventFilter);

            return View(events);
        }