private int FindEmployeeID(string strFirstName, string strLastName)
        {
            int intEmployeeID = 0;
            int intCounter;
            int intNumberOfRecords;

            try
            {
                TheFindAllEmployeesByLastNameDataSet = TheEmployeeClass.FindAllEmployeesByLastName(strLastName);

                intNumberOfRecords = TheFindAllEmployeesByLastNameDataSet.FindAllEmployeeByLastName.Rows.Count - 1;

                for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++)
                {
                    if (strFirstName == TheFindAllEmployeesByLastNameDataSet.FindAllEmployeeByLastName[intCounter].FirstName)
                    {
                        intEmployeeID = TheFindAllEmployeesByLastNameDataSet.FindAllEmployeeByLastName[intCounter].EmployeeID;
                    }
                }
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Find Project Employee Hours //  Find Employee ID " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());

                intEmployeeID = -1;
            }

            return(intEmployeeID);
        }
        private void ResetControls()
        {
            int    intCounter;
            int    intNumberOfRecords;
            int    intRecordsReturned;
            string strLastName;

            try
            {
                TheImportVehiclesDataSet.importvehicles.Rows.Clear();

                TheFindActiveVehicleMainDataSet = TheVehicleMainClass.FindActiveVehicleMain();

                intNumberOfRecords = TheFindActiveVehicleMainDataSet.FindActiveVehicleMain.Rows.Count - 1;

                for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++)
                {
                    strLastName = TheFindActiveVehicleMainDataSet.FindActiveVehicleMain[intCounter].VehicleNumber;

                    TheFindAllEmployeebyLastNameDataSet = TheEmployeeClass.FindAllEmployeesByLastName(strLastName);

                    intRecordsReturned = TheFindAllEmployeebyLastNameDataSet.FindAllEmployeeByLastName.Rows.Count;

                    if (intRecordsReturned < 1)
                    {
                        ImportVehiclesDataSet.importvehiclesRow NewVehicleRow = TheImportVehiclesDataSet.importvehicles.NewimportvehiclesRow();

                        NewVehicleRow.AssignedOffice      = TheFindActiveVehicleMainDataSet.FindActiveVehicleMain[intCounter].AssignedOffice;
                        NewVehicleRow.CDLRequired         = "N/A";
                        NewVehicleRow.DOTStatus           = "N/A";
                        NewVehicleRow.DOTStatusID         = -1;
                        NewVehicleRow.EmployeeID          = -1;
                        NewVehicleRow.GPSStatusID         = -1;
                        NewVehicleRow.IMEI                = "N/A";
                        NewVehicleRow.LicensePlate        = "N/A";
                        NewVehicleRow.MedicalCardRequired = "N/A";
                        NewVehicleRow.OdometerReading     = 0;
                        NewVehicleRow.VehicleMake         = "N/A";
                        NewVehicleRow.VehicleModel        = "N/A";
                        NewVehicleRow.VehicleNumber       = strLastName;
                        NewVehicleRow.VINNumber           = "N/A";
                        NewVehicleRow.Year                = 0;
                        NewVehicleRow.TamperTag           = "N/A";

                        TheImportVehiclesDataSet.importvehicles.Rows.Add(NewVehicleRow);
                    }
                }

                dgrResutls.ItemsSource = TheImportVehiclesDataSet.importvehicles;
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Add Vehicle To Employee Table // Reset Controls " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }
예제 #3
0
        public FindAllEmployeesByLastNameDataSet FindAllEmployeesByLastName(string strLastName)
        {
            try
            {
                aFindAllEmployeesByLastNameDataSet      = new FindAllEmployeesByLastNameDataSet();
                aFindAllEmployeesByLastNameTableAdapter = new FindAllEmployeesByLastNameDataSetTableAdapters.FindAllEmployeeByLastNameTableAdapter();
                aFindAllEmployeesByLastNameTableAdapter.Fill(aFindAllEmployeesByLastNameDataSet.FindAllEmployeeByLastName, strLastName);
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, Ex.Message);
            }

            return(aFindAllEmployeesByLastNameDataSet);
        }
예제 #4
0
        private void txtEmployeeLastName_TextChanged(object sender, TextChangedEventArgs e)
        {
            string strLastName;
            int    intNumberOfRecords;
            int    intCounter;
            string strFullName;

            try
            {
                strLastName = txtEmployeeLastName.Text;

                if (strLastName.Length > 2)
                {
                    TheFindAllEmployeesByLastNameDataSet = TheEmployeeClass.FindAllEmployeesByLastName(strLastName);

                    intNumberOfRecords = TheFindAllEmployeesByLastNameDataSet.FindAllEmployeeByLastName.Rows.Count;

                    if (intNumberOfRecords < 1)
                    {
                        TheMessagesClass.ErrorMessage("Employee Was Not Found");
                        return;
                    }

                    cboSelectEmployee.Items.Clear();

                    cboSelectEmployee.Items.Add("Select Employee");

                    for (intCounter = 0; intCounter < intNumberOfRecords; intCounter++)
                    {
                        strFullName  = TheFindAllEmployeesByLastNameDataSet.FindAllEmployeeByLastName[intCounter].FirstName + " ";
                        strFullName += TheFindAllEmployeesByLastNameDataSet.FindAllEmployeeByLastName[intCounter].LastName;

                        cboSelectEmployee.Items.Add(strFullName);
                    }

                    cboSelectEmployee.SelectedIndex = 0;
                }
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Employee Lookup // Employee Last Name Textbox " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }
예제 #5
0
        private void txtEnterLastName_TextChanged(object sender, TextChangedEventArgs e)
        {
            //this will call the like search
            string strLastName;
            int    intNumberOfRecords;
            int    intCounter;
            int    intLength;

            try
            {
                strLastName = txtEnterLastName.Text;

                intLength = strLastName.Length;

                if (intLength > 2)
                {
                    cboSelectEmployee.Items.Clear();
                    cboSelectEmployee.Items.Add("Select Employee");

                    TheFindAllEmployeesByLastNameDataSet = TheEmployeeClass.FindAllEmployeesByLastName(strLastName);

                    intNumberOfRecords = TheFindAllEmployeesByLastNameDataSet.FindAllEmployeeByLastName.Rows.Count - 1;

                    if (intNumberOfRecords == -1)
                    {
                        TheMessagesClass.ErrorMessage("Employees Not Found");
                        return;
                    }

                    for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++)
                    {
                        cboSelectEmployee.Items.Add(TheFindAllEmployeesByLastNameDataSet.FindAllEmployeeByLastName[intCounter].FirstName + " " + TheFindAllEmployeesByLastNameDataSet.FindAllEmployeeByLastName[intCounter].LastName);
                    }

                    cboSelectEmployee.SelectedIndex = 0;
                }
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Edit Employee // Enter Last Name Event " + Ex.Message);

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