Beispiel #1
0
        private static void LoadApplications()
        {
            for (int i = 0; i < 20; i++)
            {
                for (int j = 0; j < 5; j++) //5 applications per position
                {
                    var application = new Application()
                    {
                        AppliedPosition   = GenericBLL <Position, int> .GetByID(i + 1),
                        AssociatedProfile = GenericBLL <Profile, int> .GetByID(j + 1),
                        LastUpdated       = DateTime.Now,
                        Email             = string.Format("email{0}@fake.com", j),
                        Submitted         = i < 10 //First 10 were submitted
                    };

                    GenericBLL <Application, int> .EnsurePersistent(application);
                }
            }
        }
Beispiel #2
0
        private static void LoadPositions()
        {
            for (int i = 0; i < 20; i++) //Add 10 positions
            {
                var pos = new Position()
                {
                    AdminAccepted     = i < 15,
                    Closed            = i % 5 == 0,
                    AllowApps         = i < 13,
                    PositionTitle     = "Position Title",
                    HRRep             = "HR Rep",
                    HREmail           = "*****@*****.**",
                    HRPhone           = "555-5555",
                    ReferenceTemplate = new Template()
                    {
                        TemplateText = "Sample Text",
                        TemplateType =
                            GenericBLL <TemplateType, int> .GetByID(1)
                    },
                    DescriptionFile = new File()
                    {
                        Description = "Some File",
                        FileName    = "SomeFile",
                        FileType    = GenericBLL <FileType, int> .GetByID(1)
                    },
                    SearchPlanFile = new File()
                    {
                        Description = "Some file2",
                        FileName    = "TEST",
                        FileType    = GenericBLL <FileType, int> .GetByID(1)
                    }
                };

                pos.Departments = new List <Department>
                {
                    new Department()
                    {
                        AssociatedPosition = pos, DepartmentFIS = "AANS", PrimaryDept = true
                    },
                    new Department()
                    {
                        AssociatedPosition = pos, DepartmentFIS = "ADNO", PrimaryDept = false
                    }
                };

                if (i < 10)
                {
                    pos.Departments.Add(
                        new Department()
                    {
                        AssociatedPosition = pos, DepartmentFIS = "CHEM", PrimaryDept = false
                    }                                                                                              //Add CHEM (school 3 to last 10 positions
                        );
                }

                if (i < 5 || i > 17)
                {
                    pos.Departments.Add(
                        new Department()
                    {
                        AssociatedPosition = pos, DepartmentFIS = "APLS", PrimaryDept = false
                    });
                }

                var descriptionFile = pos.DescriptionFile;
                var searchPlanFile  = pos.SearchPlanFile;

                GenericBLL <File, int> .EnsurePersistent(descriptionFile);

                GenericBLL <File, int> .EnsurePersistent(searchPlanFile);

                GenericBLL <Position, int> .EnsurePersistent(pos);
            }
        }