コード例 #1
0
        private void cboSelectEmployee_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            int intSelectedIndex;
            int intRecordsReturned;

            intSelectedIndex = cboSelectEmployee.SelectedIndex - 1;

            if (intSelectedIndex > -1)
            {
                MainWindow.gintEmployeeID = TheComboEmployeeDataSet.employees[intSelectedIndex].EmployeeID;

                TheFindEmployeeEmailAddressDataSet = TheEmployeeClass.FindEmployeeEmailAddress(MainWindow.gintEmployeeID);

                intRecordsReturned = TheFindEmployeeEmailAddressDataSet.FindEmployeeEmailAddress.Rows.Count;

                if (intRecordsReturned > 0)
                {
                    gstrEmailAddress     = TheFindEmployeeEmailAddressDataSet.FindEmployeeEmailAddress[0].EmailAddress;
                    txtEmailAddress.Text = gstrEmailAddress;
                }
                else
                {
                    TheMessagesClass.ErrorMessage("Employee Does Not Have a Email Address");
                }
            }
        }
コード例 #2
0
        private void cboSelectEmployee_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            int    intSelectedIndex;
            string strFirstName;
            string strLastName;
            string strEmail;
            int    intEmployeeID;

            try
            {
                intSelectedIndex = cboSelectEmployee.SelectedIndex - 1;

                if (intSelectedIndex > -1)
                {
                    intEmployeeID = TheComboEmployeeDataSet.employees[intSelectedIndex].EmployeeID;
                    strFirstName  = TheComboEmployeeDataSet.employees[intSelectedIndex].FirstName;
                    strLastName   = TheComboEmployeeDataSet.employees[intSelectedIndex].LastName;

                    TheFindEmployeeEmailAddressDataSet = TheEmployeeClass.FindEmployeeEmailAddress(intEmployeeID);

                    if (TheFindEmployeeEmailAddressDataSet.FindEmployeeEmailAddress[0].IsEmailAddressNull() == true)
                    {
                        strEmail = "NO EMAIL ADDRESS";
                        TheMessagesClass.InformationMessage(TheComboEmployeeDataSet.employees[intSelectedIndex].FullName + " Doesn't Have an Email Address");
                    }
                    else
                    {
                        strEmail = TheFindEmployeeEmailAddressDataSet.FindEmployeeEmailAddress[0].EmailAddress;
                    }


                    AssignEmployeesDataSet.assignemployeesRow NewEmployeeRow = TheAssignEmployeesDataSet.assignemployees.NewassignemployeesRow();

                    NewEmployeeRow.EmailAddress = strEmail;
                    NewEmployeeRow.EmployeeID   = intEmployeeID;
                    NewEmployeeRow.FirstName    = strFirstName;
                    NewEmployeeRow.LastName     = strLastName;
                    NewEmployeeRow.SendEmail    = true;

                    TheAssignEmployeesDataSet.assignemployees.Rows.Add(NewEmployeeRow);
                }
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Daily Vehicle Inspection // Assign Task // Select Employee Combobox " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }
コード例 #3
0
        public FindEmployeeEmailAddressDataSet FindEmployeeEmailAddress(int intEmployeeID)
        {
            try
            {
                aFindEmployeeEmailAddressDataSet      = new FindEmployeeEmailAddressDataSet();
                aFindEmployeeEmailAddressTableAdapter = new FindEmployeeEmailAddressDataSetTableAdapters.FindEmployeeEmailAddressTableAdapter();
                aFindEmployeeEmailAddressTableAdapter.Fill(aFindEmployeeEmailAddressDataSet.FindEmployeeEmailAddress, intEmployeeID);
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Employee Class // Find Employees Email " + Ex.Message);
            }

            return(aFindEmployeeEmailAddressDataSet);
        }
コード例 #4
0
        private void cboSelectEmployee_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            //setting up local variables
            int    intEmployeeID;
            int    intSelectedIndex;
            string strFirstName;
            string strLastname;
            string strEmailAddress;

            try
            {
                intSelectedIndex = cboSelectEmployee.SelectedIndex - 1;

                if (intSelectedIndex > -1)
                {
                    intEmployeeID = TheComboEmployeeDataSet.employees[intSelectedIndex].EmployeeID;

                    TheFindEmployeeEmailAddressDataSet = TheEmployeeClass.FindEmployeeEmailAddress(intEmployeeID);

                    strFirstName = TheComboEmployeeDataSet.employees[intSelectedIndex].FirstName;
                    strLastname  = TheComboEmployeeDataSet.employees[intSelectedIndex].LastName;

                    if (TheFindEmployeeEmailAddressDataSet.FindEmployeeEmailAddress[0].IsEmailAddressNull() == true)
                    {
                        TheMessagesClass.InformationMessage("The Employee Selected does not have an Email Address");
                        return;
                    }

                    strEmailAddress = TheFindEmployeeEmailAddressDataSet.FindEmployeeEmailAddress[0].EmailAddress;

                    EmailListDataSet.employeesRow NewEmployeeRow = MainWindow.TheEmailListDataSet.employees.NewemployeesRow();

                    NewEmployeeRow.FirstName    = strFirstName;
                    NewEmployeeRow.LastName     = strLastname;
                    NewEmployeeRow.EmailAddress = strEmailAddress;

                    MainWindow.TheEmailListDataSet.employees.Rows.Add(NewEmployeeRow);

                    dgrEmployees.ItemsSource = MainWindow.TheEmailListDataSet.employees;
                }
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Email Emaployees // Combo Box Selection " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }
コード例 #5
0
        private void cboSelectEmployee_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            int    intSelectedIndex;
            string strEmailAddress = "";
            int    intEmployeeID;
            int    intRecordsReturned;
            bool   blnSendEmail  = false;
            bool   blnNotAnEmail = false;

            try
            {
                intSelectedIndex = cboSelectEmployee.SelectedIndex - 1;

                if (intSelectedIndex > -1)
                {
                    AssignEmployeesDataSet.assignemployeesRow NewEmployeeRow = TheAssigneEmployeesDataSet.assignemployees.NewassignemployeesRow();

                    NewEmployeeRow.EmployeeID = TheComboEmployeeDataSet.employees[intSelectedIndex].EmployeeID;
                    NewEmployeeRow.FirstName  = TheComboEmployeeDataSet.employees[intSelectedIndex].FirstName;
                    NewEmployeeRow.LastName   = TheComboEmployeeDataSet.employees[intSelectedIndex].LastName;

                    intEmployeeID = TheComboEmployeeDataSet.employees[intSelectedIndex].EmployeeID;

                    TheFindEmployeeEmailAddressDataSet = TheEmployeeClass.FindEmployeeEmailAddress(intEmployeeID);

                    intRecordsReturned = TheFindEmployeeEmailAddressDataSet.FindEmployeeEmailAddress.Rows.Count;

                    if (intRecordsReturned == 0)
                    {
                        blnSendEmail = false;
                    }
                    else if (intRecordsReturned > 0)
                    {
                        if (TheFindEmployeeEmailAddressDataSet.FindEmployeeEmailAddress[0].IsEmailAddressNull() == false)
                        {
                            strEmailAddress = TheFindEmployeeEmailAddressDataSet.FindEmployeeEmailAddress[0].EmailAddress;

                            blnNotAnEmail = TheDataValidationClass.VerifyEmailAddress(strEmailAddress);

                            if (blnNotAnEmail == true)
                            {
                                blnSendEmail = false;
                            }
                            else if (blnNotAnEmail == false)
                            {
                                blnSendEmail = true;
                            }
                        }
                        else
                        {
                            blnSendEmail = false;
                        }
                    }


                    NewEmployeeRow.EmailAddress = strEmailAddress;
                    NewEmployeeRow.SendEmail    = blnSendEmail;

                    /*TheFindEmployeeByEmployeeIDDataSet = TheEmployeeClass.FindEmployeeByEmployeeID(TheComboEmployeeDataSet.employees[intSelectedIndex].EmployeeID);
                     *
                     * if(TheFindEmployeeByEmployeeIDDataSet.FindEmployeeByEmployeeID[0].EmployeeGroup == "USERS")
                     * {
                     *  NewEmployeeRow.SendEmail = false;
                     * }
                     * else
                     * {
                     *  NewEmployeeRow.SendEmail = true;
                     * }*/

                    TheAssigneEmployeesDataSet.assignemployees.Rows.Add(NewEmployeeRow);

                    TheMessagesClass.InformationMessage("Employee Added");
                    txtEnterLastName.Text = "";
                }
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Update Specific Task // Select Employee Combo Box " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }
コード例 #6
0
        private void cboSelectEmployee_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            //setting local variables
            string strLastName;
            string strFirstName;
            string strEmailAddress = "";
            int    intSelectedIndex;
            int    intEmployeeID;
            bool   blnRecordFound = false;
            bool   blnSendEmail   = true;
            int    intRecordsReturned;
            bool   blnNotAnEmail;

            try
            {
                intSelectedIndex = cboSelectEmployee.SelectedIndex - 1;

                if (intSelectedIndex > -1)
                {
                    intEmployeeID = TheComboEmployeeDataSet.employees[intSelectedIndex].EmployeeID;

                    blnRecordFound = CheckForExistingEmployee(intEmployeeID);

                    if (blnRecordFound == true)
                    {
                        TheMessagesClass.ErrorMessage("Employee Has Already Been Added");

                        return;
                    }

                    strFirstName = TheComboEmployeeDataSet.employees[intSelectedIndex].FirstName;
                    strLastName  = TheComboEmployeeDataSet.employees[intSelectedIndex].LastName;

                    TheFindEmployeeEmailAddressDataSet = TheEmployeeClass.FindEmployeeEmailAddress(intEmployeeID);

                    intRecordsReturned = TheFindEmployeeEmailAddressDataSet.FindEmployeeEmailAddress.Rows.Count;

                    if (intRecordsReturned == 0)
                    {
                        blnSendEmail = false;
                    }
                    else if (intRecordsReturned > 0)
                    {
                        if (TheFindEmployeeEmailAddressDataSet.FindEmployeeEmailAddress[0].IsEmailAddressNull() == false)
                        {
                            strEmailAddress = TheFindEmployeeEmailAddressDataSet.FindEmployeeEmailAddress[0].EmailAddress;

                            blnNotAnEmail = TheDataValiationClass.VerifyEmailAddress(strEmailAddress);

                            if (blnNotAnEmail == true)
                            {
                                blnSendEmail = false;
                            }
                            else if (blnNotAnEmail == false)
                            {
                                blnSendEmail = true;
                            }
                        }
                        else
                        {
                            blnSendEmail = false;
                        }
                    }

                    AssignEmployeesDataSet.assignemployeesRow NewEmployeeRow = TheAssignEmployeesDataSet.assignemployees.NewassignemployeesRow();

                    NewEmployeeRow.EmailAddress = strEmailAddress;
                    NewEmployeeRow.EmployeeID   = intEmployeeID;
                    NewEmployeeRow.FirstName    = strFirstName;
                    NewEmployeeRow.LastName     = strLastName;
                    NewEmployeeRow.SendEmail    = blnSendEmail;

                    TheAssignEmployeesDataSet.assignemployees.Rows.Add(NewEmployeeRow);

                    TheMessagesClass.InformationMessage("Employee Added");
                    txtLastName.Text = "";
                    cboSelectEmployee.Items.Clear();

                    mitProcess.IsEnabled = true;
                }
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Assign Tasks // Combo Box Selection Change " + Ex.Message);

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