Ejemplo n.º 1
0
        public IActionResult DeleteInstructor(int campBatchId, int instructorId, int instructorRoleId)
        {
            Svc.RemoveInstructorCampBatch(campBatchId, instructorId, instructorRoleId);
            Svc.Commit();

            return(RedirectToAction("Instructors", new { @id = campBatchId }));
        }
Ejemplo n.º 2
0
        public IActionResult Create(CampCategory model)
        {
            if (ModelState.IsValid)
            {
                Svc.CreateCampCategory(model);
                Svc.Commit();
                return(RedirectToAction("Index"));
            }

            return(View(model));
        }
Ejemplo n.º 3
0
 public IActionResult Edit(Diet model)
 {
     if (ModelState.IsValid)
     {
         model.UserUpdatedId = User.GetUserId();
         Svc.Diets.Update(model);
         Svc.Commit();
         return(RedirectToAction("Index"));
     }
     return(View(model));
 }
Ejemplo n.º 4
0
        public IActionResult Create(Diet model)
        {
            if (ModelState.IsValid)
            {
                Svc.CreateDiet(model);
                Svc.Commit();
                return(RedirectToAction("Index"));
            }

            return(View(model));
        }
Ejemplo n.º 5
0
        public JsonResult AddInstructor(int id, int instructorId, int instructorRoleId)
        {
            var res = Svc.AddInstructorToCamp(instructorId, id, instructorRoleId);

            if (res.IsOK)
            {
                Svc.Commit();
            }

            return(Json(new { res.IsOK, res.Message }));
        }
Ejemplo n.º 6
0
        public IActionResult Create(InstructorRole model)
        {
            if (ModelState.IsValid)
            {
                Svc.CreateInstructorRole(model);
                Svc.Commit();
                return(RedirectToAction("Index"));
            }

            return(View(model));
        }
Ejemplo n.º 7
0
 public IActionResult Edit(Data.Entity.Camp model)
 {
     if (ModelState.IsValid)
     {
         model.UserUpdatedId = User.GetUserId();
         Svc.Camps.Update(model);
         Svc.Commit();
         return(RedirectToAction("Index"));
     }
     ViewBag.Categories = new SelectList(Svc.CampCategories.Items, "Id", "Name", model.CampCategoryId);
     return(View(model));
 }
Ejemplo n.º 8
0
        public IActionResult Create(Data.Entity.Camp model)
        {
            if (ModelState.IsValid)
            {
                Svc.CreateCamp(model);
                Svc.Commit();
                return(RedirectToAction("Index"));
            }

            ViewBag.Categories = new SelectList(Svc.CampCategories.Items, "Id", "Name", model.CampCategoryId);
            return(View(model));
        }
Ejemplo n.º 9
0
 public IActionResult Edit(CampBatch model)
 {
     if (ModelState.IsValid)
     {
         model.UserUpdatedId = User.GetUserId();
         Svc.CampBatches.Update(model);
         Svc.Commit();
         return(RedirectToAction("Index"));
     }
     ViewBag.Camps = new SelectList(Svc.Camps.Items.OrderBy(x => x.CampCategoryId), "Id", "Name", model.CampId);
     return(View(model));
 }
Ejemplo n.º 10
0
        public IActionResult Create(CampBatch model)
        {
            if (ModelState.IsValid)
            {
                Svc.CreateCampBatch(model);
                Svc.Commit();
                return(RedirectToAction("Index"));
            }

            ViewBag.Camps = new SelectList(Svc.Camps.Items.OrderBy(x => x.CampCategoryId), "Id", "Name", model.CampId);
            return(View(model));
        }
Ejemplo n.º 11
0
        public JsonResult ChangeOrder(int id, bool up)
        {
            var model = Svc.InstructorRoles.FindById(id);

            if (model == null)
            {
                return(Json(false));
            }

            Svc.ChangeOrder(model, up);
            Svc.Commit();
            return(Json(true));
        }
Ejemplo n.º 12
0
        public IActionResult Delete(int id)
        {
            var model = Svc.InstructorRoles.FindById(id);

            if (model == null)
            {
                return(NotFound());
            }

            Svc.DeleteInstructorRole(model);
            Svc.Commit();

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 13
0
        public IActionResult Delete(int id)
        {
            var model = Svc.CampCategories.FindById(id);

            if (model == null)
            {
                return(NotFound());
            }

            model.UserDeletedId = User.GetUserId();
            Svc.CampCategories.Delete(model);
            Svc.Commit();

            return(RedirectToAction("Index"));
        }