Exemplo n.º 1
0
        public ActionResult Checkins()
        {
            // A page for seeing what EventDay and Agendas to select
            int accessEventID = int.Parse(ConfigurationManager.AppSettings["ActiveEvent"]);
            //List<AgendaDisplayObject> retVal = new List<AgendaDisplayObject>();
            List <EventDateDisplayObject> retVal = new List <EventDateDisplayObject>();
            List <EventDate> dList = db.EventDates.Where(o => o.EventRecordsID == accessEventID).ToList();

            foreach (EventDate eDate in dList)
            {
                EventDateDisplayObject toAdd = new EventDateDisplayObject();
                toAdd.EventDate  = eDate;
                toAdd.Agendas    = db.Agendas.Where(o => o.EventDateID == eDate.ID).ToList();
                toAdd.Event      = db.EventRecords.Where(o => o.ID == eDate.EventRecordsID).FirstOrDefault();
                toAdd.Client     = db.Clients.Where(o => o.ID == toAdd.Event.ClientID).FirstOrDefault();
                toAdd.AgendaFull = new List <AgendaDisplayObject>();
                foreach (Agenda agenda in toAdd.Agendas)
                {
                    AgendaDisplayObject nowAdd = new AgendaDisplayObject();
                    nowAdd.Agenda       = agenda;
                    nowAdd.ActivityList = new List <Activity>();
                    nowAdd.ActivityList = db.Activities.Where(o => o.AgendaID == agenda.ID).ToList();
                    toAdd.AgendaFull.Add(nowAdd);
                }
                retVal.Add(toAdd);
            }

            return(View(retVal));
        }
Exemplo n.º 2
0
        // GET: EventDates/Delete/5
        public ActionResult Delete(int?id, int?filter)
        {
            if (id == null || filter == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            EventDate eventDateList = db.EventDates.Where(o => o.ID == id).FirstOrDefault();
            //EventDate eventDate = db.EventDates.Find(id);

            EventDateDisplayObject edDO = new EventDateDisplayObject();

            edDO.Agendas   = db.Agendas.Where(o => o.EventDateID == id).ToList();
            edDO.EventDate = eventDateList;

            ViewBag.FilterID = filter;

            return(View(edDO));

            //if (id == null || filter == null)
            //{
            //    return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            //}
            //int getID = id ?? default(int);
            //EventDate eventDate = db.EventDates.Find(getID);
            //if (eventDate == null)
            //{
            //    return HttpNotFound();
            //}
            //ViewBag.FilterID = filter;
            //return View(eventDate);
        }
Exemplo n.º 3
0
        internal static List <EventDateDisplayObject> GetAllEventDates()
        {
            List <EventDateDisplayObject> retVal = new List <EventDateDisplayObject>();

            using (var db = new RFIDDBEntities())
            {
                try
                {
                    //var query = db.Clients.ToList();
                    var query = from b in db.EventDates
                                orderby b.ID descending
                                select b;

                    foreach (var item in query)
                    {
                        EventDateDisplayObject toAdd = new EventDateDisplayObject();

                        toAdd.EventDate = item;
                        toAdd.Event     = db.EventRecords.Find(item.EventRecordsID);
                        toAdd.Client    = db.Clients.Find(toAdd.Event.ClientID);
                        var agQuery = from b in db.Agendas
                                      where b.EventDateID == item.ID
                                      select b;
                        toAdd.Agendas = agQuery.ToList();

                        retVal.Add(toAdd);
                    }
                }
                catch { }
            }
            return(retVal);
        }
Exemplo n.º 4
0
        // GET: EventDates/Details/5
        public ActionResult Details(int?id, int?filter)
        {
            if (id == null || filter == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            EventDate eventDateList = db.EventDates.Where(o => o.ID == id).FirstOrDefault();
            //EventDate eventDate = db.EventDates.Find(id);

            EventDateDisplayObject edDO = new EventDateDisplayObject();

            edDO.Agendas   = db.Agendas.Where(o => o.EventDateID == id).ToList();
            edDO.EventDate = eventDateList;

            ViewBag.FilterID = filter;

            return(View(edDO));
        }