Exemplo n.º 1
0
        public async Task<ActionResult> AddBoostedObjectiveWithObjectiveID(int id)
        {
            AddEditBoostedObjectiveViewModel model = new AddEditBoostedObjectiveViewModel();

            model.BoostedObjective = new BoostedObjective();
            model.LoggedInUser = await objectiveService.GetCurrentUser();
            model.FullNavList = CreateObjectivesAdminNavList();
            model.BoostedObjective.BoostedObjectiveID = id;

            return View("AddBoostedObjective", model);
        }
Exemplo n.º 2
0
        public async Task<ActionResult> EditBoostedObjective(int id)
        {
            AddEditBoostedObjectiveViewModel model = new AddEditBoostedObjectiveViewModel();

            model.BoostedObjective = objectiveService.GetBoostedObjectiveByID(id);
            model.LoggedInUser = await objectiveService.GetCurrentUser();
            model.FullNavList = CreateObjectivesAdminNavList();

            return View(model);
        }
Exemplo n.º 3
0
        public async Task<ActionResult> EditBoostedObjective(AddEditBoostedObjectiveViewModel model)
        {
            if (ModelState.IsValid)
            {
                objectiveService.EditBoostedObjective(model.BoostedObjective, model.DaysToAdd);
            }

            model.LoggedInUser = await objectiveService.GetCurrentUser();
            model.FullNavList = CreateObjectivesAdminNavList();

            return View(model);
        }
Exemplo n.º 4
0
        public async Task<ActionResult> AddBoostedObjective(AddEditBoostedObjectiveViewModel model)
        {
            if (ModelState.IsValid)
            {
                model.BoostedObjective.EndDate = DateTime.Today.AddDays(model.DaysToAdd);

                objectiveService.AddBoostedObjective(model.BoostedObjective);
                model.LoggedInUser = await objectiveService.GetCurrentUser();
                model.FullNavList = CreateObjectivesAdminNavList();

                return View("EditBoostedObjective", model);
            }
            else
            {
                model.LoggedInUser = await objectiveService.GetCurrentUser();
                model.FullNavList = CreateObjectivesAdminNavList();

                return View(model);
            }
        }