Example #1
0
 /// <summary>
 /// Poonam Dubey
 /// 19th April 2016
 /// Function to Mark task as completed
 /// </summary>
 /// <param name="taskID"></param>
 /// <param name="userID"></param>
 /// <returns></returns>
 public bool CompleteTask(int taskID)
 {
     try
     {
         return(JobAccessor.CompleteTask(taskID));
     }
     catch (Exception ex)
     {
         throw new ApplicationException("Error Marking task as Completed!", ex);
     }
 }
Example #2
0
 /// <summary>
 /// created by: Nasr Mohammed
 /// Created: 3/4/2016
 /// </summary>
 /// <param name="jobId"></param>
 /// <returns> get a task record</returns>
 public Job GetJob(int jobId)
 {
     try
     {
         return(JobAccessor.RetrieveJob(jobId));
     }
     catch (Exception ex)
     {
         throw new ApplicationException(" No records Found!", ex);
     }
 }
Example #3
0
 /// <summary>
 /// created by: Nasr Mohammed
 /// Created: 3/4/2016
 /// </summary>
 /// <returns> get a list of jobs</returns>
 public List <Job> GetTaskList()
 {
     try
     {
         return(JobAccessor.RetrieveTasks());
     }
     catch (Exception ex)
     {
         throw new ApplicationException(" No records Found!.", ex);
     }
 }
Example #4
0
 /// <summary>
 /// Poonam Dubey
 /// 18th April 2016
 /// Function to Deactivate a task
 /// </summary>
 /// <param name="gardenId"></param>
 /// <returns></returns>
 public bool DeactivateTask(int taskID)
 {
     try
     {
         return(JobAccessor.DeactivateTask(taskID));
     }
     catch (Exception ex)
     {
         throw new ApplicationException("Error Deactivating task!", ex);
     }
 }
Example #5
0
 /// <summary>
 /// Poonam Dubey
 /// 19th April 2016
 /// Function to Volunteer for a task
 /// </summary>
 /// <param name="taskID"></param>
 /// <param name="userID"></param>
 /// <returns></returns>
 public bool VolunteerForTask(int taskID, int userID)
 {
     try
     {
         return(JobAccessor.VolunteerForTask(taskID, userID));
     }
     catch (Exception ex)
     {
         throw new ApplicationException("Error Volunteering for task!", ex);
     }
 }
Example #6
0
 /// <summary>
 /// Poonam Dubey
 /// 14th April 2016
 /// Manager function to fetch tasks based on garden
 /// </summary>
 /// <param name="gardenId"></param>
 /// <returns></returns>
 public List <com.GreenThumb.BusinessObjects.Task> RetrieveTasksByGardenId(int gardenId)
 {
     try
     {
         return(JobAccessor.RetrieveTasksByGardenId(gardenId));
     }
     catch (Exception ex)
     {
         throw new ApplicationException("No records found!", ex);
     }
 }
Example #7
0
 /// <summary>
 /// created by: Steve Hoover
 /// Created: 4/1/2016
 /// </summary>
 /// <param name="userId"></param>
 /// <returns> get garden by user id/returns>
 public List <int> RetrieveGardenIdByUserId(int userId)
 {
     try
     {
         return(JobAccessor.RetrieveGardenIdByUserId(userId));
     }
     catch (Exception ex)
     {
         throw new ApplicationException("No records found!", ex);
     }
 }
Example #8
0
 /// <summary>
 /// created by: Steve Hoover
 /// Created: 4/1/2016
 /// </summary>
 /// <param name="userId"></param>
 /// <returns> get task  by garden id/returns>
 public List <Job> RetrieveJobByGardenId(int gardenId)
 {
     try
     {
         return(JobAccessor.RetrieveJobByGardenId(gardenId));
     }
     catch (Exception ex)
     {
         throw new ApplicationException("No records found!", ex);
     }
 }
Example #9
0
 /// <summary>
 /// created by: Nasr Mohammed
 /// Created: 3/4/2016
 /// </summary>
 /// <param name="job"></param>
 /// <returns> update the task record</returns>
 public bool EditTask(Job job, Job oldJob)
 {
     try
     {
         bool myJob = JobAccessor.UpdateTask(job, oldJob);
         Console.WriteLine(myJob);
         return(myJob);
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #10
0
        /// <summary>
        /// created by: Nasr Mohammed
        /// Created: 3/4/2016
        /// </summary>
        /// <param name="userID"></param>
        /// <returns> get a list of garden by userId</returns>
        public List <Garden> GetGardensForUser(int userID)
        {
            List <Garden> gardens = null;

            try
            {
                gardens = JobAccessor.RetrieveUsersGardens(userID);
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message);
            }

            return(gardens);
        }
Example #11
0
 /// <summary>
 /// created by: Nasr Mohammed
 /// Created: 3/4/2016
 /// </summary>
 /// <param name="job"></param>
 /// <returns> if it succssuful will add a task to database</returns>
 public bool AddNewTask(Job job)
 {
     try
     {
         if (JobAccessor.CreateTask(job) == 1)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }