/************************************************************************************* * module: frmAnonCust.cs - TLoadData * * author: Tim Ragain * date: Jan 22, 2002 * * Purpose: Takes two variables the x represents the day as an integer and the sCount is a * short representing the column of the Calendar control. This initializes the OCAData.dll * control and calls the GetDailyCount and GetDailyAnon procedures. The anonymous count is * subtracted from the total count to get the customer count. The appropriate column * and row is updated. *************************************************************************************/ private void TLoadData(int x, short sCount) { OCAData.CCountDailyClass rpt = new OCAData.CCountDailyClass(); System.DateTime dDate = new System.DateTime(monthCalendar1.SelectionStart.Year, monthCalendar1.SelectionStart.Month, monthCalendar1.SelectionStart.Day); long lngCount = 0, l_AnonUploads = 0; UpdateStatus(); //***********Total Record Count*************** statusBar1.Text = "Getting Daily Count for " + dDate.AddDays(x).Date.ToString(); lngCount = rpt.GetDailyCount(dDate.AddDays(x)); lDate[x] = dDate.AddDays(x); //***********Total Anon Count*************** UpdateStatus(); statusBar1.Text = "Getting Anon Users for " + dDate.AddDays(x).Date.ToString(); l_AnonUploads = rpt.GetDailyAnon(dDate.AddDays(x)); lock (this) { axMSChart1.Row = sCount; axMSChart1.Column = 1; axMSChart1.RowLabel = dDate.AddDays(x).Date.ToShortDateString(); //+ dDate.Date.ToString(); axMSChart1.Data = l_AnonUploads.ToString(); } UpdateStatus(); //***********Calculate Customer Count*************** statusBar1.Text = "Calculating Customer Count for " + dDate.AddDays(x).Date.ToString(); if (l_AnonUploads > lngCount) { lngCount = l_AnonUploads - lngCount; } else { lngCount = lngCount - l_AnonUploads; } lock (this) { axMSChart1.Row = sCount; axMSChart1.Column = 2; lAnonymous[x] = l_AnonUploads; lCustomer[x] = lngCount; axMSChart1.Data = lngCount.ToString(); } //********************************** UpdateStatus(); this.Refresh(); }
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: 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 }
/************************************************************************************* * module: frmAutoMan.cs - TLoadData * * author: Tim Ragain * date: Jan 22, 2002 * * Purpose: Takes two variables the x represents the day as an integer and the sCount is a * short representing the column of the Calendar control. This initializes the OCAData.dll * control and calls the GetDailyCount and GetDailyAnon procedures. The anonymous count is * subtracted from the total count to get the customer count. The appropriate column * and row is updated. *************************************************************************************/ private void TLoadData(int x, short sCount) { OCAData.CCountDailyClass rpt = new OCAData.CCountDailyClass(); RegistryKey regArchive = Registry.CurrentUser.OpenSubKey("software").OpenSubKey("microsoft", true).CreateSubKey("OCATools").CreateSubKey("OCAReports").CreateSubKey("Archive"); RegistryKey regWatson = Registry.CurrentUser.OpenSubKey("software").OpenSubKey("microsoft", true).CreateSubKey("OCATools").CreateSubKey("OCAReports").CreateSubKey("Watson"); System.DateTime dDate = new System.DateTime(monthCalendar1.SelectionStart.Year, monthCalendar1.SelectionStart.Month, monthCalendar1.SelectionStart.Day); string strArchive; int y = 0; long l_AutoUploads = 0, l_ManualUploads = 0, l_NullUploads = 0; //***********Total Record Count*************** if (chkDatabaseCount.Checked == true) { statusBar1.Text = "Getting Database Auto Uploads for " + dDate.AddDays(x).Date.ToString(); lDate[x] = dDate.AddDays(x); UpdateStatus(); l_AutoUploads = rpt.GetAutoUploads(dDate.AddDays(x)); } else { statusBar1.Text = "Getting Archive File Auto Uploads for " + dDate.AddDays(x).Date.ToString(); lDate[x] = dDate.AddDays(x); UpdateStatus(); #if (FILE_SERVER) try { for (y = 0; y < 10; y++) { if (regArchive.GetValue("Loc" + y.ToString()).ToString().Length > 0) { strArchive = regArchive.GetValue("Loc" + y.ToString()).ToString(); l_AutoUploads = rpt.GetFileCount(OCAData.ServerLocation.Archive, strArchive, dDate.AddDays(x)); if (l_AutoUploads > 0) { y = 10; } } else { l_AutoUploads = 0; } } //l_AutoUploads = rpt.GetFileCount(OCAData.ServerLocation.Archive, "Y:\\", dDate.AddDays(x)); } catch { l_AutoUploads = 0; } #elif (FILE_LOCAL) l_AutoUploads = rpt.GetFileCount(OCAData.ServerLocation.Archive, "C:\\MiniDumps\\Archive\\", dDate.AddDays(x)); #endif } UpdateStatus(); if (chkDatabaseCount.Checked == true) { statusBar1.Text = "Getting Database Manual Uploads for " + dDate.AddDays(x).Date.ToString(); try { l_ManualUploads = rpt.GetManualUploads(dDate.AddDays(x)); } catch { l_ManualUploads = -1; } } else { statusBar1.Text = "Getting Database Manual Uploads for " + dDate.AddDays(x).Date.ToString(); #if (FILE_SERVER) try { for (y = 0; y < 10; y++) { if (regArchive.GetValue("Loc" + y.ToString()).ToString().Length > 0) { strArchive = regArchive.GetValue("Loc" + y.ToString()).ToString(); l_ManualUploads = rpt.GetFileMiniCount(OCAData.ServerLocation.Archive, strArchive, dDate.AddDays(x)); if (l_ManualUploads > 0) { y = 10; } } else { l_ManualUploads = 0; } } //l_ManualUploads = rpt.GetFileMiniCount(OCAData.ServerLocation.Archive, "Y:\\", dDate.AddDays(x)); } catch { l_ManualUploads = 0; } #elif (FILE_LOCAL) l_ManualUploads = rpt.GetFileMiniCount(OCAData.ServerLocation.Archive, "C:\\MiniDumps\\Archive\\", dDate.AddDays(x)); #endif // l_ManualUploads = rpt.GetFileMiniCount(OCAData.ServerLocation.Archive, "C:\\MiniDumps\\Archive\\", dDate.AddDays(x)); } lock (this) { axMSChart1.Row = sCount; axMSChart1.Column = 1; axMSChart1.RowLabel = dDate.AddDays(x).ToShortDateString(); //+ dDate.Date.ToString(); if (chkDatabaseCount.Checked == false) { l_AutoUploads = l_AutoUploads - l_ManualUploads; } axMSChart1.Data = l_AutoUploads.ToString(); lAutoUploads[x] = l_AutoUploads; } lock (this) { axMSChart1.Row = sCount; axMSChart1.Column = 2; axMSChart1.Data = l_ManualUploads.ToString(); lManualUploads[x] = l_ManualUploads; } UpdateStatus(); if (chkDatabaseCount.Checked == true) { statusBar1.Text = "Getting Null Uploads for " + dDate.AddDays(x).Date.ToString(); try { l_NullUploads = rpt.GetIncompleteUploads(dDate.AddDays(x)); } catch { l_NullUploads = -1; } lock (this) { axMSChart1.Row = sCount; axMSChart1.Column = 3; axMSChart1.Data = l_NullUploads.ToString(); lNullUploads[x] = l_NullUploads; } } UpdateStatus(); this.Refresh(); }
/************************************************************************************* * 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: frmSolutionStatus.cs - TLoadData * * author: Tim Ragain * date: Jan 24, 2002 * * Purpose: Takes two variables the x represents the day as an integer and the sCount is a * short representing the column of the Calendar control. This initializes the OCAData.dll * control and calls the GetDailyCount and GetDailyAnon procedures. The anonymous count is * subtracted from the total count to get the customer count. The appropriate column * and row is updated. *************************************************************************************/ private void TLoadData(int x, short sCount) { OCAData.CCountDailyClass rpt = new OCAData.CCountDailyClass(); System.DateTime dDate = new System.DateTime(monthCalendar1.SelectionStart.Year, monthCalendar1.SelectionStart.Month, monthCalendar1.SelectionStart.Day); long l_SpecificSolutions = 0, l_GeneralSolutions = 0, l_StopCodes = 0, l_TotalRecords = 0; //***********Total Record Count*************** UpdateStatus(); statusBar1.Text = "Getting Specific Solutions for " + dDate.AddDays(x).Date.ToString(); lDate[x] = dDate.AddDays(x); try { l_SpecificSolutions = rpt.GetSpecificSolutions(dDate.AddDays(x)); } catch { l_SpecificSolutions = -1; } lock (this) { axMSChart1.Row = sCount; axMSChart1.Column = (short)1; axMSChart1.RowLabel = dDate.AddDays(x).ToShortDateString(); //+ dDate.Date.ToString(); axMSChart1.Data = l_SpecificSolutions.ToString(); lSpecific[x] = l_SpecificSolutions; } UpdateStatus(); statusBar1.Text = "Getting General Solutions for " + dDate.AddDays(x).Date.ToString(); try { l_GeneralSolutions = rpt.GetGeneralSolutions(dDate.AddDays(x)); } catch { l_GeneralSolutions = -1; } lock (this) { axMSChart1.Row = sCount; axMSChart1.Column = (short)2; axMSChart1.Data = l_GeneralSolutions.ToString(); lGeneral[x] = l_GeneralSolutions; } UpdateStatus(); statusBar1.Text = "Getting Stop Code Troubleshooters for " + dDate.AddDays(x).Date.ToString(); try { l_StopCodes = rpt.GetStopCodeSolutions(dDate.AddDays(x)); } catch { l_StopCodes = -1; } lock (this) { axMSChart1.Row = sCount; axMSChart1.Column = (short)3; axMSChart1.Data = l_StopCodes.ToString(); lStopCode[x] = l_StopCodes; } UpdateStatus(); statusBar1.Text = "Getting No Solution incidents for " + dDate.AddDays(x).Date.ToString(); try { l_TotalRecords = rpt.GetDailyCount(dDate.AddDays(x)); } catch { l_TotalRecords = -1; } lock (this) { axMSChart1.Row = sCount; axMSChart1.Column = (short)4; l_TotalRecords = l_TotalRecords - (l_StopCodes + l_GeneralSolutions + l_SpecificSolutions); axMSChart1.Data = l_TotalRecords.ToString(); lNoSolution[x] = l_TotalRecords; } UpdateStatus(); this.Refresh(); }
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); } } }
/************************************************************************************* * module: frmWeekly.cs - TLoadData * * author: Tim Ragain * date: Jan 22, 2002 * * Purpose: Takes two variables the x represents the day as an integer and the sCount is a * short representing the column of the Calendar control. This initializes the OCAData.dll * control and calls the GetDailyCount and GetDailyAnon procedures. The anonymous count is * subtracted from the total count to get the customer count. The appropriate column * and row is updated. *************************************************************************************/ private void TLoadData(int x, short sCount) { OCAData.CCountDailyClass rpt = new OCAData.CCountDailyClass(); string strArchive, strWatson; int y = 0; RegistryKey regArchive = Registry.CurrentUser.OpenSubKey("software").OpenSubKey("microsoft", true).CreateSubKey("OCATools").CreateSubKey("OCAReports").CreateSubKey("Archive"); RegistryKey regWatson = Registry.CurrentUser.OpenSubKey("software").OpenSubKey("microsoft", true).CreateSubKey("OCATools").CreateSubKey("OCAReports").CreateSubKey("Watson"); System.DateTime dDate = new System.DateTime(monthCalendar1.SelectionStart.Year, monthCalendar1.SelectionStart.Month, monthCalendar1.SelectionStart.Day); long lngCount = 0, l_WatsonCount = 0, l_ArchiveCount = 0; statusBar1.Text = "Getting Daily Count for " + dDate.AddDays(x).Date.ToShortDateString() + " from database"; lDate[x] = dDate.AddDays(x).Date; try { lngCount = rpt.GetDailyCount(dDate.AddDays(x)); } catch { // MessageBox.Show("Error: " + e.Message.ToString(), iLast.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } lock (this) { lCount[x] = lngCount; axMSChart1.Column = 1; axMSChart1.Row = sCount; axMSChart1.RowLabel = dDate.AddDays(x).ToShortDateString(); axMSChart1.Data = lngCount.ToString(); } UpdateStatus(); statusBar1.Text = "Getting Daily Count for " + dDate.AddDays(x).Date.ToString() + " from Watson Server"; #if (FILE_SERVER) for (y = 0; y < 10; y++) { if (regWatson.GetValue("Loc" + y.ToString()).ToString().Length > 0) { strWatson = regWatson.GetValue("Loc" + y.ToString()).ToString(); l_WatsonCount = rpt.GetFileCount(OCAData.ServerLocation.Watson, strWatson, dDate.AddDays(x)); if (l_WatsonCount > 0) { y = 10; } } else { l_WatsonCount = 0; } } //l_WatsonCount = rpt.GetFileCount(OCAData.ServerLocation.Watson, "Z:\\", dDate.AddDays(x)); #elif (FILE_LOCAL) l_WatsonCount = rpt.GetFileCount(OCAData.ServerLocation.Watson, "C:\\MiniDumps\\Watson\\", dDate.AddDays(x)); #endif lock (this) { lWatson[x] = l_WatsonCount; axMSChart1.Column = 2; axMSChart1.Row = sCount; axMSChart1.Data = l_WatsonCount.ToString(); } UpdateStatus(); statusBar1.Text = "Getting Daily Count for " + dDate.AddDays(x).Date.ToString() + " from Archive Server"; #if (FILE_SERVER) try { for (y = 0; y < 10; y++) { if (regArchive.GetValue("Loc" + y.ToString()).ToString().Length > 0) { strArchive = regArchive.GetValue("Loc" + y.ToString()).ToString(); l_ArchiveCount = rpt.GetFileCount(OCAData.ServerLocation.Archive, strArchive, dDate.AddDays(x)); if (l_ArchiveCount > 0) { y = 10; } } else { l_ArchiveCount = 0; } } //l_ArchiveCount = rpt.GetFileCount(OCAData.ServerLocation.Archive, "Y:\\", dDate.AddDays(x)); } catch { l_ArchiveCount = 0; } #elif (FILE_LOCAL) l_ArchiveCount = rpt.GetFileCount(OCAData.ServerLocation.Archive, "C:\\MiniDumps\\Archive\\", dDate.AddDays(x)); #endif // if(l_ArchiveCount == 0) // { //#if(FILE_SERVER) // l_ArchiveCount = rpt.GetFileCount(OCAData.ServerLocation.Archive, "X:\\", dDate.AddDays(x)); //#elif(FILE_LOCAL) // l_ArchiveCount = rpt.GetFileCount(OCAData.ServerLocation.Archive, "C:\\MiniDumps\\Archive\\", dDate.AddDays(x)); //#endif // } lock (this) { lArchive[x] = l_ArchiveCount; axMSChart1.Column = 3; axMSChart1.Row = sCount; axMSChart1.Data = l_ArchiveCount.ToString(); } UpdateStatus(); this.Refresh(); }