public static JobSeekerSearchModel MapToJobSeekerSearchModel(JobseekerSearchViewModel source)
        {
            var target = new JobSeekerSearchModel();

            Map(source, target);
            return(target);
        }
        public static JobSeekerModelList MapToJobSeekerModelList(JobSeekerSearchModel source)
        {
            var target = new JobSeekerModelList();

            Map(source, target);
            return(target);
        }
        public static void Map(JobSeekerSearchModel source, JobSeekerModelList target)
        {
            target.Salutation   = source.Salutation;
            target.Type         = source.Type;
            target.FirstName    = source.FirstName;
            target.LastName     = source.LastName;
            target.MiddleName   = source.MiddleName;
            target.PreferedName = source.PreferedName;
            target.Gender       = source.Gender;

            target.DOB = ParseToDateTime(source.DOB);
            target.Id  = ParseToLong(source.Id);
        }
        public static void Map(JobseekerSearchViewModel source, JobSeekerSearchModel target)
        {
            target.Type         = source.Type;
            target.Salutation   = source.Salutation;
            target.FirstName    = source.FirstName;
            target.MiddleName   = source.MiddleName;
            target.LastName     = source.LastName;
            target.Gender       = source.Gender;
            target.PreferedName = source.PreferedName;
            target.Email        = source.Email;
            target.Status       = source.Status;

            target.DOB = source.DOB.HasValue ? source.DOB.Value.ToString() : string.Empty;
            target.Id  = source.Id.HasValue ? source.Id.Value.ToString() : string.Empty;
        }
Beispiel #5
0
        public static string Resolve(JobSeekerSearchModel model)
        {
            if (string.IsNullOrWhiteSpace(model.FirstName))
            {
                return(string.Empty);
            }

            if (string.IsNullOrWhiteSpace(model.MiddleName))
            {
                return(model.Id + " " + model.FirstName + " " + model.LastName);
            }
            if (string.IsNullOrEmpty(model.Gender))
            {
                return(string.Format("{0} {1} {2} {3} {4}", model.Id, model.Salutation, model.FirstName, model.MiddleName, model.LastName));
            }

            return(string.Format("{0} {1} {2} {3} {4} {5}", model.Id, model.Salutation, model.FirstName, model.MiddleName, model.LastName, model.Gender == "M" ? "(Male)" : model.Gender == "F" ? "(Female)" : model.Gender));
        }
Beispiel #6
0
        public IList <JobSeekerSearchModel> SearchJobSeeker(JobSeekerSearchModel model)
        {
            bool   hitMax    = true;
            string errorMsg  = string.Empty;
            int    errorCode = 0;

            IQJsEntity jskModel = model.ToIQJsEntity();

            IList <IQJsEntity> result = IQOfficeProcess.MatchRecordJs(IQGlobalSetting.JS_MATCH_SPEC, jskModel, out hitMax, out errorCode, out errorMsg);

            IList <JobSeekerSearchModel> results = new List <JobSeekerSearchModel>();

            foreach (var record in result)
            {
                results.Add(record.ToJobSeekerSearchModel());
            }

            return(results);
        }
Beispiel #7
0
 public static IQJsEntity ToIQJsEntity(this JobSeekerSearchModel model)
 {
     if (model != null)
     {
         return(new IQJsEntity
         {
             DOB = model.DOB,
             Email = model.Email,
             FirstName = model.FirstName,
             Gender = model.Gender,
             Id = model.Id,
             LastName = model.LastName,
             MiddleName = model.MiddleName,
             PreferredName = model.PreferedName,
             Status = model.Status,
             Type = model.Type,
         });
     }
     return(null);
 }
Beispiel #8
0
        public static JobSeekerSearchModel ToJobSeekerSearchModel(this IQJsEntity record)
        {
            if (record == null)
            {
                return(null);
            }

            JobSeekerSearchModel jskSearchModel = new JobSeekerSearchModel
            {
                FirstName  = record.FirstName,
                LastName   = record.LastName,
                MiddleName = record.MiddleName,
                Salutation = record.Salutation,
                Type       = record.Type,
                Id         = record.Id,
                Gender     = record.Gender,
                DOB        = record.DOB
            };

            return(jskSearchModel);
        }
Beispiel #9
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static AjaxJobseekerSearchViewModel ToAjaxJobseekerSearchModel(this JobSeekerSearchModel model)
        {
            if (model != null)
            {
                AjaxJobseekerSearchViewModel ajaxModel = new AjaxJobseekerSearchViewModel
                {
                    DOB        = model.DOB,
                    FirstName  = model.FirstName,
                    Gender     = model.Gender,
                    Id         = model.Id,
                    LastName   = model.LastName,
                    MiddleName = model.MiddleName,
                    Salutation = model.Salutation,
                    SingleLineJobseekerSearch = JobseekerSearchModelToSingleLineValueResolver.Resolve(model), // model.Id + " " + model.Salutation + " " + model.FirstName + " "+ " " + model.MiddleName + model.LastName,
                    Type = model.Type
                };

                return(ajaxModel);
            }

            return(null);
        }
 public ActionResult Recherche(JobSeekerSearchModel searchmodel)
 {
     var JobSeeker = new JobSeekerSearchLogic();
     var model = JobSeeker.GetJobSeeker(searchmodel);
     return View("Recherche",model.ToList());
 }
Beispiel #11
0
        // TODo: add Job seeker search functions.

        // Usage

        /// <summary>
        /// Searches for JobSeeker records.
        /// </summary>
        /// <param name="text">Text entered in Search box.</param>
        /// <returns>Collection of Jobseeker search models.</returns>
        public IList <JobSeekerSearchModel> SearchJobSeeker(string text = null) //IList<JobSeekerSearchModel>
        {
            // TODO: Derive model from the 'search' text.


            bool       hitMax;
            int        errorCode;
            string     errorMsg;
            IQJsEntity jsEntity = new IQJsEntity();

            if (!string.IsNullOrEmpty(text))
            {
                long id = 0;
                if (Int64.TryParse(text, out id))
                {
                    jsEntity.Id = text;
                }
                else
                {
                    var separatedValues = text.Split(new char[] { ' ' });
                    if (separatedValues.Length > 0)
                    {
                        jsEntity.FirstName = separatedValues[0] ?? "John";
                        if (separatedValues.Length > 1)
                        {
                            jsEntity.LastName = separatedValues[1];
                        }
                        if (separatedValues.Length > 2)
                        {
                            jsEntity.Gender = separatedValues[2];
                        }
                    }
                    else
                    {
                        jsEntity.FirstName = text;
                    }
                }
            }
            else
            {
                jsEntity.LastName = "Smith";
                jsEntity.LastName = "Smith";
            }


            IList <IQJsEntity> result = IQOfficeProcess.MatchRecordJs(IQGlobalSetting.JS_MATCH_SPEC,
                                                                      jsEntity, out hitMax, out errorCode, out errorMsg);

            IList <JobSeekerSearchModel> results = new List <JobSeekerSearchModel>();

            foreach (var record in result)
            {
                JobSeekerSearchModel jskSearchModel = new JobSeekerSearchModel
                {
                    FirstName  = record.FirstName,
                    LastName   = record.LastName,
                    MiddleName = record.MiddleName,
                    Salutation = record.Salutation,
                    Type       = record.Type,
                    Id         = record.Id,
                    Gender     = record.Gender,
                    DOB        = record.DOB
                };
                results.Add(jskSearchModel);
            }
            return(results);
        }