private string ProcessNewMembersVisitorsPerMonthList(string year) { try { //string year = DateTime.Now.ToString("yyyy"); int[] newArrMembers = ChartDAO.GetXXPerMonthList(_context, "Yes", year); int[] newVisitorsArr = ChartDAO.GetXXPerMonthList(_context, "No", year); List <Chart> chartList = new List <Chart> { new Chart { data = newArrMembers, label = "Joined Member" }, new Chart { data = newVisitorsArr, label = "Visitors" } }; string joinedMemberJson = JsonConvert.SerializeObject(chartList); return(joinedMemberJson); } catch (Exception e) { return("ProcessNewMembersVisitorsPerMonthList Exception: " + e.ToString()); } }
private string ProcessVisitorsPerMonthList(string year) { try { int[] newVisitorsArr = ChartDAO.GetXXPerMonthList(_context, "No", year); List <Chart> chartList = new List <Chart> { new Chart { data = newVisitorsArr, label = "Visitors" } }; string joinedVisitorsJson = JsonConvert.SerializeObject(chartList); return(joinedVisitorsJson); } catch (Exception e) { return("ProcessVisitorsPerMonthList Exception: " + e.ToString()); } }