// <summary> /// Get the Summary report detais based on the search parameter. /// </summary> /// <param name="reportDetails">object</param> /// <param name="loginUserId">string</param> /// <returns>object</returns> public DMAnalyticsReult GetDMAnalyticsReportDetails(DMAnalyticsModel reportDetails, string loginUserId) { DMAnalyticsReult oReportModel = new DMAnalyticsReult(); try { using (var connection = Connection()) { var result = connection.QueryMultiple("Rpt_TurbineDM", new { Title = reportDetails.Title, Status = reportDetails.Status, UId = loginUserId, }, commandType: CommandType.StoredProcedure); oReportModel.DMAnalyticsHeading = result.Read <DMAnalyticsHeading>().ToList(); oReportModel.DMAnalyticsMessage = result.Read <DMAnalyticsMessage>().ToList(); oReportModel.DMAnalyticsDetail = result.Read <DMAnalyticsDetail>().ToList(); oReportModel.DMAnalyticsCompPending = result.Read <DMAnalyticsCompPending>().ToList(); } } catch (Exception ex) { //SaveErrorMessageInFile(oErrorMessage = new ErrorMessage { UserId = loginUserId, ModuleName = "Report", MethodName = "GetSummaryReportDetails", Exception = ex.Message }); logger.Error(ex.Message); } return(oReportModel); }
public JsonResult GetDMAnalyticsDetails(DMAnalyticsModel reportDetails) { string Data1 = ""; DataTable dtNew = null; DMAnalyticsReult result = oReportManager.GetDMAnalyticsReportDetails(reportDetails, CookieManager.GetCookie(CookieManager.CookieName).logindetail.EmpID); if (result.DMAnalyticsDetail != null && result.DMAnalyticsDetail.Count > 0) { DataTable dt = ToDataTable <DMAnalyticsDetail>(result.DMAnalyticsDetail); dtNew = GenerateTransposedTable(dt); if (dtNew.Rows.Count > 0) { string _tmpLabel = "", _tmpDataValue = ""; DataTable dtFinal = new DataTable(); dtFinal.Clear(); dtFinal.Columns.Add("Label"); dtFinal.Columns.Add("Data"); for (int i = 0; i < dtNew.Rows.Count; i++) { _tmpLabel = _tmpDataValue = ""; for (int rCount = 1; rCount < dtNew.Columns.Count; rCount++) { _tmpLabel = dtNew.Rows[i][0].ToString(); _tmpDataValue += _tmpDataValue.Length > 0 ? "," + dtNew.Rows[i][rCount].ToString() : dtNew.Rows[i][rCount].ToString(); } DataRow _row = dtFinal.NewRow(); _row["Label"] = _tmpLabel; _row["Data"] = _tmpDataValue; dtFinal.Rows.Add(_row); } Data1 = JsonConvert.SerializeObject(dtFinal); } } return(Json(new { Data1, result }, JsonRequestBehavior.AllowGet)); }