Subversion Repository Public Repository

ChrisCompleteCodeTrunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.IO;
using ActionTireCo.Crm.Model.View;
using ActionTireCo.Crm.Model.Database;

namespace ActionTireCo.Crm.Controllers
{
    public class ReportController : Controller
    {
        public ActionResult Index()
        {
            string path = Server.MapPath("~/Content/assets/json/reports.json");
            string json = System.IO.File.ReadAllText(path);
            List<ReportModel> reports = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ReportModel>>(json);
            return View(
                reports
            );
        }

        public ActionResult Run(int reportId, string startDate, string endDate)
        {
            string path = Server.MapPath("~/Content/assets/json/reports.json");
            string json = System.IO.File.ReadAllText(path);
            List<ReportModel> reports = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ReportModel>>(json);
            ReportModel report = (from r in reports where r.Id == reportId select r).SingleOrDefault<ReportModel>();
            int userId = ((User)Session["User"]).Id;
            DateTime reportStartDate = DateTime.Parse(startDate);
            DateTime reportEndDate = DateTime.Parse(endDate);
            return View();
        }
    }
}

Commits for ChrisCompleteCodeTrunk/ActionTireCo/ActionTireCo.Crm/Controllers/ReportController.cs

Diff revisions: vs.
Revision Author Commited Message
1 BBDSCHRIS picture BBDSCHRIS Wed 22 Aug, 2018 20:08:03 +0000