Пример #1
0
        public static void EmployerClassTest()
        {



            Employer objEmployer = new Employer();


            //Testing default constructor
            //Testing Default Constructor
            Console.WriteLine("Student CST4905Student_EmpID is = " + objEmployer.EmployerId);
            Console.WriteLine("Student Title is = " + objEmployer.Title);

            Console.WriteLine("Student CompanyName is = " + objEmployer.CompanyName);
            Console.WriteLine("Student Department is = " + objEmployer.Department);
            Console.WriteLine("Student Manager is = " + objEmployer.SupervisorName);

            Console.WriteLine("Student Address is = " + objEmployer.Address);
            Console.WriteLine("Student City is = " + objEmployer.City);
            Console.WriteLine("Student State is = " + objEmployer.State);

            Console.WriteLine("Student ZipCode is = " + objEmployer.Zipcode);
            Console.WriteLine("Student Phone is = " + objEmployer.PhoneNumber);
            Console.WriteLine("Student Duties is = " + objEmployer.Duties);

            //Testing PROPERTIES BY SETTING & GETTING PROPERTIES
            Console.WriteLine("Testing Property SET");
            Console.WriteLine();

            objEmployer.EmployerId = 12;
            objEmployer.Title = "Programmer";
            objEmployer.CompanyName = "Sunrise";
            objEmployer.Department = "IT";
            objEmployer.SupervisorName = "Roger Razim";
            objEmployer.Address = "76 Stone St";

            objEmployer.City = "New York";
            objEmployer.State = "NY";
            objEmployer.Zipcode = "11368";
            objEmployer.PhoneNumber = "917-487-5876";
            objEmployer.Duties = "Debuger";



            Console.WriteLine();
            Console.WriteLine();


            //Testing property SET by performing a PROPERTY GET. If what you GET is what you SET, properties are working
            Console.WriteLine("Testing Property GET");
            Console.WriteLine();
            Console.WriteLine("CST4905 Student CST 4905 EMPID = " + objEmployer.EmployerId);
            Console.WriteLine("CST4905 Student Title  = " + objEmployer.Title);

            Console.WriteLine("CST4905 Student CompanyName  = " + objEmployer.CompanyName);
            Console.WriteLine("CST4905 Student Department  = " + objEmployer.Department);
            Console.WriteLine("CST4905 Student Manager  = " + objEmployer.SupervisorName);

            Console.WriteLine("CST4905 Student Address  = " + objEmployer.Address);
            Console.WriteLine("CST4905 Student City  = " + objEmployer.City);
            Console.WriteLine("CST4905 Student State  = " + objEmployer.State);

            Console.WriteLine("CST4905 Student Zip = " + objEmployer.Zipcode);
            Console.WriteLine("CST4905 Student Phone  = " + objEmployer.PhoneNumber);
            Console.WriteLine("CST4905 Student Duties  = " + objEmployer.Duties);


            Console.WriteLine();
            Console.WriteLine();

        }
Пример #2
0
        public static string StudentInsert()
        {
            Console.WriteLine("Loading Modules from the Database");
            ModuleCollection objModules = ModuleCollection.GetAll();

            foreach (var m in objModules)
            {
                Console.WriteLine("ModuleId: {0} Description: {1}", m.ModuleId, m.Description);
            }

            Console.WriteLine();


            Console.WriteLine("Loading Preference from the Database");
            PreferenceOptionCollection objPrefrences = PreferenceOptionCollection.GetAll();

            foreach (var p in objPrefrences)
            {
                Console.WriteLine("PrefernceId: {0} Description: {1}", p.PreferenceId, p.Description);
            }


            Console.WriteLine();

            PreferenceRankCollection objPrefernceRanks = new PreferenceRankCollection()
            {
                new PreferenceRank(objPrefrences[0], 1),
                new PreferenceRank(objPrefrences[1], 5),
                new PreferenceRank(objPrefrences[2], 3),
                new PreferenceRank(objPrefrences[3], 4),
            };



            ModuleTakenCollection objModulesTaken = new ModuleTakenCollection
            {
                new ModuleTaken(objModules[0]),
                new ModuleTaken(objModules[1]),
                new ModuleTaken(objModules[2]),
            };



            StudentContent objFileUpload = new StudentContent
            {
                Resume     = @"\\somewhere\Resume",
                Transcript = @"\\somewhere\Transcript",
            };

            InternshipRequirement objRequirement = new InternshipRequirement
            {
                DriverLicense         = true,
                InternshipType        = InternshipType.Project,
                Owncar                = true,
                TravelNJ              = true,
                TravelWestchester     = true,
                ResidenceStatus       = ResidenceStatus.PermanentResident,
                Limitation            = true,
                LimitationExplanation = "Explanation goes here",
                Semester              = "Fall 2013",
                PreferenceRanks       = objPrefernceRanks,
                ModulesTaken          = objModulesTaken,
                studentContent        = objFileUpload
            };

            Employer objEmployer = new Employer
            {
                Title          = "Programmer",
                CompanyName    = "Sunrise",
                Department     = "IT",
                SupervisorName = "Roger Razim",
                Address        = "76 Stone St",
                City           = "New York",
                State          = "NY",
                Zipcode        = "11368",
                PhoneNumber    = "917-487-5876",
                Duties         = "Debuger"
            };

            var objStudent = new Student
            {
                StudentID             = "89498196",
                FirstName             = "Joe",
                LastName              = "Smith",
                Last4SSN              = "1234",
                Address               = "333 Flatbush Avenue",
                City                  = "Brooklyn",
                State                 = "NY",
                Zipcode               = "11201",
                PhoneDay              = "7182605555",
                PhoneEvening          = "7182605551",
                PhoneCell             = "9172605552",
                Email                 = "*****@*****.**",
                GraduationDate        = new DateTime(2012, 01, 01),
                GPA                   = 3.9m,
                InternshipRequirement = objRequirement,
                Employer              = objEmployer
            };

            objStudent.Insert();



            return(objStudent.StudentID);
        }