Example #1
0
    public void TestSearch()
    {
        Search searchObject = new Search();
        SearchMapping searchMapping = new SearchMapping();
        searchObject.City = "Rotterdam";
        MatchyService service = new MatchyService();

        MatchyBackend.Cv[] searchCompany = service.SearchByCompany(searchMapping.MapToService(searchObject));

        if (searchCompany.Length > 0)
            Assert.Pass("Er zijn zoekresultaten.");
        else
            Assert.Pass("Er zijn geen zoekresultaten.");
    }
Example #2
0
    /// <summary>
    /// Makes an search to the backend based on the information that is filled
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Search_Click(object sender, EventArgs e)
    {
        Search searchObject = new Search();
        SearchMapping searchMapping = new SearchMapping();
        searchObject = getSearchValues();
        service = new MatchyService();

        if (userOwn.UserCv.CvID != 0)
        {
            JobMapping jobMapping = new JobMapping();
            MatchyBackend.Job[] searchEmployee = service.SearchByEmployee(searchMapping.MapToService(searchObject));
            searchJobs = new Job[searchEmployee.Length];
            for (int i = 0; i < searchEmployee.Length; i++)
                searchJobs[i] = jobMapping.mapFromService(searchEmployee[i]);

            Session["SearchList"] = searchJobs;

        }
        else if (userOwn.UserCompany.CompanyID != 0)
        {
            CvMapping cvMapping = new CvMapping();
            MatchyBackend.Cv[] searchCompany = service.SearchByCompany(searchMapping.MapToService(searchObject));
            searchCvs = new Cv[searchCompany.Length];
            for (int i = 0; i < searchCompany.Length; i++)
                searchCvs[i] = cvMapping.mapFromService(searchCompany[i]);

            Session["SearchList"] = searchCvs;
        }
        Response.Redirect("zoekresultaten.aspx");
    }