/// <summary>
        /// GET the list of gardens you belong to by group.
        /// Author: Chris Schwebach 4/18/2016
        /// </summary>
        /// <returns>GardenList by group</returns>
        public ActionResult Index()
        {
            int userId = RetrieveUserId();
            var model  = new com.GreenThumb.BusinessLogic.GardenManager().GetGardenByUser(userId);

            return(View(model));
        }
Beispiel #2
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));
        }
Beispiel #3
0
        /// <summary>
        /// Author: Poonam Dubey
        /// Date : Apr.15th.2016
        /// Controller to manage the Task
        /// </summary>



        // GET: GardenTask
        public ActionResult Index()
        {
            int userId = RetrieveUserId();
            IEnumerable <Group> model    = new com.GreenThumb.BusinessLogic.GardenManager().GetGardenByUser(userId);
            GardenTaskViewModel modelObj = new GardenTaskViewModel();

            modelObj.GroupsList = model;
            ViewBag.UserID      = userId;



            return(View(modelObj));
        }
Beispiel #4
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));
        }
Beispiel #5
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));
        }