Пример #1
0
        //print actions



        // GET: Tasks/Create
        public ActionResult Create()
        {
            var reservationModels      = new reservationModels();
            List <eventproject> events = service1.GetAllevent().ToList();

            reservationModels.events = events.ToSelectListItem();
            List <user> users = service2.GetAlluser().ToList();

            reservationModels.users = users.ToSelectListItems();


            return(View(reservationModels));
        }
Пример #2
0
        public ActionResult Create(reservationModels t)
        {
            reservation e = new reservation
            {
                title = t.title,

                user_id         = t.user_id,
                eventproject_id = t.eventproject_id
            };

            service.createreservation(e);
            service.Commit();
            return(RedirectToAction("Index"));
        }
Пример #3
0
        // GET: Tasks/Edit/5
        public ActionResult Edit(int id)
        {
            reservation       e  = service.GetById(id);
            reservationModels em = new reservationModels
            {
                title = e.title,
            };
            List <eventproject> events = service1.GetAllevent().ToList();

            em.events = events.ToSelectListItem();
            List <user> users = service2.GetAlluser().ToList();

            em.users = users.ToSelectListItems();
            return(View(em));
        }
Пример #4
0
        // GET: Tasks/Delete/5
        public ActionResult Delete(int id)
        {
            reservation e = service.GetById(id);

            if (e == null)
            {
                return(HttpNotFound());
            }
            reservationModels em = new reservationModels
            {
                title = e.title,

                user_id         = e.user_id,
                eventproject_id = e.eventproject_id
            };

            return(View(em));
        }