Exemple #1
0
        public OrderCommonDate GetOrderReport(string time)
        {
            var Order = new OrderCommonDate();

            using (LD_kursEntities db = new LD_kursEntities())
            {
                if (time == "3")
                {
                    Order        = db.Database.SqlQuery <OrderCommonDate>("OrderReportMonth").SingleOrDefault();
                    Order.Period = "Month";
                }
                else
                if (time == "2")
                {
                    Order        = db.Database.SqlQuery <OrderCommonDate>("OrderReportYear").SingleOrDefault();
                    Order.Period = "Year";
                }
                else
                {
                    Order        = db.Database.SqlQuery <OrderCommonDate>("OrderReportAllTime").SingleOrDefault();
                    Order.Period = "All period";
                }
            }

            return(Order);
        }
        public static Byte[] GetReport(OrderCommonDate report)
        {
            String Html = String.Concat(
                "<html>",
                "<head>",
                "<style>",
                "body {font-size:16}",
                ".id {text-align:center}",
                "</style>",
                "</head>",
                "<body>",
                "<h1 class=\"id\">Period:", report.Period, "<h1/>",
                "Land Size:", "<br />",
                "AVG:", report.AvgLandSize, "<br />",
                "Max:", report.MaxLandSize, "<br />",
                "Min:", report.MinLandSize, "<br />",
                "<br />",
                "<br />",
                "Work Count in sigle work:", "<br />",
                "AVG:", report.AvgWorkCount, "<br />",
                "Max:", report.MaxWorkCount, "<br />",
                "Min:", report.MinWorkCount, "<br />",
                "</body>",
                "</html>"
                );

            return(PdfSharpConvert(Html));
        }