示例#1
0
 public virtual void DeleteApplicantFromDB(IApplicant applicant)
 {
     try
     {
         SqlDataReader rdr = null;
         SqlCommand    cmd = new SqlCommand("dbo.DeleteApplicant", connection);
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.Add(new SqlParameter("@fname", applicant.FirstName));
         cmd.Parameters.Add(new SqlParameter("@lname", applicant.LastName));
         cmd.Parameters.Add(new SqlParameter("@noneu", applicant.NonEU));
         cmd.Parameters.Add(new SqlParameter("@night", applicant.NightStudent));
         cmd.Parameters.Add(new SqlParameter("@parttime", applicant.IsPartTime));
         //cmd.Parameters.Add(new SqlParameter("@points", applicant.LeavingCertPoints));
         cmd.Parameters.Add(new SqlParameter("@dob", applicant.DOB));
         cmd.Parameters.Add(new SqlParameter("@course", applicant.CourseID_fk));
         rdr = cmd.ExecuteReader();
         rdr.Close();
     }
     catch (Exception ex)
     {
         if (connection.State.ToString() == "Open")
         {
             connection.Close();
         }
         Application.Exit();
     }
 }
        public void DeleteApplicant(IApplicant applicant)
        {
            var applicantAdminPages = new ApplicantAdminPages(_driver);
            var applicantMenu       = new SubMenuApplicants(_driver);

            _driver.SwitchToDefaultFrame();

            // navigate directly to the Applicants page
            BrowseTo($"{BaseUrls["ApplitrackLoginPage"]}/onlineapp/admin/_admin.aspx?Destination=Applicants", _driver);

            applicantAdminPages.Dashboard.EnterSearchApplicantName($"{applicant.LastName}, {applicant.FirstName}");

            // Unmark 'Submitted Only' because it is marked by default
            applicantAdminPages.Dashboard.MarkSubmittedOnly();

            applicantAdminPages.Dashboard.ClickSearch();

            // Mark employee record in table
            _driver.SwitchToFrameById(By.Id("MainContentsIFrame"));
            applicantAdminPages.SearchResultsPage.MarkItem(applicant.AppNo.ToString());

            // Click 'Delete their file > Delete Checked Applicants'
            _driver.SwitchToDefaultFrame();
            Thread.Sleep(TimeSpan.FromSeconds(1)); // wait because the menu sometimes dissapears if clicked too fast
            applicantMenu.ClickDeleteTheirFile();

            Thread.Sleep(TimeSpan.FromSeconds(1)); // wait because 'Delete Checked Applicants' doesnt always get clicked
            applicantMenu.ClickDeleteCheckedApplicants();

            // Confirm deletion
            applicantAdminPages.VacanciesByCategoryPages.ConfirmDeletion();
        }
 public void Setup()
 {
     //Inject classes for tests
     dal       = DALLoanAPoundCreator.Create("test");
     bll       = BLLLoanAPoundCreator.Create("test", dal);
     applicant = ApplicantCreator.Create("test", bll);
 }
示例#4
0
 public virtual void addApplicant(IApplicant applicant)
 {
     try
     {
         SqlDataReader rdr = null;
         SqlCommand    cmd = new SqlCommand("dbo.CreateNewApplicant", connection);
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.Add(new SqlParameter("@appID", applicant.UserID));
         cmd.Parameters.Add(new SqlParameter("@fname", applicant.FirstName));
         cmd.Parameters.Add(new SqlParameter("@lname", applicant.LastName));
         cmd.Parameters.Add(new SqlParameter("@noneu", applicant.NonEU));
         cmd.Parameters.Add(new SqlParameter("@night", applicant.NightStudent));
         cmd.Parameters.Add(new SqlParameter("@parttime", applicant.IsPartTime));
         cmd.Parameters.Add(new SqlParameter("@points", applicant.LeavingCertPoints));
         cmd.Parameters.Add(new SqlParameter("@dob", applicant.DOB));
         cmd.Parameters.Add(new SqlParameter("@course", applicant.CourseID_fk));
         rdr = cmd.ExecuteReader();
         rdr.Close();
     }
     catch (System.Exception excep)
     {
         if (connection.State.ToString() == "Open")
         {
             connection.Close();
         }
         Application.Exit();
         //Environment.Exit(0); //Force the application to close
     }
 }
示例#5
0
 public void Setup()
 {
     dal        = DALLoanAPoundCreator.Create("test");
     bll        = BLLLoanAPoundCreator.Create("test", dal);
     loanEngine = LoanEngineCreator.Create("test", bll);
     applicant  = ApplicantCreator.Create("test", bll);
 }
        internal ICollection <Applicant> FindMultipleApplicants(IApplicant a)
        {
            var query = repo.Applicants.AsQueryable();

            query = BuildFindApplicantQuery(a, query);

            return(FindMultipleResults(query));
        }
        internal IApplicant FindApplicant(IApplicant a)
        {
            var query = repo.Applicants.AsQueryable();

            query = BuildFindApplicantQuery(a, query);

            return(FindAResult(query));
        }
 public CasesController(ICase cases, IUser users, IApplicant applicants, IStatus status)
 {
     _status     = status;
     _cases      = cases;
     _users      = users;
     _applicants = applicants;
     // injected dependancy into patron contorller
 }
        internal bool AddApplicant(IApplicant a)
        {
            EntityEntry entry = null;
            EntityState state = EntityState.Unchanged;

            entry = repo.Add(a);

            state = CheckEntryState(state, entry);
            return(VerifyEntryState(state, EntityState.Added));
        }
        internal bool UpdateApplicant(IApplicant a)
        {
            EntityEntry entry = null;
            EntityState state = EntityState.Unchanged;

            entry = repo.Update(a);

            state = CheckEntryState(state, entry);
            return(VerifyEntryState(state, EntityState.Modified));
        }
        internal bool DeleteApplicant(IApplicant a)
        {
            EntityEntry entry = null;
            EntityState state = EntityState.Unchanged;

            entry = repo.Remove(a);

            state = CheckEntryState(state, entry);
            return(VerifyEntryState(state, EntityState.Deleted));
        }
示例#12
0
        public EventBus(IInternalEventDispatcher internalEventDispatcher, IBusClient busClient,
                        IEventSource eventSource, IApiCaller apiCaller, IApplicant applicant)
        {
            Applicant = applicant;

            _internalEventDispatcher = internalEventDispatcher;
            _rabbitBusClient         = busClient;
            _eventSource             = eventSource;
            _apiCaller = apiCaller;
        }
        public Staff Create(IApplicant person)
        {
            Staff newStaff = new Staff();

            newStaff.FirstName = person.FirstName;
            newStaff.LastName  = person.LastName;
            newStaff.Email     = $"{person.FirstName}.{person.LastName}@staff.com";

            return(newStaff);
        }
 public SubmissionsController(ICase cases, IUser users, IApplicant applicants, IStatus status, IBank banks, ISubmission submissions)
 {
     _status      = status;
     _cases       = cases;
     _users       = users;
     _applicants  = applicants;
     _banks       = banks;
     _submissions = submissions;
     // injected dependancy into patron contorller
 }
示例#15
0
        public Staff Create(IApplicant person)
        {
            Staff newStaff = new Staff()
            {
                FirstName = person.FirstName,
                LastName  = person.LastName,
                Email     = $"{person.FirstName}.{person.LastName}@nurse.com"
            };

            return(newStaff);
        }
示例#16
0
 Boolean IModel.addApplicant(int appID, string fname, string lname, int nonEU, int nightStu, int isPartTime, int points, DateTime dob, string course)
 {
     try
     {
         IApplicant app = UserFactory.GetApplicantMember(appID.ToString(), fname, lname, nonEU, nightStu, isPartTime, points, dob, course);
         applicantList.Add(app);
         DataLayer.addApplicant(app);
         return(true);
     }
     catch (System.Exception excep)
     {
         return(false);
     }
 }
示例#17
0
        Boolean IModel.DeleteApplicant(string fname, string lname, int noneu, int night, int parttime, DateTime dob, string course)
        {
            IApplicant app = UserFactory.GetApplicantMember("", fname, lname, noneu, night, parttime, 0, dob, course);

            foreach (IApplicant a in ApplicantList)
            {
                if (a.FirstName.Equals(fname) && a.LastName.Equals(lname) && a.NonEU == noneu && a.IsPartTime == parttime && a.DOB == dob && a.CourseID_fk.Equals(course))
                {
                    ApplicantList.Remove(a);
                    break;
                }
            }
            DataLayer.DeleteApplicantFromDB(app);
            return(true);
        }
        static public IApplicant Create(string type, IBLLLoanAPound bll)
        {
            IApplicant applicant = null;

            switch (type)
            {
            case "test":
                applicant = new Applicant(bll);
                break;

            default:
                applicant = null;
                break;
            }
            return(applicant);
        }
示例#19
0
        public virtual List <IApplicant> getAllApplicants()
        {
            List <IApplicant> ApplicantList = new List <IApplicant>();

            try
            {
                dataset = new DataSet();
                string sql = "SELECT * From Applicants";
                dataAdapter    = new SqlDataAdapter(sql, connection);
                commandBuilder = new SqlCommandBuilder(dataAdapter);  //Generates
                dataAdapter.Fill(dataset, "ApplicantsData");
                totUsers = dataset.Tables["ApplicantsData"].Rows.Count;
                for (int i = 0; i < totUsers; i++)
                {
                    DataRow dRow = dataset.Tables["ApplicantsData"].Rows[i];
                    // Using a Factory to create the user entity object. ie seperating object creation from business logic

                    IApplicant user = UserFactory.GetApplicantMember(dRow.ItemArray.GetValue(0).ToString(),
                                                                     dRow.ItemArray.GetValue(1).ToString(),
                                                                     dRow.ItemArray.GetValue(2).ToString(),
                                                                     Convert.ToInt32(dRow.ItemArray.GetValue(3).ToString()),
                                                                     Convert.ToInt32(dRow.ItemArray.GetValue(4).ToString()),
                                                                     Convert.ToInt32(dRow.ItemArray.GetValue(5).ToString()),
                                                                     Convert.ToInt32(dRow.ItemArray.GetValue(6).ToString()),
                                                                     Convert.ToDateTime(dRow.ItemArray.GetValue(7).ToString()),
                                                                     dRow.ItemArray.GetValue(8).ToString());

                    ApplicantList.Add(user);
                }
            }
            catch (System.Exception excep)
            {
                MessageBox.Show(excep.Message);
                if (connection.State.ToString() == "Open")
                {
                    connection.Close();
                }
                Application.Exit();
                //Environment.Exit(0); //Force the application to close
            }
            return(ApplicantList);
        }
        public void FillOutPersonalInfo(IApplicant applicantData)
        {
            var applicantPages = new ApplicantPages(_driver);

            _driver.SwitchToDefaultFrame();
            _driver.SwitchToFrameById("AppDataPage");

            applicantPages.EmploymentApplicationPages.PersonalInfoPage.EnterFirstName(applicantData.FirstName);
            _test.Log(LogStatus.Info, "Enter into the 'First' name field: " + applicantData.FirstName);

            applicantPages.EmploymentApplicationPages.PersonalInfoPage.EnterLastName(applicantData.LastName);
            _test.Log(LogStatus.Info, "Enter into the 'Last' name field: " + applicantData.LastName);

            applicantPages.EmploymentApplicationPages.PersonalInfoPage.EnterEmailAddress(applicantData.Email);
            _test.Log(LogStatus.Info, "Enter into the 'Email Address' field: " + applicantData.Email);

            applicantPages.EmploymentApplicationPages.PersonalInfoPage.EnterConfirmEmail(applicantData.Email);
            _test.Log(LogStatus.Info, "Enter into the 'Confirm Email' field: " + applicantData.Email);

            if (FeatureFlags.PersonalInfo.CollectSSN)
            {
                applicantPages.EmploymentApplicationPages.PersonalInfoPage.EnterSocialSecurityNumber(applicantData.SocialSecurityNumber);
                _test.Log(LogStatus.Info, "Enter into the 'Social Security Number' field: " + applicantData.SocialSecurityNumber);

                applicantPages.EmploymentApplicationPages.PersonalInfoPage.EnterConfirmSsn(applicantData.SocialSecurityNumber);
                _test.Log(LogStatus.Info, "Enter into the 'Confirm SSN' field: " + applicantData.SocialSecurityNumber);
            }

            applicantPages.EmploymentApplicationPages.PersonalInfoPage.EnterPassword(applicantData.Password);
            _test.Log(LogStatus.Info, "Enter into the 'Password' field: " + applicantData.Password);

            applicantPages.EmploymentApplicationPages.PersonalInfoPage.EnterConfirmPassword(applicantData.Password);
            _test.Log(LogStatus.Info, "Enter into the 'Confirm Password' field: " + applicantData.Password);

            applicantPages.EmploymentApplicationPages.PersonalInfoPage.SelectSecretQuestion();
            _test.Log(LogStatus.Info, "Select a secret question");

            applicantPages.EmploymentApplicationPages.PersonalInfoPage.EnterSecretAnswer(applicantData.SecretAnswer);
            _test.Log(LogStatus.Info, "Enter into the 'Secret Answer' field: " + applicantData.SecretAnswer);

            _driver.SwitchToDefaultFrame();
        }
 private IQueryable <Applicant> BuildFindApplicantQuery(IApplicant a, IQueryable <Applicant> query)
 {
     if (!a.Email.IsNullOrEmpty())
     {
         query = query.Where(x => x.Email.Contains(a.Email));
     }
     if (!a.Name.IsNullOrEmpty())
     {
         query = query.Where(x => x.Name.Contains(a.Name));
     }
     if (!a.Country.IsNullOrEmpty())
     {
         query = query.Where(x => x.Country.Contains(a.Country));
     }
     if (a.MailAttempts != default(int))
     {
         query = query.Where(x => x.MailAttempts == a.MailAttempts);
     }
     return(query);
 }
 public AccountController(ITokenServices tokenService, IUser user, IApplicant applicant)
 {
     _applicant    = applicant;
     _user         = user;
     _tokenService = tokenService;
 }
示例#23
0
 public ApplicantController(IApplicant applicant)
 {
     _applicant = applicant;
     // injected dependancy into  contorller
 }
示例#24
0
 public ApplicantController(IApplicant applicant)
 {
     _applicant = applicant;
 }
示例#25
0
 public ExecutiveAccountsProcessor(IApplicant applicant) : base(applicant)
 {
 }
示例#26
0
 public ManagerAccountsProcessor(IApplicant applicant) : base(applicant)
 {
 }
示例#27
0
 public BaseAccountsProcessor(IApplicant applicant)
 {
     _applicant = applicant;
 }
示例#28
0
 public StaffAccountsProcessor(IApplicant applicant) : base(applicant)
 {
 }
示例#29
0
 public ApplicantController(IRequisition requisition, IApplicant applicant, IMasters masters)
 {
     _requisition = requisition;
     _applicant   = applicant;
     _imasters    = masters;
 }
示例#30
0
 public AccountController(IApplicant iapplicant)
 {
     applicant = iapplicant;
 }