Ejemplo n.º 1
0
        public JobDetail ToObject()
        {
            JobDetail obj = new JobDetail();

            ShareFunctions.CopyPropertiesTo <JobDetailModel, JobDetail>(this, obj);
            return(obj);
        }
Ejemplo n.º 2
0
        public static List <UserDetailModel> SearchResumes(int page = 1, int size = 25, ResumeSearchFilter filter = null)
        {
            if (filter == null)
            {
                filter = new ResumeSearchFilter();
            }
            if (filter.FromDate == DateTime.MinValue)
            {
                filter.FromDate = DateTime.Today.AddDays(-30);
            }
            if (filter.ToDate == DateTime.MinValue)
            {
                filter.ToDate = DateTime.Today;
            }
            List <UserDetailModel> returnList = new List <UserDetailModel>();
            PalazzoDBDataContext   context    = new PalazzoDBDataContext();
            var ud = context.procSearchResume(filter.FromDate, filter.ToDate, filter.Keyword, filter.Page, filter.PageSize, filter.DegreeSearch, 0, filter.LanguageSearch, filter.EducationSearch, filter.SkillSearch);

            //List<UserDetail> objs = context.UserDetails.Skip((page - 1) * size).Take(size).ToList();
            foreach (procSearchResumeResult o in ud)
            {
                UserDetailModel obj = new UserDetailModel();
                ShareFunctions.CopyPropertiesTo <procSearchResumeResult, UserDetailModel>(o, obj);
                returnList.Add(obj);
            }
            return(returnList);
        }
Ejemplo n.º 3
0
        public JobPost ToObject()
        {
            JobPost obj = new JobPost();

            ShareFunctions.CopyPropertiesTo <JobPostModel, JobPost>(this, obj);
            return(obj);
        }
Ejemplo n.º 4
0
        public UserDetail ToObject()
        {
            UserDetail obj = new UserDetail();

            ShareFunctions.CopyPropertiesTo <UserDetailModel, UserDetail>(this, obj);
            return(obj);
        }
Ejemplo n.º 5
0
 public JobPostModel(JobPost obj)
 {
     if (obj != null)
     {
         ShareFunctions.CopyPropertiesTo <JobPost, JobPostModel>(obj, this);
     }
 }
Ejemplo n.º 6
0
        public List <JobPost> Search(string desc, string city, string state, ref int total, int page = 1, int lastMonthsNumber = 2)
        {
            List <JobPost> returnList = new List <JobPost>();

            if (!string.IsNullOrEmpty(desc))
            {
                PalazzoDBDataContext context = new PalazzoDBDataContext();
                var results = context.procJobSearch(desc, city, state, lastMonthsNumber, page, _PageSize);


                foreach (procJobSearchResult rlt in results.ToList())
                {
                    JobPost obj = new JobPost();
                    ShareFunctions.CopyPropertiesTo <procJobSearchResult, JobPost>(rlt, obj);
                    returnList.Add(obj);
                    total = rlt.Total.Value;
                }



                //if (total == 0)
                //{
                //    total = DataContext.JobPosts.Count((job => job.Title.Contains(desc)
                //        || job.JobName.Contains(desc)
                //        || job.CompanyName.Contains(desc)
                //        || job.Category.Contains(desc)
                //        //|| job.JobDescription.Contains(desc)
                //        &&
                //        ((job.JobLocation.Contains(city)
                //        || job.JobLocation.Contains(state))
                //        //|| job.JobDescription.Contains(city)
                //        )
                //        &&
                //        (job.JobPostDate >= DateTime.Today.AddMonths(lastMonthsNumber * -1))
                //        ));
                //}

                //objs = DataContext.JobPosts.Where((job => job.Title.Contains(desc)
                //        || job.JobName.Contains(desc)
                //        || job.CompanyName.Contains(desc)
                //        || job.Category.Contains(desc)
                //        //|| job.JobDescription.Contains(desc)
                //        &&
                //        ((job.JobLocation.Contains(city)
                //        || job.JobLocation.Contains(state))
                //        //|| job.JobDescription.Contains(city)
                //        )
                //        &&
                //        (job.JobPostDate >= DateTime.Today.AddMonths(lastMonthsNumber * -1))
                //        )).Skip((page - 1) * _PageSize).Take(_PageSize).ToList();
            }
            if (returnList == null || returnList.Count == 0)
            {
                return(new List <JobPost>());
            }
            else
            {
                return(returnList);
            }
        }
Ejemplo n.º 7
0
 public UserJobModel(UserJob obj, bool isLoadJob = true)
 {
     ShareFunctions.CopyPropertiesTo <UserJob, UserJobModel>(obj, this);
     if (isLoadJob)
     {
         Post = new JobPostModel(this.JobId);
     }
 }
Ejemplo n.º 8
0
 public CompanyModel(Guid companyId)
 {
     if (DataContext.Companies.Any(x => x.Id.Equals(companyId)))
     {
         var obj = DataContext.Companies.Where(x => x.Id.Equals(companyId)).FirstOrDefault();
         ShareFunctions.CopyPropertiesTo <Company, CompanyModel>(obj, this);
     }
 }
Ejemplo n.º 9
0
        public JobPostModel(Guid guid)
        {
            JobPost jd  = new JobPost();
            JobPost obj = DataContext.JobPosts.Where(x => x.Id.Equals(guid)).FirstOrDefault();

            if (obj != null)
            {
                ShareFunctions.CopyPropertiesTo <JobPost, JobPostModel>(obj, this);
                this.Description = DataContext.JobDetails.Where(x => x.JobId.Equals(guid)).Select(x => x.JobDetailContent).FirstOrDefault();
            }
        }
Ejemplo n.º 10
0
        private void LoadModel(JobPostModel source, JobPost dest)
        {
            ShareFunctions.CopyPropertiesTo <JobPostModel, JobPost>(source, dest);

            //dest.AspNetUser = DataContext.AspNetUsers.SingleOrDefault(x => x.Id.Equals(source.UserId));
        }
Ejemplo n.º 11
0
 public Skill(CandidateSkill obj)
 {
     ShareFunctions.CopyPropertiesTo <CandidateSkill, Skill>(obj, this);
 }
Ejemplo n.º 12
0
 public UserDetailModel(UserDetail obj)
 {
     ShareFunctions.CopyPropertiesTo <UserDetail, UserDetailModel>(obj, this);
 }
Ejemplo n.º 13
0
 public Education(CandidateEducation obj)
 {
     ShareFunctions.CopyPropertiesTo <CandidateEducation, Education>(obj, this);
 }
Ejemplo n.º 14
0
 private void LoadModel(UserJob source, UserJob dest)
 {
     ShareFunctions.CopyPropertiesTo <UserJob, UserJob>(source, dest);
     //dest.AspNetUser = DataContext.AspNetUsers.SingleOrDefault(x => x.Id.Equals(source.UserId));
 }
Ejemplo n.º 15
0
 private void LoadModel(UserDetail source, UserDetail dest)
 {
     ShareFunctions.CopyPropertiesTo <UserDetail, UserDetail>(source, dest);
     dest.AspNetUser = DataContext.AspNetUsers.SingleOrDefault(x => x.Id.Equals(source.UserID));
 }
Ejemplo n.º 16
0
 private void LoadModel(CandidateLanguage source, CandidateLanguage dest)
 {
     ShareFunctions.CopyPropertiesTo <CandidateLanguage, CandidateLanguage>(source, dest);
     dest.AspNetUser = DataContext.AspNetUsers.SingleOrDefault(x => x.Id.Equals(source.UserID));
 }
Ejemplo n.º 17
0
 public WorkExperience(CandidateWorkExperience obj)
 {
     ShareFunctions.CopyPropertiesTo <CandidateWorkExperience, WorkExperience>(obj, this);
 }
Ejemplo n.º 18
0
 public Reference(CandidateReference obj)
 {
     ShareFunctions.CopyPropertiesTo <CandidateReference, Reference>(obj, this);
 }
Ejemplo n.º 19
0
 public CompanyModel(Company obj)
 {
     ShareFunctions.CopyPropertiesTo <Company, CompanyModel>(obj, this);
 }
Ejemplo n.º 20
0
 public Language(CandidateLanguage obj)
 {
     ShareFunctions.CopyPropertiesTo <CandidateLanguage, Language>(obj, this);
 }
Ejemplo n.º 21
0
 public Training(CandidateTraining obj)
 {
     ShareFunctions.CopyPropertiesTo <CandidateTraining, Training>(obj, this);
 }