// GET: IntelligenceReport
        public ActionResult Report(int?id)
        {
            CheckReport checkReport = new CheckReport();

            byte[] abytes = checkReport.PrepareReport(GetHistory(id));
            return(File(abytes, "application/pdf"));
        }
Ejemplo n.º 2
0
            public void Add(ReportData data)
            {
                CheckReport report = null;

                if (!reports.TryGetValue(data.Date.ToString("yyyy-MM-dd"), out report))
                {
                    report = new CheckReport();
                    reports[data.Date.ToString("yyyy-MM-dd")] = report;
                }

                var tmp = data as ActivityData;

                if (tmp != null)
                {
                    var val = string.Format("{0}_{1}", tmp.Type, tmp.ResultType);
                    report.Increment(val);
                    switch (tmp.Type)
                    {
                    case 1: report.State2 = val;
                        break;

                    case 2: report.State3 = val;
                        break;

                    case 3: report.State4 = val;
                        break;

                    case 4: report.State5 = val;
                        break;

                    case 5: report.State6 = val;
                        break;

                    case 6: report.State7 = val;
                        break;
                    }
                }
                else
                {
                    var tmp2 = data as CheckInData;
                    report.State1 = tmp2.State;
                    report.Increment(tmp2.State);
                }
                report.Date = data.Date.ToString("yyyy/MM/dd");
                report.Name = data.Name;
                report.No   = data.No;
            }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            IMessageHandler rookie    = new MessageHandler(new Checker("rookie", 5000));
            IMessageHandler sophomore = new MessageHandler(new Checker("sophomore", 10000));
            IMessageHandler junior    = new MessageHandler(new Checker("junior", 15000));
            IMessageHandler senior    = new MessageHandler(new Checker("senior", 20000));

            rookie.RegisterNext(sophomore);
            sophomore.RegisterNext(junior);
            junior.RegisterNext(senior);

            Console.WriteLine("Put some money to prove the service:");
            var total = Console.ReadLine();

            ICheckReport    report   = new CheckReport(int.Parse(total));
            HandlerResponse response = rookie.Check(report);

            Console.WriteLine("The response is {0}!", response);
            Console.ReadKey();
        }
Ejemplo n.º 4
0
            public void Add(ReportData data)
            {
                CheckReport report = null;
                if (!reports.TryGetValue(data.Date.ToString("yyyy-MM-dd"), out report))
                {
                    report = new CheckReport();
                    reports[data.Date.ToString("yyyy-MM-dd")] = report;
                }

                var tmp = data as ActivityData;
                if (tmp != null)
                {
                    var val = string.Format("{0}_{1}", tmp.Type, tmp.ResultType);
                    report.Increment(val);
                    switch (tmp.Type)
                    {
                        case 1: report.State2 = val;
                            break;
                        case 2: report.State3 = val;
                            break;
                        case 3: report.State4 = val;
                            break;
                        case 4: report.State5 = val;
                            break;
                        case 5: report.State6 = val;
                            break;
                        case 6: report.State7 = val;
                            break;
                    }
                }
                else
                {
                    var tmp2 = data as CheckInData;
                    report.State1 = tmp2.State;
                    report.Increment(tmp2.State);
                }
                report.Date = data.Date.ToString("yyyy/MM/dd");
                report.Name = data.Name;
                report.No = data.No;
            }