示例#1
0
 public void UpdateWeeklyVehicleReportsDB(WeeklyVehicleReportsDateDataSet aWeeklyVehicleReportsDateDataSet)
 {
     try
     {
         aWeeklyVehicleReportsDateTableAdapter = new WeeklyVehicleReportsDateDataSetTableAdapters.weeklyvehiclereportsdateTableAdapter();
         aWeeklyVehicleReportsDateTableAdapter.Update(aWeeklyVehicleReportsDateDataSet.weeklyvehiclereportsdate);
     }
     catch (Exception Ex)
     {
         TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Vehicle Exception Eamil Class // Update Weekly Vehicle Reports DB " + Ex.Message);
     }
 }
示例#2
0
        public WeeklyVehicleReportsDateDataSet GetWeeklyVehicleReportsDateInfo()
        {
            try
            {
                aWeeklyVehicleReportsDateDataSet      = new WeeklyVehicleReportsDateDataSet();
                aWeeklyVehicleReportsDateTableAdapter = new WeeklyVehicleReportsDateDataSetTableAdapters.weeklyvehiclereportsdateTableAdapter();
                aWeeklyVehicleReportsDateTableAdapter.Fill(aWeeklyVehicleReportsDateDataSet.weeklyvehiclereportsdate);
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Vehicle Exception Eamil Class // Get Weekly Vehicle Reports Class " + Ex.Message);
            }

            return(aWeeklyVehicleReportsDateDataSet);
        }
        private void SendVehicleReports()
        {
            DateTime datTodaysDate = DateTime.Now;
            DateTime datTransactionDate;
            DateTime datStartDate;
            DateTime datEndDate;

            try
            {
                TheVehicleExceptionEmailDataSet = TheVehicleExceptionEmailClass.GetVehicleExceptionEmailInfo();
                TheWeeklyVehicleReportsDateDataSet = TheVehicleExceptionEmailClass.GetWeeklyVehicleReportsDateInfo();

                datTransactionDate = TheVehicleExceptionEmailDataSet.vehicleexceptionemail[0].TransactionDate;

                datTransactionDate = TheDateSearchClass.AddingDays(datTransactionDate, 1);
                datStartDate = TheDateSearchClass.SubtractingDays(datTodaysDate, 1);
                datStartDate = TheDateSearchClass.RemoveTime(datStartDate);

                if (datTodaysDate > datTransactionDate)
                {
                    if (datTransactionDate.DayOfWeek == DayOfWeek.Saturday)
                    {
                        TheVehicleExceptionEmailDataSet.vehicleexceptionemail[0].TransactionDate = datTransactionDate;
                        TheVehicleExceptionEmailClass.UpdateVehicleExceptionEmailDB(TheVehicleExceptionEmailDataSet);
                    }
                    else if (datTransactionDate.DayOfWeek == DayOfWeek.Sunday)
                    {
                        TheVehicleExceptionEmailDataSet.vehicleexceptionemail[0].TransactionDate = datTransactionDate;
                        TheVehicleExceptionEmailClass.UpdateVehicleExceptionEmailDB(TheVehicleExceptionEmailDataSet);
                    }
                    else
                    {
                        //ChangeVehicleInYardToWarehouse();
                        datTodaysDate = TheDateSearchClass.RemoveTime(datTodaysDate);
                        datEndDate = TheDateSearchClass.AddingDays(datTodaysDate, 1);
                        TheVehicleExceptionEmailDataSet.vehicleexceptionemail[0].TransactionDate = datTransactionDate;
                        TheAutomatedVehicleReportsClass.RunAutomatedReports(datTodaysDate);
                        TheVehicleExceptionEmailClass.UpdateVehicleExceptionEmailDB(TheVehicleExceptionEmailDataSet);
                        //TheUpdatingWorkTaskStatsClass.UpdateWorkTaskStatsTable();
                        DataEntryReports(datStartDate, datEndDate);
                        SendOverdueProjectReport();
                        //SendVehicleAfterHourActivity();

                        if (datTodaysDate.DayOfWeek == DayOfWeek.Tuesday)
                        {
                            TheRunPunchedVSProductionClass.RunPunchedVSProductionReport();

                            TheRunPunchedVSProductionClass.CreateOverTimeReport();

                            TheRunPunchedVSProductionClass.CreateEmployeeMiscReport();
                        }
                    }
                }

                if(datTodaysDate.DayOfWeek == DayOfWeek.Monday)
                {
                    datTodaysDate = TheDateSearchClass.RemoveTime(datTodaysDate);

                     if(datTodaysDate > TheWeeklyVehicleReportsDateDataSet.weeklyvehiclereportsdate[0].LastWeeklyReport)
                     {
                        //TheAutomatedVehicleReportsClass.RunWeeklyVehicleInspectionReport();

                       // TheAutomatedVehicleReportsClass.RunWeeklyVehiclesInYardReport();

                        TheWeeklyVehicleReportsDateDataSet.weeklyvehiclereportsdate[0].LastWeeklyReport = datTodaysDate;

                        TheVehicleExceptionEmailClass.UpdateWeeklyVehicleReportsDB(TheWeeklyVehicleReportsDateDataSet);

                        TheAutomatedProductioinReportsClass.RunAutomatedProductionReports();                        
                    }
                }
                

            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Main Window // Begin The Process " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }