Пример #1
0
        public void Swap(int x, int y)
        {
            EmplTime temp = emplTimes[x];

            emplTimes[x] = emplTimes[y];
            emplTimes[y] = temp;
        }
Пример #2
0
        public void SortByDepartment()
        {
            for (int i = 0; i < EmplTime.GetCount() - 1; i++)
            {
                int minIndex = i;
                for (int j = i + 1; j < EmplTime.GetCount(); j++)
                {
                    if (emplTimes[minIndex].CompareDept(emplTimes[j]) < 0)
                    {
                        minIndex = j;
                    }
                }

                if (minIndex != i)
                {
                    Swap(minIndex, i);
                }
            }
        }