Exemple #1
0
        public HttpResponseMessage GetTaskList(string standardEffDate, int?siteId, int?programId, int?assignedToUserId, int?assignedByUserId)
        {
            try
            {
                var taskList = TaskServices.GetTaskList(standardEffDate, siteId, programId, assignedToUserId, assignedByUserId);

                if (taskList != null)
                {
                    taskList.ForEach(m =>
                    {
                        m.TaskName   = (m.TaskName.Length > 25 ? m.TaskName.Substring(0, 24) + "...." : m.TaskName);
                        m.TracerName = (m.TracerName.Trim().EndsWith("-") ? m.TracerName.Trim().Replace("-", "") : m.TracerName);
                        m.Std        = m.TaskTypeID == 5 & m.TracerResponseID > 0 ? TracerService.GetAllsStdsByTracerQuestion(m.TracerCustomID, m.TracerResponseID, m.TracerQuestionID, false) : m.Std;
                    });

                    return(Request.CreateResponse(HttpStatusCode.OK, taskList));
                }

                return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "No Tasks Found"));
            }
            catch (Exception ex)
            {
                ex.Data.Add("SiteID", siteId);
                ex.Data.Add("HTTPReferrer", "JCRAPI/TaskInfo/GetTaskList");
                WebExceptionHelper.LogException(ex, null);
                return(null);
            }
        }