public JsonResult GetBarChartValue() { string ClientID = "d1b28dda-2cd0-44c8-af8f-b8914624ee5d"; BAL.ChartReportBAL objDashboard = new BAL.ChartReportBAL(); List <ENT.DashboardCards> lstResult = new List <ENT.DashboardCards>(); List <ENT.BarChartClass> jsonResult = new List <ENT.BarChartClass>(); if (ClientID == "d1b28dda-2cd0-44c8-af8f-b8914624ee5d") { lstResult = objDashboard.GetChartData(DateTime.Now, DateTime.Now, true); } else { lstResult = objDashboard.GetChartData(DateTime.Now, DateTime.Now, false); } foreach (ENT.DashboardCards el in lstResult) { ENT.BarChartClass obj = new ENT.BarChartClass(); obj.label = el.SerialNo; if (ClientID == "d1b28dda-2cd0-44c8-af8f-b8914624ee5d") { obj.value = el.EAC / 10; } else { obj.value = el.EAC; } jsonResult.Add(obj); } return(Json(jsonResult, JsonRequestBehavior.AllowGet)); }
public HttpResponseMessage GetInverterWiseEnergyProducedChart(Guid hdLoginID, string plantDate, bool isRequiredDevide) { BAL.DeviceDataBAL objDashboard = new BAL.DeviceDataBAL(); List <ENT.DashboardCards> lstResult = new List <ENT.DashboardCards>(); List <ENT.BarChartClass> jsonResult = new List <ENT.BarChartClass>(); try { DateTime dttm = DateTime.ParseExact(plantDate, "dd/MM/yyyy", CultureInfo.InvariantCulture); //if (hdLoginID.ToString().ToUpper() == "CDADA587-1678-4128-B37D-BA9E2B04E508" || hdLoginID.ToString().ToUpper() == "DBF3D275-0110-4D03-A519-7A777D18020E") if (hdLoginID.ToString().ToUpper() == "CDADA587-1678-4128-B37D-BA9E2B04E508" || hdLoginID.ToString().ToUpper() == "DBF3D275-0110-4D03-A519-7A777D18020E" || hdLoginID.ToString().ToUpper() == "307F425E-2A71-45DC-A528-0E45AAF510F2" || hdLoginID.ToString().ToUpper() == "E0A6FF76-F989-4CA6-AE90-EC32AAA0D33C" || hdLoginID.ToString().ToUpper() == "EB3123B4-6D53-42C5-BF2A-AEBA11257B51" || hdLoginID.ToString().ToUpper() == "B683B70B-5C1A-4275-96DE-9DCDE9101B3E" || hdLoginID.ToString().ToUpper() == "B29E4E42-17CB-4826-9E68-34A8B7236651" || hdLoginID.ToString().ToUpper() == "85C86141-B7C2-410D-A5C8-ECD7A5F325B9" || hdLoginID.ToString().ToUpper() == "A1B8C6E4-D5E4-44EC-8887-5A5227ED5AB4" || hdLoginID.ToString().ToUpper() == "36A5DCF4-A23D-404B-858C-65CBCBAEADE7" || hdLoginID.ToString().ToUpper() == "B4E5DB34-ADE6-4F0F-B5D1-4E0080479721" || hdLoginID.ToString().ToUpper() == "E8B87944-C9F9-4993-9655-830A6ECB4131" || hdLoginID.ToString().ToUpper() == "8C025B11-582B-4039-B923-CA343ECF01E7" || hdLoginID.ToString().ToUpper() == "6050DC30-4534-4F21-8D15-1EB40CBD28A8" || hdLoginID.ToString().ToUpper() == "9FE675A5-8021-4153-ADBB-A6A912365220" || hdLoginID.ToString().ToUpper() == "037BBBCC-435F-41A6-A962-02A2CFCD1257" || hdLoginID.ToString().ToUpper() == "AEACB764-2913-4B77-800E-9A300F4B2B5B" || hdLoginID.ToString().ToUpper() == "878FC146-7F86-434D-A82F-5F5AF79BE298" || hdLoginID.ToString().ToUpper() == "55A3AD81-3361-47E1-820F-ACC45547E810") { lstResult = objDashboard.GetChartData(dttm, dttm, true, hdLoginID); } else if (hdLoginID.ToString().ToUpper() == "654F9AC4-601D-4530-BB54-E667D037B1F3") { lstResult = objDashboard.GetChartDataExcluded(dttm, dttm, false, hdLoginID, "('1900763842','1900764245')"); List <ENT.DashboardCards> lstResultTop = new List <ENT.DashboardCards>(); lstResultTop = objDashboard.GetChartDataTop(dttm, dttm, true, hdLoginID, "('1900763842','1900764245')"); lstResult = lstResult.Concat(lstResultTop).ToList <ENT.DashboardCards>(); } else { lstResult = objDashboard.GetChartData(dttm, dttm, false, hdLoginID); } foreach (ENT.DashboardCards el in lstResult) { ENT.BarChartClass obj = new ENT.BarChartClass(); obj.label = el.SerialNo; if (hdLoginID.ToString().ToUpper() == "CDADA587-1678-4128-B37D-BA9E2B04E508" || hdLoginID.ToString().ToUpper() == "DBF3D275-0110-4D03-A519-7A777D18020E" || hdLoginID.ToString().ToUpper() == "EB3123B4-6D53-42C5-BF2A-AEBA11257B51" || hdLoginID.ToString().ToUpper() == "B683B70B-5C1A-4275-96DE-9DCDE9101B3E" || hdLoginID.ToString().ToUpper() == "B29E4E42-17CB-4826-9E68-34A8B7236651" || hdLoginID.ToString().ToUpper() == "85C86141-B7C2-410D-A5C8-ECD7A5F325B9" || hdLoginID.ToString().ToUpper() == "A1B8C6E4-D5E4-44EC-8887-5A5227ED5AB4" || hdLoginID.ToString().ToUpper() == "36A5DCF4-A23D-404B-858C-65CBCBAEADE7" || hdLoginID.ToString().ToUpper() == "B4E5DB34-ADE6-4F0F-B5D1-4E0080479721" || hdLoginID.ToString().ToUpper() == "E8B87944-C9F9-4993-9655-830A6ECB4131" || hdLoginID.ToString().ToUpper() == "8C025B11-582B-4039-B923-CA343ECF01E7" || hdLoginID.ToString().ToUpper() == "6050DC30-4534-4F21-8D15-1EB40CBD28A8" || hdLoginID.ToString().ToUpper() == "9FE675A5-8021-4153-ADBB-A6A912365220" || hdLoginID.ToString().ToUpper() == "037BBBCC-435F-41A6-A962-02A2CFCD1257" || hdLoginID.ToString().ToUpper() == "AEACB764-2913-4B77-800E-9A300F4B2B5B" || hdLoginID.ToString().ToUpper() == "878FC146-7F86-434D-A82F-5F5AF79BE298" || hdLoginID.ToString().ToUpper() == "55A3AD81-3361-47E1-820F-ACC45547E810") { obj.value = el.EAC; } else { obj.value = el.EAC; } if (isRequiredDevide) { obj.value = (obj.value / el.PerformsOfPlantUniteVolume); } jsonResult.Add(obj); } } catch (Exception ex) { return(ControllerContext.Request.CreateResponse(HttpStatusCode.InternalServerError, new { lstResult = jsonResult, errorMessage = ex.Message.ToString() })); } return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { lstResult = jsonResult })); }