Пример #1
0
    /// <summary>
    /// Change the information based on the URL information
    /// </summary>
    public override void changeURL()
    {
        int parseable;
        if (url.Contains("="))
            profileId = Request.QueryString["profile"];

        service = new MatchyService();
        if (Int32.TryParse(profileId, out parseable))
        {
            try
            {
                CvMapping mapping = new CvMapping();
                Cv = mapping.mapFromService(service.GetCv(Convert.ToInt32(profileId))[0]);
                Session["CvObject"] = Cv;
                User newUser = (User)Session["UserObjectOwn"];
                user.UserCv = Cv;
                newUser = (User)Session["UserObjectOwn"];
            }
            catch
            {
                Response.Redirect("vacature.aspx?page=1");
            }
        }
        else
            Response.Redirect("vacature.aspx?page=1");
    }
Пример #2
0
    public Match mapFromService(MatchyBackend.Match match)
    {
        CvMapping cvMapping = new CvMapping();
        JobMapping jobMapping = new JobMapping();

        return new Match()
        {
            Cv = cvMapping.mapFromService(match.Cv),
            Date = match.Date,
            Job = jobMapping.mapFromService(match.Job),
            Score = match.Score
        };
    }
Пример #3
0
    public User mapFromService(MatchyBackend.User user)
    {
        CompanyMapping companyMapping = new CompanyMapping();
        CvMapping cvMapping = new CvMapping();

        return new User()
        {
            BirthDay = user.BirthDay,
            Email = user.Email,
            MayLogin = user.MayLogin,
            Pass = user.Pass,
            Type = user.Type,
            UserCompany = companyMapping.MapFromService(user.UserCompany),
            UserCv = cvMapping.mapFromService(user.UserCv),
            ProfileId = user.ProfileId
        };
    }
Пример #4
0
 /// <summary>
 /// Gets all the information this page needs.
 /// </summary>
 public override void CheckTypeAndFill()
 {
     if (!LoginCheck.LoggedIn || user == null)
         Response.Redirect("login.aspx");
     else if (user.UserCv.CvID == 0 && user.UserCompany.CompanyID != 0)
     {
         service = new MatchyService();
         UserMapping mapping = new UserMapping();
         CvMapping cvMapping = new CvMapping();
         user = mapping.mapFromService(service.GetUser(Int32.Parse(profileId))[0]);
         user.UserCv = cvMapping.mapFromService(service.GetCv(getURL())[0]);
         Session["UserObject"] = user;
     }
     else
     {
         var contentPlaceHolder = (ContentPlaceHolder)Master.FindControl("contentPlaceholderHeader");
         var profileLink = (LinkButton)contentPlaceHolder.FindControl("profileLink");
         profileLink.CssClass = "active";
     }
 }
Пример #5
0
    /// <summary>
    /// Gets all the information this class needs.
    /// </summary>
    public override void CheckTypeAndFill()
    {
        if ((userOwn.UserCv.CvID) != 0)
        {
            ((User)Session["UserObject"]).UserCompany = new DataAccessObjects.Company();

            if ((Job[])Session["JobList"] == null)
            {
                service = new MatchyService();
                JobMapping mapping = new JobMapping();

                MatchyBackend.Job[] jobs = service.GetJob(0);

                job = new Job[jobs.Length];
                for (int i = 0; i < jobs.Length; i++)
                    job[i] = mapping.mapFromService(jobs[i]);

                Session["JobList"] = job;
            }
            else
                job = (Job[])Session["JobList"];
        }
        else
        {
            ((User)Session["UserObject"]).UserCv = new DataAccessObjects.Cv();
            if ((Cv[])Session["CvList"] == null)
            {
                service = new MatchyService();
                CvMapping mapping = new CvMapping();

                MatchyBackend.Cv[] cvs = service.GetCvByLimit(0);
                cv = new Cv[cvs.Length];
                for (int i = 0; i < cvs.Length; i++)
                    cv[i] = mapping.mapFromService(cvs[i]);

                Session["CvList"] = cv;
            }
            else
                cv = (Cv[])Session["CvList"];
        }
    }
Пример #6
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");
    }