/// <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;
        }
    }
    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
        };
    }
Beispiel #3
0
    public Job mapFromService(MatchyBackend.Job job)
    {
        CompanyMapping companyMapping = new CompanyMapping();
        EducationMapper educationMapping = new EducationMapper();
        DetailJobMapper detailMapping = new DetailJobMapper();

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