public HttpResponseMessage GetTaskList(Int64 projectId, string filterOption) { List <MilestoneModel> Mlist = new List <MilestoneModel>(); List <MilestoneModel> Tlist = new List <MilestoneModel>(); PM_DashboardDL pd = new PM_DashboardDL(); DataTable dt = pd.GetMileStoneValues("Get_Project_Tasks", projectId, 0, filterOption); foreach (DataRow item in dt.Rows) { MilestoneModel mil = new MilestoneModel(); MilestoneModel tsk = new MilestoneModel(); tsk.TaskId = Convert.ToInt64(item["TaskId"].ToString()); tsk.PTaskId = Convert.ToInt64(item["PTaskId"].ToString()); tsk.Task = item["Task"].ToString(); tsk.Color = item["Color"].ToString(); tsk.ProjectId = Convert.ToInt64(item["ProjectId"].ToString()); tsk.ActualSites = Convert.ToInt32(item["ActualSites"].ToString()); tsk.TotalSites = Convert.ToInt32(item["TotalSites"].ToString()); mil.TaskId = Convert.ToInt64(item["TaskId"].ToString()); mil.PTaskId = Convert.ToInt64(item["PTaskId"].ToString()); mil.Task = item["Task"].ToString(); mil.Color = item["Color"].ToString(); mil.ProjectId = Convert.ToInt64(item["ProjectId"].ToString()); mil.ActualSites = Convert.ToInt32(item["ActualSites"].ToString()); mil.TotalSites = Convert.ToInt32(item["TotalSites"].ToString()); if (tsk.PTaskId == 0) { Mlist.Add(mil); } else { Tlist.Add(tsk); } } foreach (var mile in Mlist) { foreach (var task in Tlist) { if (task.PTaskId == mile.TaskId) { mile.Tasks = Tlist; break; } } } if (Mlist != null) { return(Request.CreateResponse(HttpStatusCode.OK, Mlist)); } else { return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Record with Id " + projectId.ToString() + " not found")); } }
public HttpResponseMessage GetRegionIssue(Int64 ProjectId) { PM_DashboardDL pd = new PM_DashboardDL(); DataTable dt = pd.GetMileStoneValues("Get_Region_Issue", ProjectId, 0); IEnumerable <Dictionary <string, object> > result = dt.Select().Select(x => x.ItemArray.Select((a, i) => new { Name = dt.Columns[i].ColumnName, Value = a }) .ToDictionary(a => a.Name, a => a.Value)); if (result != null) { return(Request.CreateResponse(HttpStatusCode.OK, result)); } else { return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Record with Id " + ProjectId.ToString() + " not found")); } }
public projectSummaryDTO GetSummaryCharts(string Filter, Int64 ProjectId = 0, Int64 MilestoneId = 0, string Value1 = "0", string TaskIds = null, string LocationIds = null, DateTime?FromDate = null, DateTime?ToDate = null, string SearchFilter = null, string FilterOption = null, string Request = "") { projectSummaryDTO obj = new projectSummaryDTO(); PM_DashboardDL pd = new PM_DashboardDL(); DataSet ds = pd.GetDashboardWO(Filter, ProjectId, 5, 0, "", TaskIds, LocationIds, FromDate, ToDate, null); DataTable dtSiteStatus = ds.Tables[0]; DataTable dtIssueDistribution = ds.Tables[1]; DataTable dtIssueAccountibility = ds.Tables[2]; obj.SiteStatus = dtSiteStatus.ToList <SiteStatusDTO>(); obj.IssueDistribution = dtIssueDistribution.ToList <IssueDistributionDTO>(); obj.IssueAccountibility = dtIssueAccountibility.ToList <IssueAccountibilityyDTO>(); //http://localhost:18460/swi/PM_SummayCharts?&filter=PROGRAM_SUMMARY&ProjectId=20021&MilestoneId=0&Value1=0&TaskIds=50076&LocationIds=163408,163409,163410,163411,163412,163413,163414,163415,163416,163405,163406,163407163408,163409,163410,163411,163412,163413,163414,163415,163416,163405,163406,163407&FromDate=12/31/2017&ToDate=1/31/2018 return(obj); }
public HttpResponseMessage PM_Dashboard(string Filter, Int64 ProjectId = 0, Int64 MilestoneId = 0, string Value1 = null, string TaskIds = null, string LocationIds = null, DateTime?FromDate = null, DateTime?ToDate = null, string SearchFilter = null, string FilterOption = null, int Page = 0, int Offset = 0, string MapStatus = null, string MapType = null) { PM_DashboardDL pd = new PM_DashboardDL(); //int Offset = (Page - 1) * 5; //Filter, ProjectId, MilestoneId, Value1, TaskIds, LocationIds, FromDate, ToDate, SearchFilter, FilterOption, 0, 0, MapStatus, MapType DataTable dt = pd.GetDashboardCharts(Filter, ProjectId, MilestoneId, Value1, TaskIds, LocationIds, FromDate, ToDate, SearchFilter, FilterOption, Page, Offset, MapStatus, MapType); IEnumerable <Dictionary <string, object> > result = dt.Select().Select(x => x.ItemArray.Select((a, i) => new { Name = dt.Columns[i].ColumnName, Value = a }) .ToDictionary(a => a.Name, a => a.Value)); if (result != null) { return(Request.CreateResponse(HttpStatusCode.OK, result)); } else { return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Record with Id " + ProjectId.ToString() + " not found")); } }