private void Page_Load(object sender, System.EventArgs e)
        {
            int x = -1;
//			int y = 0;
//			int rowCnt = 7;
//			int rowCtr=0;
//			int cellCtr=0;
//			int cellCnt = 3;
            string sFName;

            long[] LASpecific = new long[7];
            long[] LAGeneral  = new long[7];
            long[] LAStopCode = new long[7];
//			long lTemp=0,lTotalAnon=0,lTotalCustomer=0;
            Object[] yValues             = new Object[7];
            Object[] xValues             = new Object[7];
            Object[] yValues1            = new Object[3];
            Object[] xValues1            = new Object[3];
            OCAData.CCountDailyClass rpt = new OCAData.CCountDailyClass();

            System.DateTime dDate = new System.DateTime(System.DateTime.Now.Year, System.DateTime.Now.Month,
                                                        System.DateTime.Now.Day);
            OWC.WCChart oChart;
//			OWC.WCChart oChart1;
            OWC.ChartSpaceClass oSpace  = new OWC.ChartSpaceClass();
            OWC.ChartSpaceClass oSpace1 = new OWC.ChartSpaceClass();
            OWC.WCSeries        oSeries;
//			OWC.WCSeries oSeries1;
//			OWC.WCDataLabels oLabels;
//			OWC.WCDataLabelsCollection oLabelCollection;

            //System.Array xValues = System.Array.CreateInstance(typeof(Object), 7, 1);
            //Array xValues = Array.CreateInstance(typeof(Object),3);
            Server.ScriptTimeout = 360;

            oSpace.Clear();
            oSpace.Refresh();
            oChart           = oSpace.Charts.Add(0);
            oChart.Type      = OWC.ChartChartTypeEnum.chChartTypeBarClustered;
            oChart.HasLegend = true;
            //Begin Image One
            for (x = 0; x < 7; x++)
            {
                oSeries = oChart.SeriesCollection.Add(x);
                try
                {
                    LASpecific[x] = rpt.GetSpecificSolutions(dDate.AddDays(-(x + 1)));
                }
                catch
                {
                    LASpecific[x] = 0;
                }
                try
                {
                    LAGeneral[x] = rpt.GetGeneralSolutions(dDate.AddDays(-(x + 1)));
                }
                catch
                {
                    LAGeneral[x] = 0;
                }
                try
                {
                    LAStopCode[x] = rpt.GetStopCodeSolutions(dDate.AddDays(-(x + 1)));
                }
                catch
                {
                    LAStopCode[x] = 0;
                }
                xValues.SetValue(LASpecific[x], 0);
                xValues.SetValue(LAGeneral[x], 1);
                xValues.SetValue(LAStopCode[x], 2);
                yValues.SetValue("Specific", 0);
                yValues.SetValue("General", 1);
                yValues.SetValue("StopCode", 2);
                oChart.HasTitle      = true;
                oChart.Title.Caption = "Daily Solution Status";
                oSeries.Caption      = dDate.AddDays(-(x + 1)).Date.ToString();                 //chDimCategories
                oSeries.SetData(OWC.ChartDimensionsEnum.chDimCategories, -1, yValues);
                oSeries.SetData(OWC.ChartDimensionsEnum.chDimValues, -1, xValues);
                oSeries.Type = OWC.ChartChartTypeEnum.chChartTypeColumnClustered;
            }

            sFName = "DailySolution";
            oSpace.ExportPicture(Server.MapPath(sFName), "gif", 1000, 512);
            imgDailySolution.ImageUrl = sFName;
        }
        private void Page_Load(object sender, System.EventArgs e)
        {
            int    rowCnt  = 1;
            int    rowCtr  = 0;
            int    cellCtr = 0;
            int    cellCnt = 4;
            string sFName;
            long   lACount;
            long   LAWatson;
            long   LAArchive;
            long   lCount = 0;

            Object[]      yValues = new Object[7];
            Object[]      xValues = new Object[7];
            SqlConnection cn      = new SqlConnection("Persist Security Info=False;Pwd=ocarpts@2;User ID=ocarpts;Initial Catalog=SnapShot;Data Source=TKWUCDSQLA02");
            SqlCommand    cm      = new SqlCommand();
            SqlDataReader dr;
            string        sPath;

            OCAData.CCountDailyClass rpt = new OCAData.CCountDailyClass();

            System.DateTime dDate = new System.DateTime(System.DateTime.Now.Year, System.DateTime.Now.Month,
                                                        System.DateTime.Now.Day);
            OWC.WCChart         oChart, oChart1;
            OWC.ChartSpaceClass oSpace = new OWC.ChartSpaceClass();
            OWC.ChartSpaceClass oSpace1 = new OWC.ChartSpaceClass();
            OWC.WCSeries        oSeries, oSeries1;


            cn.Open();
            cm.CommandType    = CommandType.StoredProcedure;
            cm.CommandTimeout = 240;
            cm.CommandText    = "GetDailySnapshot";
            cm.Connection     = cn;
            cm.Parameters.Add("@CreatedDate", System.Data.SqlDbType.DateTime);
            cm.Parameters["@CreatedDate"].Value = dDate.AddDays(-1);
            dr = cm.ExecuteReader();
            try
            {
                dr.Read();
                LAWatson  = dr.GetInt32(0);
                LAArchive = dr.GetInt32(1);
            }
            catch
            {
                LAWatson  = 0;
                LAArchive = 0;
            }

            oSpace.Clear();
            oSpace.Refresh();
            oChart      = oSpace.Charts.Add(0);
            oChart.Type = OWC.ChartChartTypeEnum.chChartTypeBarClustered;
            oSeries     = oChart.SeriesCollection.Add(0);
            lACount     = rpt.GetDailyCount(dDate.AddDays(-1));



            xValues.SetValue(lACount.ToString(), 0);
            xValues.SetValue(LAWatson.ToString(), 1);
            xValues.SetValue(LAArchive.ToString(), 2);
            yValues.SetValue("Database", 0);
            yValues.SetValue("Watson", 1);
            yValues.SetValue("Archive", 2);
            oChart.HasTitle      = true;
            oChart.Title.Caption = "Database - Server Comparison Chart";
            oSeries.Caption      = dDate.Date.ToString();               //chDimCategories
            oSeries.SetData(OWC.ChartDimensionsEnum.chDimCategories, -1, yValues);
            oSeries.SetData(OWC.ChartDimensionsEnum.chDimValues, -1, xValues);
            oSeries.Type = OWC.ChartChartTypeEnum.chChartTypeColumnClustered;
            sFName       = "Daily";

            sPath = Server.MapPath(sFName);
            try
            {
                oSpace.ExportPicture(sPath, "gif", 707, 476);
                imgWeekly.ImageUrl = sFName;
            }
            catch
            {
            }
//			Response.Write(Server.MapPath(sFName));

            oSpace1.Clear();
            oSpace1.Refresh();
            oChart1      = oSpace1.Charts.Add(0);
            oChart1.Type = OWC.ChartChartTypeEnum.chChartTypeBarClustered;
            oSeries1     = oChart1.SeriesCollection.Add(0);



            for (rowCtr = 0; rowCtr <= rowCnt; rowCtr++)
            {
                TableRow tRow = new TableRow();
                tblUploads.Rows.Add(tRow);
                for (cellCtr = 1; cellCtr <= cellCnt; cellCtr++)
                {
                    TableCell tCell = new TableCell();

                    if (rowCtr == 0)
                    {
                        switch (cellCtr)
                        {
                        case 1:
                            tCell.Text = "Date";
                            break;

                        case 2:
                            tCell.Text = "DB Count";
                            break;

                        case 3:
                            tCell.Text = "Watson";
                            break;

                        case 4:
                            tCell.Text = "Archive";
                            break;

                        default:
                            tCell.Text = "0";
                            break;
                        }
                        tCell.Style["font-size"] = "small";
                    }
                    else
                    {
                        switch (cellCtr)
                        {
                        case 1:
                            tCell.Text = dDate.AddDays(-1).ToShortDateString();
                            break;

                        case 2:
                            tCell.Text = lACount.ToString();
                            break;

                        case 3:
                            tCell.Text = LAWatson.ToString();
                            break;

                        case 4:
                            tCell.Text = LAArchive.ToString();
                            break;

                        default:
                            tCell.Text = "0";
                            break;
                        }
                        tCell.Style["background-color"] = "white";
                        tCell.Style["font-size"]        = "x-small";
                        tCell.Style["color"]            = "#6487dc";
                        tCell.Style["font-weight"]      = "Bold";
                    }
                    tCell.Style["font-family"] = "Tahoma";
                    tRow.Cells.Add(tCell);
                }
            }

            for (rowCtr = 0; rowCtr <= rowCnt; rowCtr++)
            {
                TableRow tRow = new TableRow();
                tblDifference.Rows.Add(tRow);
                for (cellCtr = 1; cellCtr <= cellCnt; cellCtr++)
                {
                    TableCell tCell = new TableCell();

                    if (rowCtr == 0)
                    {
                        switch (cellCtr)
                        {
                        case 1:
                            tCell.Text = "Date";
                            break;

                        case 2:
                            tCell.Text = "Archive vs Watson";
                            break;

                        case 3:
                            tCell.Text = "SQL vs Archive";
                            break;

                        case 4:
                            tCell.Text = "SQL vs Watson";
                            break;

                        default:
                            tCell.Text = "0";
                            break;
                        }
                        tCell.Style["font-size"] = "small";
                    }
                    else
                    {
                        switch (cellCtr)
                        {
                        case 1:
                            tCell.Text = dDate.AddDays(-1).ToShortDateString();
                            break;

                        case 2:
                            lCount     = LAArchive - LAWatson;
                            tCell.Text = lCount.ToString();
                            break;

                        case 3:
                            lCount     = lACount - LAArchive;
                            tCell.Text = lCount.ToString();;
                            break;

                        case 4:
                            lCount     = lACount - LAWatson;
                            tCell.Text = lCount.ToString();
                            break;

                        default:
                            tCell.Text = "0";
                            break;
                        }
                        tCell.Style["background-color"] = "white";
                        tCell.Style["font-size"]        = "x-small";
                        tCell.Style["color"]            = "#6487dc";
                        tCell.Style["font-weight"]      = "Bold";
                    }
                    tCell.Style["font-family"] = "Tahoma";
                    tRow.Cells.Add(tCell);
                }
            }
        }
        /*************************************************************************************
        *	module: anoncustomer.aspx.cs - Page_Load
        *
        *	author: Tim Ragain
        *	date: Jan 22, 2002
        *
        *	Purpose: to Create both gif charts from the Office Watson Controls and set the images to those
        *	files.  Create OCAData object and return data for anonymous versus customer uploads.  Set the information
        *	in the tables to correspond to the graphs.
        *************************************************************************************/
        private void Page_Load(object sender, System.EventArgs e)
        {
            int    x       = -1;
            int    rowCnt  = 7;
            int    rowCtr  = 0;
            int    cellCtr = 0;
            int    cellCnt = 3;
            string sFName;

            long[] LACustomer = new long[7];
            long[] LAAnon = new long[7];
            long   lTemp = 0, lTotalAnon = 0, lTotalCustomer = 0;

            Object[] yCustomerCol        = new Object[7];
            Object[] xAonCol             = new Object[7];
            Object[] yCustomerValues     = new Object[2];
            Object[] xAnonValues         = new Object[2];
            OCAData.CCountDailyClass rpt = new OCAData.CCountDailyClass();

            System.DateTime dDate = new System.DateTime(System.DateTime.Now.Year, System.DateTime.Now.Month,
                                                        System.DateTime.Now.Day);
            OWC.WCChart                oWeeklyChart, oRatioChart;
            OWC.ChartSpaceClass        oSpace  = new OWC.ChartSpaceClass();
            OWC.ChartSpaceClass        oSpace1 = new OWC.ChartSpaceClass();
            OWC.WCSeries               oSeries1;
            OWC.WCDataLabels           oLabels;
            OWC.WCDataLabelsCollection oLabelCollection;


            oSpace.Clear();
            oSpace.Refresh();
            oWeeklyChart           = oSpace.Charts.Add(0);
            oWeeklyChart.HasLegend = true;
            //Begin Image One
            for (x = 0; x < 2; x++)
            {
                oWeeklyChart.SeriesCollection.Add(x);
            }
            for (x = 0; x < 7; x++)
            {
                LACustomer[x] = rpt.GetDailyCount(dDate.AddDays(-(x + 1)));
                try
                {
                    LAAnon[x] = rpt.GetDailyAnon(dDate.AddDays(-(x + 1)));
                }
                catch
                {
                    LAAnon[x] = 0;
                }
                if (LACustomer[x] > LAAnon[x])
                {
//					xAonCol.SetValue((LACustomer[x] - LAAnon[x]), 0);
                    lTotalCustomer = lTotalCustomer + (LACustomer[x] - LAAnon[x]);
                }
                else
                {
//					xAonCol.SetValue((LAAnon[x] - LACustomer[x]), 0);
                    lTotalCustomer = lTotalCustomer + (LAAnon[x] - LACustomer[x]);
                }
                lTotalAnon = lTotalAnon + LAAnon[x];
            }
//*******************************************************************************************************
            oWeeklyChart.HasTitle      = true;
            oWeeklyChart.Title.Caption = "Database - Anonymouse vs Customer";
            for (x = 0; x < 6; x++)
            {
                xAonCol[x] = LAAnon[x].ToString();
            }
            oWeeklyChart.SeriesCollection[0].Caption = "Anonymous";
            oWeeklyChart.SeriesCollection[0].SetData(OWC.ChartDimensionsEnum.chDimValues, -1, xAonCol);
            for (x = 0; x < 6; x++)
            {
                if (LACustomer[x] > LAAnon[x])
                {
                    lTemp      = LACustomer[x] - LAAnon[x];
                    xAonCol[x] = lTemp.ToString();
                }
                else
                {
                    lTemp      = LAAnon[x] - LACustomer[x];
                    xAonCol[x] = lTemp.ToString();
                }
            }
            oWeeklyChart.SeriesCollection[1].Caption = "Customer";
            oWeeklyChart.SeriesCollection[1].SetData(OWC.ChartDimensionsEnum.chDimValues, -1, xAonCol);
            for (x = 0; x < 6; x++)
            {
                xAonCol.SetValue(dDate.AddDays(x).ToShortDateString(), x);
            }
            oWeeklyChart.SeriesCollection[0].SetData(OWC.ChartDimensionsEnum.chDimCategories, -1, xAonCol);
//*******************************************************************************************************
            sFName = "Anon";
            try
            {
                oSpace.ExportPicture(Server.MapPath(sFName), "gif", 707, 476);
                imgAnonDaily1.ImageUrl = sFName;
            }
            catch
            {
            }

            //End Image one


            //Begin Image Two
            oSpace1.Clear();
            oSpace1.Refresh();
            oRatioChart           = oSpace1.Charts.Add(0);
            oRatioChart.Type      = OWC.ChartChartTypeEnum.chChartTypeBarClustered;
            oRatioChart.HasLegend = true;

            lTemp            = lTotalCustomer + lTotalAnon;
            oSeries1         = oRatioChart.SeriesCollection.Add(0);
            oLabelCollection = oSeries1.DataLabelsCollection;

            oLabels = oLabelCollection.Add();
            oLabels.HasPercentage = true;
            oLabels.HasValue      = false;


            xAnonValues.SetValue(lTotalAnon.ToString(), 0);
            xAnonValues.SetValue(lTotalCustomer.ToString(), 1);
            yCustomerValues.SetValue("Anonymous", 0);
            yCustomerValues.SetValue("Customer", 1);
            oRatioChart.HasTitle      = true;
            oRatioChart.Title.Caption = "Database - Average Weekly Uploads";
            oSeries1.Caption          = "Average Weekly";       //chDimCategories
            oSeries1.SetData(OWC.ChartDimensionsEnum.chDimCategories, -1, yCustomerValues);
            oSeries1.SetData(OWC.ChartDimensionsEnum.chDimValues, -1, xAnonValues);
            oSeries1.Type = OWC.ChartChartTypeEnum.chChartTypePie;

            sFName = "AnonPer";
            try
            {
                oSpace1.ExportPicture(Server.MapPath(sFName), "gif", 707, 476);
                imgAnonTotal.ImageUrl = sFName;
            }
            catch
            {
            }

            //End Image Two

            //Begin Table
            for (rowCtr = 0; rowCtr <= rowCnt; rowCtr++)
            {
                TableRow tRow = new TableRow();
                tblAnonCustomer.Rows.Add(tRow);
                //tRow.CssClass = "clsTRMenu";
                for (cellCtr = 1; cellCtr <= cellCnt; cellCtr++)
                {
                    TableCell tCell = new TableCell();

                    if (rowCtr == 0)
                    {
                        switch (cellCtr)
                        {
                        case 1:
                            tCell.Text = "Date";
                            break;

                        case 2:
                            tCell.Text = "Anonymous";
                            break;

                        case 3:
                            tCell.Text = "Customer";
                            break;

                        default:
                            tCell.Text = "0";
                            break;
                        }
                        tCell.Style["font-size"] = "small";
                    }
                    else
                    {
                        switch (cellCtr)
                        {
                        case 1:
                            tCell.Text = dDate.AddDays(-rowCtr).ToShortDateString();
                            break;

                        case 2:
                            tCell.Text = LAAnon[rowCtr - 1].ToString();
                            break;

                        case 3:
                            if (LAAnon[rowCtr - 1] > LACustomer[rowCtr - 1])
                            {
                                lTemp = LAAnon[rowCtr - 1] - LACustomer[rowCtr - 1];
                            }
                            else
                            {
                                lTemp = LACustomer[rowCtr - 1] - LAAnon[rowCtr - 1];
                            }
                            tCell.Text = lTemp.ToString();
                            break;

                        default:
                            tCell.Text = "0";
                            break;
                        }
                        tCell.Style["background-color"] = "white";
                        tCell.Style["font-size"]        = "small-x";
                        tCell.Style["color"]            = "#6487dc";
                        tCell.Style["font-weight"]      = "Bold";
                    }
                    tCell.Style["font-family"] = "Tahoma";
                    tRow.Cells.Add(tCell);
                }
            }

            //End Table
        }
        /*************************************************************************************
        *	module: automanual.aspx.cs - Page_Load
        *
        *	author: Tim Ragain
        *	date: Jan 22, 2002
        *
        *	Purpose: to Create both gif charts from the Office Watson Controls and set the images to those
        *	files.  Create OCAData object and return data for anonymous versus customer uploads.  Set the information
        *	in the tables to correspond to the graphs.
        *************************************************************************************/
        private void Page_Load(object sender, System.EventArgs e)
        {
            int    x       = -1;
            int    y       = 0;
            int    rowCnt  = 7;
            int    rowCtr  = 0;
            int    cellCtr = 0;
            int    cellCnt = 3;
            string sFName;

            long[] LACustomer = new long[7];
            long[] LAAnon = new long[7];
            long[] LANulls = new long[7];
            long   lTemp = 0, lTotalAnon = 0, lTotalCustomer = 0;

            Object[] yColTitle           = new Object[7];
            Object[] xAutoManValues      = new Object[7];
            Object[] yColTitle2          = new Object[3];
            Object[] xAutoManValues2     = new Object[3];
            OCAData.CCountDailyClass rpt = new OCAData.CCountDailyClass();

            System.DateTime dDate = new System.DateTime(System.DateTime.Now.Year, System.DateTime.Now.Month,
                                                        System.DateTime.Now.Day);
            OWC.WCChart                oWeeklyChart, oAvgChart;
            OWC.ChartSpaceClass        oSpace = new OWC.ChartSpaceClass();
            OWC.ChartSpaceClass        oSpace1 = new OWC.ChartSpaceClass();
            OWC.WCSeries               oSeries, oSeries1;
            OWC.WCDataLabels           oLabels;
            OWC.WCDataLabelsCollection oLabelCollection;
            SqlConnection              cn = new SqlConnection("Persist Security Info=False;Pwd=ocarpts@2;User ID=ocarpts;Initial Catalog=SnapShot;Data Source=TKWUCDSQLA02");
            SqlCommand    cm = new SqlCommand();
            SqlDataReader dr;

            oSpace.Clear();
            oSpace.Refresh();
            oWeeklyChart           = oSpace.Charts.Add(0);
            oWeeklyChart.Type      = OWC.ChartChartTypeEnum.chChartTypeBarClustered;
            oWeeklyChart.HasLegend = true;
            cn.Open();
            cm.CommandType    = CommandType.StoredProcedure;
            cm.CommandTimeout = 240;
            cm.CommandText    = "GetSnapshot";
            cm.Connection     = cn;
            cm.Parameters.Add("@CreatedDate", System.Data.SqlDbType.DateTime);
            cm.Parameters["@CreatedDate"].Value = dDate.AddDays(-1);
            dr = cm.ExecuteReader();
            for (x = 0; x < 7; x++)
            {
                try
                {
                    dr.Read();
                    lTotalCustomer = dr.GetInt32(3);
                    //				LAAnon[x] = lTotalCustomer;
                    lTemp          = dr.GetInt32(4);
                    LAAnon[x]      = lTemp;
                    lTemp          = lTotalCustomer - lTemp;
                    LACustomer[x]  = lTemp;
                    lTotalCustomer = lTotalCustomer + LACustomer[x];
                    lTotalAnon     = lTotalAnon + lTemp;
                }
                catch
                {
                    LAAnon[x]     = 0;
                    lTemp         = 0;
                    LACustomer[x] = 0;
                }
            }
            //Begin Image One

            for (x = 0, y = 6; x < 7; x++, y--)
            {
                oSeries = oWeeklyChart.SeriesCollection.Add(x);
                xAutoManValues.SetValue(LACustomer[x].ToString(), 0);
                xAutoManValues.SetValue(LAAnon[x].ToString(), 1);

                yColTitle.SetValue("Auto", 0);
                yColTitle.SetValue("Manual", 1);
                oWeeklyChart.HasTitle      = true;
                oWeeklyChart.Title.Caption = "Database - Manual vs Auto Uploads";
                oSeries.Caption            = dDate.AddDays(-y).Date.ToString();         //chDimCategories
                oSeries.SetData(OWC.ChartDimensionsEnum.chDimCategories, -1, yColTitle);
                oSeries.SetData(OWC.ChartDimensionsEnum.chDimValues, -1, xAutoManValues);
                oSeries.Type = OWC.ChartChartTypeEnum.chChartTypeColumnClustered;
            }

            sFName = "Anon";
            try
            {
                oSpace.ExportPicture(Server.MapPath(sFName), "gif", 707, 476);
                imgAutoManualDaily.ImageUrl = sFName;
            }
            catch
            {
            }

            //End Image one


            //Begin Image Two
            oSpace1.Clear();
            oSpace1.Refresh();
            oAvgChart           = oSpace1.Charts.Add(0);
            oAvgChart.Type      = OWC.ChartChartTypeEnum.chChartTypeBarClustered;
            oAvgChart.HasLegend = true;

            lTemp            = lTotalCustomer + lTotalAnon;
            oSeries1         = oAvgChart.SeriesCollection.Add(0);
            oLabelCollection = oSeries1.DataLabelsCollection;

            oLabels = oLabelCollection.Add();
            oLabels.HasPercentage = true;
            oLabels.HasValue      = false;


            xAutoManValues2.SetValue(lTotalAnon.ToString(), 0);
            xAutoManValues2.SetValue(lTotalCustomer.ToString(), 1);
            yColTitle2.SetValue("Manual", 0);
            yColTitle2.SetValue("Auto", 1);
            oAvgChart.HasTitle      = true;
            oAvgChart.Title.Caption = "Database - Average Weekly Uploads";
            oSeries1.Caption        = "Average Weekly";         //chDimCategories
            oSeries1.SetData(OWC.ChartDimensionsEnum.chDimCategories, -1, yColTitle2);
            oSeries1.SetData(OWC.ChartDimensionsEnum.chDimValues, -1, xAutoManValues2);
            oSeries1.Type = OWC.ChartChartTypeEnum.chChartTypePie;

            sFName = "AnonPer";
            try
            {
                oSpace1.ExportPicture(Server.MapPath(sFName), "gif", 707, 476);
                imgAutoManualTotal.ImageUrl = sFName;
            }
            catch
            {
            }

            //End Image Two

            //Begin Table
            for (rowCtr = 0, y = 8; rowCtr <= rowCnt; rowCtr++, y--)
            {
                TableRow tRow = new TableRow();
                tblAutoManual.Rows.Add(tRow);
                //tRow.CssClass = "clsTRMenu";
                for (cellCtr = 1; cellCtr <= cellCnt; cellCtr++)
                {
                    TableCell tCell = new TableCell();

                    if (rowCtr == 0)
                    {
                        switch (cellCtr)
                        {
                        case 1:
                            tCell.Text = "Date";
                            break;

                        case 2:
                            tCell.Text = "Auto";
                            break;

                        case 3:
                            tCell.Text = "Manual";
                            break;

                        default:
                            tCell.Text = "0";
                            break;
                        }
                        tCell.Style["font-size"] = "small";
                    }
                    else
                    {
                        switch (cellCtr)
                        {
                        case 1:
                            tCell.Text = dDate.AddDays(-y).ToShortDateString();
                            break;

                        case 2:
                            tCell.Text = LACustomer[rowCtr - 1].ToString();
                            break;

                        case 3:
                            tCell.Text = LAAnon[rowCtr - 1].ToString();
                            break;

                        default:
                            tCell.Text = "0";
                            break;
                        }
                        tCell.Style["background-color"] = "white";
                        tCell.Style["font-size"]        = "small-x";
                        tCell.Style["color"]            = "#6487dc";
                        tCell.Style["font-weight"]      = "Bold";
                    }
                    tCell.Style["font-family"] = "Tahoma";
                    tRow.Cells.Add(tCell);
                }
            }

            //End Table
        }
Esempio n. 5
0
        private void Calendar1_SelectionChanged(object sender, System.EventArgs e)
        {
            int    x       = -1;
            int    y       = 0;
            int    rowCnt  = 7;
            int    rowCtr  = 0;
            int    cellCtr = 0;
            int    cellCnt = 4;
            string sFName;

            long[] lACount = new long[7];
            long[] LAWatson = new long[7];
            long[] LAArchive = new long[7];
            long   lCount = 0, lArchive = 0, lWatson = 0;

            Object[] yValues               = new Object[7];
            Object[] LAGraph               = new Object[3];
            Object[] xValues               = new Object[7];
            Object[] yValues1              = new Object[3];
            Object[] xValues1              = new Object[3];
            OCAData.CCountDailyClass rpt   = new OCAData.CCountDailyClass();
            System.DateTime          dDate = new System.DateTime(System.DateTime.Now.Year, System.DateTime.Now.Month,
                                                                 System.DateTime.Now.Day);
            OWC.WCChart         oChart, oChart1;
            OWC.ChartSpaceClass oSpace  = new OWC.ChartSpaceClass();
            OWC.ChartSpaceClass oSpace1 = new OWC.ChartSpaceClass();
            OWC.WCSeries        oSeries1;
            SqlConnection       cn = new SqlConnection("Persist Security Info=False;Pwd=ocarpts@2;User ID=ocarpts;Initial Catalog=SnapShot;Data Source=TKWUCDSQLA02");
            SqlCommand          cm = new SqlCommand();
            SqlDataReader       dr;



            Response.CacheControl = "no-cache";
            Response.AddHeader("Pragma", "no-cache");
            Response.AddHeader("Expires", "-1");
            Response.Expires = -1;



            oSpace.Clear();
            oSpace.Refresh();
            oChart = oSpace.Charts.Add(0);

            oChart.HasLegend = true;
            oChart.HasTitle  = true;
            for (x = 0; x < 3; x++)
            {
                oChart.SeriesCollection.Add(x);
            }
            dDate = Calendar1.SelectedDate;
            for (x = 0, y = 6; x < 7; x++, y--)
            {
                lACount[x] = rpt.GetDailyCount(dDate.AddDays(y));
            }
            cn.Open();
            cm.CommandType    = CommandType.StoredProcedure;
            cm.CommandTimeout = 240;
            cm.CommandText    = "GetSnapshot";
            cm.Connection     = cn;
            cm.Parameters.Add("@CreatedDate", System.Data.SqlDbType.DateTime);
            cm.Parameters["@CreatedDate"].Value = dDate.AddDays(6);
            dr = cm.ExecuteReader();
            dr.Read();
            for (x = 0; x < 7; x++)
            {
                try
                {
//					if(dr.GetDateTime(1) == dDate.AddDays((x + 1)))
//					{
                    LAWatson[x]  = dr.GetInt32(2);
                    LAArchive[x] = dr.GetInt32(3);
                    dr.Read();
//					}
//					else
//					{
//						LAWatson[x] = 0;
//						LAArchive[x] = 0;
//					}
                }
                catch
                {
                    LAWatson[x]  = 0;
                    LAArchive[x] = 0;
                }
            }

            //**********************************************************************************************************
            oChart.Title.Caption = "Database - Server Comparison Chart";
            for (x = 0; x < 7; x++)
            {
                xValues[x] = lACount[x].ToString();
            }


            oChart.SeriesCollection[0].Caption = "Database";
            oChart.SeriesCollection[0].SetData((OWC.ChartDimensionsEnum)OWC.ChartDimensionsEnum.chDimValues, -1, xValues);

            OWC.ChartDimensionsEnum c = OWC.ChartDimensionsEnum.chDimValues;

            oChart.SeriesCollection[0].SetData(c, -1, xValues);

            for (x = 0; x < 7; x++)
            {
                xValues[x] = LAWatson[x].ToString();
            }
            oChart.SeriesCollection[1].Caption = "Watson";
            oChart.SeriesCollection[1].SetData(OWC.ChartDimensionsEnum.chDimValues, -1, xValues);
            for (x = 0; x < 7; x++)
            {
                xValues[x] = LAArchive[x].ToString();
            }
            oChart.SeriesCollection[2].Caption = "Archive";
            oChart.SeriesCollection[2].SetData(OWC.ChartDimensionsEnum.chDimValues, -1, xValues);
            for (x = 0, y = 6; x < 7; x++, y--)
            {
                yValues.SetValue(dDate.AddDays((y)).ToShortDateString(), x);
            }
            oChart.SeriesCollection[0].SetData(OWC.ChartDimensionsEnum.chDimCategories, -1, yValues);
            //**********************************************************************************************************
            sFName = "Weekly";
            try
            {
                oSpace.ExportPicture(Server.MapPath(sFName + ".gif"), "gif", 707, 476);
            }
            catch
            {
            }

            imgWeekly.EnableViewState      = false;
            imgWeekly.Page.EnableViewState = false;
            Page.EnableViewState           = false;

            imgWeekly.ImageUrl = sFName + ".gif";
            oSpace1.Clear();
            oSpace1.Refresh();
            oChart1      = oSpace1.Charts.Add(0);
            oChart1.Type = OWC.ChartChartTypeEnum.chChartTypeBarClustered;
            oSeries1     = oChart1.SeriesCollection.Add(0);
            for (x = 0; x < 7; x++)
            {
                lCount   = lCount + lACount[x];
                lWatson  = lWatson + LAWatson[x];
                lArchive = lArchive + LAArchive[x];
            }
            lCount   = lCount / x;
            lWatson  = lWatson / x;
            lArchive = lArchive / x;
            xValues1.SetValue(lCount.ToString(), 0);
            xValues1.SetValue(lWatson.ToString(), 1);
            xValues1.SetValue(lArchive.ToString(), 2);
            yValues1.SetValue("Database", 0);
            yValues1.SetValue("Watson", 1);
            yValues1.SetValue("Archive", 2);
            oChart1.HasTitle      = true;
            oChart1.Title.Caption = "Database - Average Weekly Uploads";
            oSeries1.Caption      = "Average Weekly";           //chDimCategories
            oSeries1.SetData(OWC.ChartDimensionsEnum.chDimCategories, -1, yValues1);
            oSeries1.SetData(OWC.ChartDimensionsEnum.chDimValues, -1, xValues1);
            oSeries1.Type = OWC.ChartChartTypeEnum.chChartTypeColumnStacked;

            sFName = "Avg";
            try
            {
                oSpace1.ExportPicture(Server.MapPath(sFName), "gif", 707, 476);
                imgAvg.ImageUrl = sFName;
            }
            catch
            {
            }
            for (rowCtr = 0, y = 7; rowCtr <= rowCnt; rowCtr++, y--)
            {
                TableRow tRow = new TableRow();
                tblUploads.Rows.Add(tRow);
                for (cellCtr = 1; cellCtr <= cellCnt; cellCtr++)
                {
                    TableCell tCell = new TableCell();

                    if (rowCtr == 0)
                    {
                        switch (cellCtr)
                        {
                        case 1:
                            tCell.Text = "Date";
                            break;

                        case 2:
                            tCell.Text = "DB Count";
                            break;

                        case 3:
                            tCell.Text = "Watson";
                            break;

                        case 4:
                            tCell.Text = "Archive";
                            break;

                        default:
                            tCell.Text = "0";
                            break;
                        }
                        tCell.Style["font-size"] = "small";
                    }
                    else
                    {
                        switch (cellCtr)
                        {
                        case 1:
                            tCell.Text = dDate.AddDays(y).ToShortDateString();
                            break;

                        case 2:
                            tCell.Text = lACount[rowCtr - 1].ToString();
                            break;

                        case 3:
                            tCell.Text = LAWatson[rowCtr - 1].ToString();
                            break;

                        case 4:
                            tCell.Text = LAArchive[rowCtr - 1].ToString();
                            break;

                        default:
                            tCell.Text = "0";
                            break;
                        }
                        tCell.Style["background-color"] = "white";
                        tCell.Style["font-size"]        = "small-x";
                        tCell.Style["color"]            = "#6487dc";
                        tCell.Style["font-weight"]      = "Bold";
                    }
                    tCell.Style["font-family"] = "Tahoma";
                    tRow.Cells.Add(tCell);
                }
            }


            for (rowCtr = 0, y = 7; rowCtr <= rowCnt; rowCtr++, y--)
            {
                TableRow tRowDiff = new TableRow();
                tblDifference.Rows.Add(tRowDiff);
                for (cellCtr = 1; cellCtr <= cellCnt; cellCtr++)
                {
                    TableCell tCell = new TableCell();

                    if (rowCtr == 0)
                    {
                        switch (cellCtr)
                        {
                        case 1:
                            tCell.Text = "Date";
                            break;

                        case 2:
                            tCell.Text = "Archive vs Watson";
                            break;

                        case 3:
                            tCell.Text = "SQL vs Archive";
                            break;

                        case 4:
                            tCell.Text = "SQL vs Watson";
                            break;

                        default:
                            tCell.Text = "0";
                            break;
                        }
                        tCell.Style["font-size"] = "small";
                    }
                    else
                    {
                        switch (cellCtr)
                        {
                        case 1:
                            tCell.Text = dDate.AddDays(y).ToShortDateString();
                            break;

                        case 2:
                            lCount     = LAArchive[rowCtr - 1] - LAWatson[rowCtr - 1];
                            tCell.Text = lCount.ToString();
                            break;

                        case 3:
                            lCount     = lACount[rowCtr - 1] - LAWatson[rowCtr - 1];
                            tCell.Text = lCount.ToString();
                            break;

                        case 4:
                            lCount     = lACount[rowCtr - 1] - LAArchive[rowCtr - 1];
                            tCell.Text = lCount.ToString();
                            break;

                        default:
                            tCell.Text = "0";
                            break;
                        }
                        tCell.Style["background-color"] = "white";
                        tCell.Style["font-size"]        = "small-x";
                        tCell.Style["color"]            = "#6487dc";
                        tCell.Style["font-weight"]      = "Bold";
                    }
                    tCell.Style["font-family"] = "Tahoma";
                    tRowDiff.Cells.Add(tCell);
                }
            }
        }