public IActionResult DeleteInstructor(int campBatchId, int instructorId, int instructorRoleId)
        {
            Svc.RemoveInstructorCampBatch(campBatchId, instructorId, instructorRoleId);
            Svc.Commit();

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

            return(View(model));
        }
Exemple #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));
 }
Exemple #4
0
        public IActionResult Create(Diet model)
        {
            if (ModelState.IsValid)
            {
                Svc.CreateDiet(model);
                Svc.Commit();
                return(RedirectToAction("Index"));
            }

            return(View(model));
        }
        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 }));
        }
        public IActionResult Create(InstructorRole model)
        {
            if (ModelState.IsValid)
            {
                Svc.CreateInstructorRole(model);
                Svc.Commit();
                return(RedirectToAction("Index"));
            }

            return(View(model));
        }
Exemple #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));
 }
Exemple #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));
        }
 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));
 }
        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));
        }
        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));
        }
        public IActionResult Delete(int id)
        {
            var model = Svc.InstructorRoles.FindById(id);

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

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

            return(RedirectToAction("Index"));
        }
        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"));
        }