Пример #1
0
        public static void SponsorCompanyLoad(int companyId)
        {
            string  line       = "--------------------------------------------";
            Company objCompany = Company.Load(companyId);



            Console.WriteLine();

            Console.WriteLine("{0}\nCompany Properties\n{0}", line);

            Console.WriteLine(" Sponsor company = " + objCompany.CompnayId);
            Console.WriteLine(" Company name  = " + objCompany.CompanyName);
            Console.WriteLine(" Company address  = " + objCompany.Address);

            Console.WriteLine(" Company City  = " + objCompany.City);
            Console.WriteLine(" State  = " + objCompany.State);
            Console.WriteLine(" City  = " + objCompany.Zipcode);

            Console.WriteLine(" Phone  = " + objCompany.PhoneNumber);


            Console.WriteLine();

            Console.WriteLine("{0}\nManager Section \n{0}", line);

            int counter = 0;

            foreach (var objManager in objCompany.Managers)
            {
                Console.WriteLine("{0}\n Manager #{1} \n{0}", line, ++counter);

                Console.WriteLine("Sponsor SponsorManagerID is = " + objManager.ManagerId);

                Console.WriteLine("Sponsor Firstname is = " + objManager.FirstName);
                Console.WriteLine("Sponsor Lastname is = " + objManager.LastName);
                Console.WriteLine("Sponsor Title is = " + objManager.Title);
                Console.WriteLine("Sponsor Department is = " + objManager.Department);
                Console.WriteLine("Sponsor Organization is =" + objManager.Organization);
                Console.WriteLine("Sponsor Address is = " + objManager.Address);
                Console.WriteLine("Sponsor City is = " + objManager.City);
                Console.WriteLine("Sponsor State is = " + objManager.State);
                Console.WriteLine("Sponsor ZipCode is = " + objManager.Zipcode);
                Console.WriteLine("Sponsor WorkPhone is =" + objManager.PhoneWork);
                Console.WriteLine("Sponsor CellPhone is = " + objManager.PhoneCell);
                Console.WriteLine("Sponsor Email is = " + objManager.Email);

                Console.WriteLine();

                Console.WriteLine("{0}\nManager #{1} Position \n{0}", line, counter);

                int ctr = 0;
                foreach (var objPosition in objManager.Positions)
                {
                    Console.WriteLine("{0}\n Position #{2} for  Manager #{1} \n{0}", line, counter, ++ctr);
                    Console.WriteLine("InternshipPositionID is = " + objPosition.PositionId);


                    Console.WriteLine("Intership PositionType is = " + objPosition.PositionType);
                    Console.WriteLine("Intership PositionTitle is = " + objPosition.Title);
                    Console.WriteLine("Intership Description is = " + objPosition.Duties);
                    Console.WriteLine("Intership SkillSet is = " + objPosition.Skills);
                    Console.WriteLine("Intership WorkHours is = " + objPosition.WorkHours);
                    Console.WriteLine("Intership NumWorkDays is = " + objPosition.WorkDays);
                }
            }
        }
Пример #2
0
        public static int SponsorCompanyInsert()
        {
            //Create Company
            Company objCompany = new Company
            {
                CompanyName = "My NYC Company",
                Address     = "48 White St",
                City        = "Stamford",
                State       = "CT",
                Zipcode     = "11385",
                PhoneNumber = "917-983-3388"
            };

            //insert Company
            objCompany.Insert();

            //Create Manager
            Manager objManager1 = new Manager
            {
                ManagerId    = 9,
                FirstName    = "John",
                LastName     = "Doe",
                Title        = "CT",
                Department   = "11385",
                Organization = "917-983-3388",
                Address      = "32 Cupper St",
                City         = "Danbury",
                State        = "CT",
                Zipcode      = "11368",
                PhoneWork    = "212-983-7487",
                PhoneCell    = "347-9839-6765",
                Email        = "*****@*****.**"
            };

            //Insert Manager
            objCompany.AddManager(objManager1);


            //Create Position
            Position objPosition1 = new Position
            {
                PositionType = PositionType.Volunteer,
                Title        = "IT Intern",
                Duties       = "Help desk",
                Skills       = "AAA",
                WorkHours    = 32,
                WorkDays     = 5
            };

            //Insert posistion
            objManager1.AddPosition(objPosition1);


            Manager objManager2 = new Manager
            {
                FirstName    = "Stacy",
                LastName     = "Lane",
                Title        = "Big Boss",
                Department   = "Sales",
                Organization = "SP Developers",
                Address      = "300 Jay St",
                City         = "Brooklyn",
                State        = "NY",
                Zipcode      = "11218",
                PhoneWork    = "718-897-4981",
                PhoneCell    = "615-520-8481",
                Email        = "*****@*****.**"
            };

            objCompany.AddManager(objManager2);

            Position objPosition2 = new Position
            {
                PositionType = PositionType.Paid,
                Title        = "Developer",
                Duties       = "Build Applications",
                Skills       = "C#, VB.NET",
                WorkHours    = 40,
                WorkDays     = 6
            };


            Position objPosition3 = new Position
            {
                PositionType = PositionType.Credit,
                Title        = "Assistant",
                Duties       = "Assist CEO",
                Skills       = "Book keeping",
                WorkHours    = 20.6m,
                WorkDays     = 3.5m
            };

            objManager2.AddPosition(objPosition2);
            objManager2.AddPosition(objPosition3);

            return(objCompany.CompnayId);
        }