Beispiel #1
0
        /// <summary>
        /// \brief <b>Description</b>
        /// \details this Method contatinates all records in the employeelist and add's them to the Container
        /// </summary>
        /// <returns></returns>
        public List <string> concatAllRecords()
        {
            List <string> container = new List <string>();
            EmployeeType  type      = EmployeeType.Default;
            int           i         = 0;

            foreach (Employee currentEmployee in EmployeeList.Values)
            {
                type = getType(currentEmployee);
                switch (type)
                {
                case EmployeeType.FT:
                    container.Add(FulltimeEmployee.join((FulltimeEmployee)currentEmployee));
                    break;

                case EmployeeType.PT:
                    container.Add(ParttimeEmployee.join((ParttimeEmployee)currentEmployee));
                    break;

                case EmployeeType.CT:
                    container.Add(ContractEmployee.join((ContractEmployee)currentEmployee));
                    break;

                case EmployeeType.SN:
                    container.Add(SeasonalEmployee.join((SeasonalEmployee)currentEmployee));
                    break;

                default:
                    break;
                }
                i++;
            }

            container.Insert(0, "");
            for (i = 0; i < commentList.Count; i++)
            {
                KeyValuePair <int, string> item = commentList.ElementAt(i);
                if (item.Key > container.Count)
                {
                    commentList.Remove(item.Key);
                    commentList.Add(container.Count, item.Value);
                    i--;
                }
                else
                {
                    container.Insert(item.Key, item.Value);
                }
            }
            return(container);
        }