コード例 #1
0
 public void UpdateVehicleExceptionEmailDB(VehicleExceptionEmailDataSet aVehicleExceptionEmailDataSet)
 {
     try
     {
         aVehicleExceptionEmailTableAdapter = new VehicleExceptionEmailDataSetTableAdapters.vehicleexceptionemailTableAdapter();
         aVehicleExceptionEmailTableAdapter.Update(aVehicleExceptionEmailDataSet.vehicleexceptionemail);
     }
     catch (Exception Ex)
     {
         TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Vehicle Exception Email Class // Update Vehicle Exception Email DB " + Ex.Message);
     }
 }
コード例 #2
0
        public VehicleExceptionEmailDataSet GetVehicleExceptionEmailInfo()
        {
            try
            {
                aVehicleExceptionEmailDataSet      = new VehicleExceptionEmailDataSet();
                aVehicleExceptionEmailTableAdapter = new VehicleExceptionEmailDataSetTableAdapters.vehicleexceptionemailTableAdapter();
                aVehicleExceptionEmailTableAdapter.Fill(aVehicleExceptionEmailDataSet.vehicleexceptionemail);
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Vehicle Exception Email Class // Get Vehicle Exception Email Info " + Ex.Message);
            }

            return(aVehicleExceptionEmailDataSet);
        }
コード例 #3
0
        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());
            }
        }