Beispiel #1
0
        static void AddMaleNames(int seedCount, int nameCount, int iterationCount)
        {
            Random rand                  = new Random(seedCount);
            var    genMales              = new PersonNameGenerator(rand);
            var    firstNameList         = genMales.GenerateMultipleMaleFirstNames(nameCount).ToList();
            var    lastNameList          = genMales.GenerateMultipleLastNames(nameCount).ToList();
            List <MGTSEmployee> mgtsList = new List <MGTSEmployee>();
            var mgts = new MGTSEmployee();
            int id   = 0;

            for (int i = 0; i < iterationCount; i++)
            {
                mgts.FirstName = firstNameList[i];
                mgts.LastName  = lastNameList[i];
                mgtsList.Add(mgts);
                id += i;
                Console.WriteLine("{0}. {1} {2}", i, mgts.FirstName, mgts.LastName);
            }
        }
Beispiel #2
0
        public void AddMaleEmpAttributes(int seedCount, int nameCount, int iterationCount)
        {
            Random rand          = new Random(seedCount);
            var    genMales      = new PersonNameGenerator(rand);
            var    firstNameList = genMales.GenerateMultipleMaleFirstNames(nameCount).ToList();
            var    lastNameList  = genMales.GenerateMultipleLastNames(nameCount).ToList();

            _id = 0;
            var mgts = new MGTSEmployee();

            _mgtsList = new List <MGTSEmployee>();
            _lwCode   = new List <string> {
                "1000", "0001"
            };
            Random lwRandom = new Random();
            int    lwSeed   = lwRandom.Next(2);

            for (int i = 0; i < iterationCount; i++)
            {
                //mgts.MgtsemployeeCode =
                mgts.FirstName         = firstNameList[i];
                mgts.LastName          = lastNameList[i];
                mgts.FullName          = firstNameList[i] + " " + lastNameList[i];
                mgts.LawsonCompanyCode = _lwCode[lwSeed];
                _mgtsList.Add(mgts);
                _id += i;

                // See output for test purposes


                Console.WriteLine("{0}, {1}, {2}, {3}, {4}", _id, mgts.FirstName, mgts.LastName, mgts.FullName, mgts.LawsonCompanyCode);

                //if (mgts.LawsonCompanyCode == "0001")
                //{
                //    Console.WriteLine("{0}, {1}, {2}, {3}, {4}", _id, mgts.FirstName, mgts.LastName, mgts.FullName, mgts.LawsonCompanyCode);
                //}
            }
        }