Ejemplo n.º 1
0
        public ActionResult DeactivateTask(int taskID, int gardenID)
        {
            var result = new com.GreenThumb.BusinessLogic.JobManager().DeactivateTask(taskID);
            int userId = RetrieveUserId();
            IEnumerable <Group> groups   = new com.GreenThumb.BusinessLogic.GardenManager().GetGardenByUser(userId);
            IEnumerable <Task>  jobs     = new com.GreenThumb.BusinessLogic.JobManager().RetrieveTasksByGardenId(gardenID);
            GardenTaskViewModel modelObj = new GardenTaskViewModel();

            modelObj.GroupsList = groups;
            modelObj.JobList    = jobs;
            ViewBag.GardenID    = gardenID;
            return(View("Index", modelObj));
        }
Ejemplo n.º 2
0
        public ActionResult SaveTask(int gardenID, string description, string userNotes)
        {
            int userId = RetrieveUserId();

            ViewBag.GardenID = gardenID;
            Job jobData = new Job();

            jobData.GardenID     = gardenID;
            jobData.Description  = description;
            jobData.UserNotes    = userNotes;
            jobData.DateAssigned = DateTime.Now;
            jobData.AssignedFrom = userId;
            var result = new com.GreenThumb.BusinessLogic.JobManager().AddNewTask(jobData);
            IEnumerable <Group> groups   = new com.GreenThumb.BusinessLogic.GardenManager().GetGardenByUser(userId);
            GardenTaskViewModel modelObj = new GardenTaskViewModel();

            modelObj.GroupsList = groups;
            return(View("Index", modelObj));
        }
Ejemplo n.º 3
0
        public ActionResult ViewTask(int gardenID)
        {
            int userId = RetrieveUserId();
            IEnumerable <Group> groups   = new com.GreenThumb.BusinessLogic.GardenManager().GetGardenByUser(userId);
            IEnumerable <Task>  jobs     = new com.GreenThumb.BusinessLogic.JobManager().RetrieveTasksByGardenId(gardenID);
            GardenTaskViewModel modelObj = new GardenTaskViewModel();

            modelObj.GroupsList = groups;
            modelObj.JobList    = jobs;
            ViewBag.GardenID    = gardenID;
            ViewBag.UserID      = userId;

            ViewBag.GroupLeader = new GroupManager().
                                  GetLeaderStatus(
                userId, new GardenManager().RetrieveGardenGroupId(gardenID)
                );

            return(View("Index", modelObj));
        }