public MatchyBackend.Search MapToService(Search search)
    {
        BrancheMapping brancheMapper = null;
        EducationMapper eduMapper = null;

        if(search.Branche != null)
            brancheMapper = new BrancheMapping();
        if(search.Education != null)
            eduMapper = new EducationMapper();

        MatchyBackend.Search result = new MatchyBackend.Search();

        if (search != null)
        {
            return new MatchyBackend.Search()
            {
                SearchTerm = search.SearchTerm,
                Education = eduMapper != null ? eduMapper.MapToService(search.Education) : null,
                City = search.City,
                Hours = search.Hours,
                Branche = brancheMapper != null ? brancheMapper.mapToService(search.Branche) : null
            };
        }
        else
            return result;
    }
Example #2
0
 /// <summary>
 /// Builds the dropdownlist for Branche
 /// </summary>
 /// <param name="brancheList">list that needs to be filled</param>
 public void buildDropDownListBranche(DropDownList brancheList)
 {
     BrancheMapping brancheMapping = new BrancheMapping();
     service = new MatchyService();
     MatchyBackend.Branche[] branches = service.GetBranche(0);
     branche = new Branche[branches.Length];
     brancheList.Items.Add(new ListItem("Branches", "Default"));
     for (int i = 0; i < branches.Length; i++)
     {
         branche[i] = brancheMapping.mapFromService(branches[i]);
         brancheList.Items.Add(new ListItem(branches[i].Description, branches[i].branche_ID.ToString()));
     }
 }
    public Search MapFromService(MatchyBackend.Search search)
    {
        var eduMapper = new EducationMapper();
        var brancheMapper = new BrancheMapping();

        return new Search()
        {
            SearchTerm = search.SearchTerm,
            Education = eduMapper.MapFromService(search.Education),
            City = search.City,
            Hours = search.Hours,
            Branche = brancheMapper.mapFromService(search.Branche)
        };
    }