private void mitSave_Click(object sender, RoutedEventArgs e)
        {
            int  intRecordsReturned;
            bool blnFatalError = false;

            try
            {
                TheFindVehicleEmailListByEmployeeIDDataSet = TheVehicleExceptionEmailClass.FindVehicleEmailListByEmployeeID(MainWindow.gintEmployeeID);

                intRecordsReturned = TheFindVehicleEmailListByEmployeeIDDataSet.FindVehicleEmailListByEmployeeID.Rows.Count;

                if (intRecordsReturned > 0)
                {
                    TheMessagesClass.ErrorMessage("Employee Is Already Part of Email List");
                    return;
                }

                blnFatalError = TheVehicleExceptionEmailClass.InsertVehicleInspectionEmail(MainWindow.gintEmployeeID, gstrEmailAddress);

                if (blnFatalError == true)
                {
                    throw new Exception();
                }

                TheMessagesClass.InformationMessage("Employee Has Been Added");

                ClearControls();
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Add Employee To Vehicle Email List // Save Menu Item " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }
Exemplo n.º 2
0
        public FindVehicleEmailListByEmployeeIDDataSet FindVehicleEmailListByEmployeeID(int intEmployeeID)
        {
            try
            {
                aFindVehicleEmailListByEmployeeIDDataSet      = new FindVehicleEmailListByEmployeeIDDataSet();
                aFindVehicleEmailListByEmployeeIDTableAdapter = new FindVehicleEmailListByEmployeeIDDataSetTableAdapters.FindVehicleEmailListByEmployeeIDTableAdapter();
                aFindVehicleEmailListByEmployeeIDTableAdapter.Fill(aFindVehicleEmailListByEmployeeIDDataSet.FindVehicleEmailListByEmployeeID, intEmployeeID);
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Vehicle Exception Email Class // Find Vehicle Email List By Employee ID " + Ex.Message);
            }

            return(aFindVehicleEmailListByEmployeeIDDataSet);
        }
Exemplo n.º 3
0
        private void btnProcess_Click(object sender, RoutedEventArgs e)
        {
            bool   blnFatalError      = false;
            string strErrorMessage    = "";
            bool   blnThereIsAProblem = false;
            string strEmailAddress;
            int    intRecordsReturned;

            try
            {
                blnFatalError = TheEmployeeDateEntryClass.InsertIntoEmployeeDateEntry(MainWindow.TheVerifyLogonDataSet.VerifyLogon[0].EmployeeID, "New Blue Jay ERP // Add Employee To Vehicle Emails");

                if (blnFatalError == true)
                {
                    throw new Exception();
                }

                //data validation
                if (cboSelectEmployee.SelectedIndex < 1)
                {
                    blnFatalError    = true;
                    strErrorMessage += "Employee Was Not Selected\n";
                }
                strEmailAddress    = txtEmailAddress.Text;
                blnThereIsAProblem = TheDataValidationClass.VerifyEmailAddress(strEmailAddress);
                if (blnThereIsAProblem == true)
                {
                    blnFatalError    = true;
                    strErrorMessage += "The Email Address Is not an Email Address\n";
                }
                if (blnFatalError == true)
                {
                    TheMessagesClass.ErrorMessage(strErrorMessage);
                    return;
                }
                else
                {
                    TheFindVehicleEmployeeListByEmployeeIDDataSet = TheVehicleExceptionEmailClass.FindVehicleEmailListByEmployeeID(MainWindow.gintEmployeeID);

                    intRecordsReturned = TheFindVehicleEmployeeListByEmployeeIDDataSet.FindVehicleEmailListByEmployeeID.Rows.Count;

                    if (intRecordsReturned > 0)
                    {
                        TheMessagesClass.ErrorMessage("Employee Has Already Been Entered");
                        return;
                    }
                }

                blnFatalError = TheVehicleExceptionEmailClass.InsertVehicleInspectionEmail(MainWindow.gintEmployeeID, strEmailAddress);

                if (blnFatalError == true)
                {
                    throw new Exception();
                }

                TheMessagesClass.InformationMessage("The Employee Has Been Entered");

                ResetControls();
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Add Employee To Vehicle Emails // Process Button " + Ex.Message);

                TheSendEmailClass.SendEventLog(Ex.ToString());

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