private void LoadGrid()
        {
            int intEmployeeCounter;
            int intEmployeeNumberOfRecords;
            int intToolCounter;
            int intToolNumberOfRecords;
            int intEmployeeID;
            int intCurrentLocation;

            try
            {
                TheCurrentToolsDataSet.currenttools.Rows.Clear();

                TheFindDeactivatedEmployeesDataSet = TheEmployeeClass.FindDeactivatedEmployees();

                intEmployeeNumberOfRecords = TheFindDeactivatedEmployeesDataSet.FindDeactivatedEmployees.Rows.Count - 1;

                for (intEmployeeCounter = 0; intEmployeeCounter <= intEmployeeNumberOfRecords; intEmployeeCounter++)
                {
                    intEmployeeID = TheFindDeactivatedEmployeesDataSet.FindDeactivatedEmployees[intEmployeeCounter].EmployeeID;

                    TheFindToolsByEmployeeIDDataSet = TheToolsClass.FindToolsByEmployeeID(intEmployeeID);

                    intToolNumberOfRecords = TheFindToolsByEmployeeIDDataSet.FindToolsByEmployeeID.Rows.Count - 1;

                    if (intToolNumberOfRecords > -1)
                    {
                        for (intToolCounter = 0; intToolCounter <= intToolNumberOfRecords; intToolCounter++)
                        {
                            intCurrentLocation = TheFindToolsByEmployeeIDDataSet.FindToolsByEmployeeID[intToolCounter].CurrentLocation;

                            TheFindEmployeeByEmployeeIDDataSet = TheEmployeeClass.FindEmployeeByEmployeeID(intCurrentLocation);

                            CurrentToolsDataSet.currenttoolsRow NewToolRow = TheCurrentToolsDataSet.currenttools.NewcurrenttoolsRow();

                            NewToolRow.AssignedOffice  = TheFindEmployeeByEmployeeIDDataSet.FindEmployeeByEmployeeID[0].FirstName;
                            NewToolRow.FirstName       = TheFindDeactivatedEmployeesDataSet.FindDeactivatedEmployees[intEmployeeCounter].FirstName;
                            NewToolRow.LastName        = TheFindDeactivatedEmployeesDataSet.FindDeactivatedEmployees[intEmployeeCounter].LastName;
                            NewToolRow.ToolID          = TheFindToolsByEmployeeIDDataSet.FindToolsByEmployeeID[intToolCounter].ToolID;
                            NewToolRow.Description     = TheFindToolsByEmployeeIDDataSet.FindToolsByEmployeeID[intToolCounter].ToolDescription;
                            NewToolRow.TransactionDate = TheFindToolsByEmployeeIDDataSet.FindToolsByEmployeeID[intToolCounter].TransactionDate;

                            TheCurrentToolsDataSet.currenttools.Rows.Add(NewToolRow);
                        }
                    }
                }

                dgrTools.ItemsSource = TheCurrentToolsDataSet.currenttools;
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Deactivate Employee Tools // Load Grid " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }
示例#2
0
        public FindDeactivatedEmployeesDataSet FindDeactivatedEmployees()
        {
            try
            {
                aFindDeactivatedEmployeesDataSet      = new FindDeactivatedEmployeesDataSet();
                aFindDeactivatedEmployeesTableAdapter = new FindDeactivatedEmployeesDataSetTableAdapters.FindDeactivatedEmployeesTableAdapter();
                aFindDeactivatedEmployeesTableAdapter.Fill(aFindDeactivatedEmployeesDataSet.FindDeactivatedEmployees);
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Employee Class // Find Deactivated Employees " + Ex.Message);
            }

            return(aFindDeactivatedEmployeesDataSet);
        }