Пример #1
0
    /// <summary>
    /// Gets all the information this class needs and sets the active page
    /// </summary>
    public override void CheckTypeAndFill()
    {
        if (!LoginCheck.LoggedIn || user == null)
            Response.Redirect("login.aspx");
        else if (user.UserCompany.CompanyID == 0 && user.UserCv.CvID != 0)
        {
            service = new MatchyService();
            JobMapping jobMapping = new JobMapping();
            CompanyMapping compMapping = new CompanyMapping();
            user.UserCompany = compMapping.MapFromService(service.GetCompany(getURL())[0]);

            MatchyBackend.Job[] jobs = service.GetJobByCompany(user.UserCompany.CompanyID);
            job = new Job[jobs.Length];
            for (int i = 0; i < jobs.Length; i++)
                job[i] = jobMapping.mapFromService(jobs[i]);
        }
        else
        {
            var contentPlaceHolder = (ContentPlaceHolder)Master.FindControl("contentPlaceholderHeader");
            var profileLink = (LinkButton)contentPlaceHolder.FindControl("profileLink");
            profileLink.CssClass = "active";

            service = new MatchyService();
            JobMapping mapping = new JobMapping();
            MatchyBackend.Job[] jobs = service.GetJobByCompany(user.UserCompany.CompanyID);
            job = new Job[jobs.Length];
            for (int i = 0; i < jobs.Length; i++)
                job[i] = mapping.mapFromService(jobs[i]);

            Session["JobList"] = job;
        }
    }
Пример #2
0
    public MatchyBackend.Job mapToService(Job job)
    {
        CompanyMapping companyMapping = new CompanyMapping();
        EducationMapper educationMapping = new EducationMapper();
        DetailJobMapper detailMapping = new DetailJobMapper();

        MatchyBackend.Job backEndUser = new MatchyBackend.Job()
        {
            JobID = job.JobID,
            Company = companyMapping.MapToService(job.Company),
            Education = educationMapping.MapToService(job.Education),
            DetailJob = detailMapping.MapToService(job.DetailJob),
            JobTitle = job.JobTitle,
            JobDescription = job.JobDescription,
            JobPlaceDate = job.JobPlaceDate,
            JobHours = job.JobHours
        };

        return backEndUser;
    }
 /// <summary>
 /// Checks if the URL is valid with content.
 /// </summary>
 public override void changeURL()
 {
     int parseable;
     if (url.Contains("="))
     {
         profileId = Request.QueryString["profile"];
     }
     service = new MatchyService();
     if (Int32.TryParse(profileId, out parseable))
     {
         try
         {
             JobMapping mapping = new JobMapping();
             currentJob = mapping.mapFromService(service.GetJob(Convert.ToInt32(profileId))[0]);
             Session["JobObject"] = job;
         }
         catch
         {
             Response.Redirect("vacature.aspx?page=1");
         }
     }
     else
         Response.Redirect("vacature.aspx?page=1");
 }
 /// <summary>
 /// Gets all the information this class needs.
 /// </summary>
 public override void CheckTypeAndFill()
 {
     if ((((User)Session["UserObjectOwn"]).UserCv.CvID) != 0)
     {
         job = (Job[])Session["SearchList"];
         cv = new Cv[0];
     }
     else
     {
         cv = (Cv[])Session["SearchList"];
         job = new Job[0];
     }
 }
Пример #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");
    }