コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Response.Redirect("offline.aspx");

            navHTML = GlobalData.navHTML;

            DateTime requestedDate = DateTime.Now;
            greatestDashDate = requestedDate.AddDays(-1).ToString();

             //Date Querystring
            if (!string.IsNullOrEmpty(Request.QueryString["d"]))
            {
                try{
                    requestedDate = Convert.ToDateTime(Request.QueryString["d"]);
                    thisDate = requestedDate.ToShortDateString();
                }
                catch { thisDate = requestedDate.AddDays(-1).ToString(); }
            }
            else thisDate = requestedDate.AddDays(-1).ToString();

            //Page QueryString
            if (!string.IsNullOrEmpty(Request.QueryString["p"])) thisPage = Request.QueryString["p"];
            else thisPage = "realtouch";
            foreach (Pages pgs in GlobalData.menuElements) {
                if (pgs.name == thisPage)
                {
                    currentSproc = pgs.sproc;
                    currentPage = pgs.label;
                }
            }

            de = new DashElements(currentSproc, requestedDate, .20, .20);
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DateTime requestedDate = new DateTime();
            if (!string.IsNullOrEmpty(Request.QueryString["d"]))
            {
                try { requestedDate = Convert.ToDateTime(Request.QueryString["d"]); }
                catch { }
            }

            DashElements de = new DashElements("rpt.spDashboardMetricsRT", requestedDate, .20 , .20);
            reportDate = de.dashDate;
            reportDateRaw = de.dashDateRaw;
            salesLineGraph = de.salesLineGraph;
            salesHtml = de.salesHtml;
            newClientsHtml = de.newClientsHtml;
            consumptionHmtl = de.consumptionHmtl;
            consumptionLineGraph = de.consumptionLineGraph;
            //prev90LineGraph = de.prev90LineGraph;

            kpiHighOffset = GlobalData.kpiHighOffset.ToString();
            kpiLowOffset = GlobalData.kpiLowOffset.ToString();

            //metricData = dbi.buildRTdashHTML(new DateTime());
            # region Old Code
            /*
            DataSet ds = new DataSet();
            ds = GlobalData.getDashElements("rpt.spDashboardMetricsRT", dt);

            foreach (DataTable t in ds.Tables)
            {
                switch (t.Rows[0]["ds"].ToString())
                {
                    case "Dollars":
                        foreach (DataRow r in t.Rows)
                        {
                            date = r["ActivityDate"].ToString();
                            date = date.Substring(0, date.IndexOf(' '));
                            metricData += dbi.DashboardA(
                                r["MetricLabel"].ToString(),
                                r["TrendingSalesDollars"].ToString(),
                                r["AvgSalesDollars"].ToString(),
                                r["PreviousSalesDollars"].ToString(),
                                r["SalesDollars"].ToString());
                        }
                        break;
                    case "Count":
                        foreach (DataRow r in t.Rows)
                        {
                            date = r["ActivityDate"].ToString();
                            date = date.Substring(0, date.IndexOf(' '));
                            metricData += dbi.DashboardA(
                                r["MetricLabel"].ToString(),
                                r["TrendingCount"].ToString(),
                                r["AvgCount"].ToString(),
                                r["PreviousCount"].ToString(),
                                r["MetricCount"].ToString());
                        }
                        break;

                    case "Graph":
                        foreach (DataRow r in t.Rows)
                        {
                            metricData += r["Trending"].ToString() + "\n\n";

                        }
                        break;
                }

            }
             * */

            # endregion
        }