public JsonResult GetLocationData(string type, string startDate, string endDate) { string json = string.Empty; ReportsStatisticsModel reportsModel = new ReportsStatisticsModel(); List <ReportsStatisticsModel> reportsList = new List <ReportsStatisticsModel>(); ReportsStatisticsBase reportsBase = new ReportsStatisticsBase(); reportsBase.Type = type; reportsBase.StartDate = startDate; reportsBase.EndDate = endDate; actionResult = reportsAction.LocationCount_Graph(reportsBase); if (actionResult.IsSuccess) { json += "{\"LocationCount\":[ "; foreach (DataRow dr in actionResult.dtResult.Rows) { json += "{\"results\":\"" + dr["results"].ToString() + "\",\"ShortLocation\":\"" + dr["Location"].ToString() + "\"},"; } json = json.TrimEnd(',') + "]}"; } return(Json(json, JsonRequestBehavior.AllowGet)); }
public JsonResult EmployeeVariance_print(string type, string startDate, string endDate) { ReportsStatisticsModel reportsModel = new ReportsStatisticsModel(); string json = string.Empty; List <ReportsStatisticsModel> reportsList = new List <ReportsStatisticsModel>(); try { ReportsStatisticsBase reportsBase = new ReportsStatisticsBase(); reportsBase.Type = type; reportsBase.StartDate = startDate; reportsBase.EndDate = endDate; actionResult = reportsAction.EmployeeVariance_print(reportsBase); if (actionResult.IsSuccess) { reportsList = CommonMethods.ConvertTo <ReportsStatisticsModel>(actionResult.dtResult); } else { json = "fail"; } reportsModel.reportsStatisticsList = reportsList; } catch (Exception ex) { json = "-1"; ErrorReporting.WebApplicationError(ex); } return(Json(reportsList, JsonRequestBehavior.AllowGet)); }
public ActionResult LocationCount_Graph(ReportsStatisticsBase reports) { actionResult = new ActionResult(); try { actionResult.dtResult = reportsDL.LocationCount_Graph(reports); if (actionResult.dtResult != null && actionResult.dtResult.Rows.Count > 0) { actionResult.IsSuccess = true; } } catch (Exception ex) { throw ex; } return(actionResult); }
public ActionResult EmployeeVariance_print(ReportsStatisticsBase reports) { actionResult = new ActionResult(); try { actionResult.dtResult = reportsDL.EmployeeVariance_print(reports); if (actionResult.dtResult != null && actionResult.dtResult.Rows.Count > 0) { actionResult.IsSuccess = true; } } catch (Exception ex) { throw ex; } return(actionResult); }
public DataTable LocationCount_Graph(ReportsStatisticsBase reports) { dtContainer = new DataTable(); dsContainer = new DataSet(); try { MyParameter[] myparams = { new MyParameter("@ReportType", reports.Type), new MyParameter("@StartDate", reports.StartDate), new MyParameter("@EndDate", reports.EndDate) }; Common.Set_Procedures("LocationCount_Graph"); Common.Set_ParameterLength(myparams.Length); Common.Set_Parameters(myparams); dtContainer = Common.Execute_Procedures_LoadData(); } catch (Exception ex) { throw ex; } return(dtContainer); }
public DataTable MoneyRecovered_print(ReportsStatisticsBase reports) { dtContainer = new DataTable(); dsContainer = new DataSet(); try { MyParameter[] myparams = { new MyParameter("@StartDate", reports.StartDate), new MyParameter("@EndDate", reports.EndDate), new MyParameter("@ShortLocation", reports.ShortLocation) }; Common.Set_Procedures("MoneyRecovered_print"); Common.Set_ParameterLength(myparams.Length); Common.Set_Parameters(myparams); dtContainer = Common.Execute_Procedures_LoadData(); } catch (Exception ex) { throw ex; } return(dtContainer); }