Пример #1
0
        /*************************************************************************************
        *	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();
        }
Пример #2
0
        /*************************************************************************************
        *	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();
        }