public List <SearchResumeListViewModel> GetAdvanceSearchResumeList(AdvanceResumeSearch searches, int userId)
        {
            List <SearchResumeListViewModel> lstSearchedResume = new List <SearchResumeListViewModel>();
            DataTable searchedResume = _serarchresumeProcess.GetAdvanceSearchResumeList(searches, userId);

            if (searchedResume.Rows.Count > 0)
            {
                for (int i = 0; i < searchedResume.Rows.Count; i++)
                {
                    string resumePath = Convert.ToString(searchedResume.Rows[i]["Resume"]);
                    if (!string.IsNullOrWhiteSpace(resumePath))
                    {
                        if (!File.Exists($"{_hostingEnviroment.WebRootPath}{resumePath}"))
                        {
                            resumePath = string.Empty;
                        }
                    }

                    var skillsObject = new SearchResumeListViewModel
                    {
                        Skills              = JsonConvert.DeserializeObject <Skills>(Convert.ToString(searchedResume.Rows[i]["Skills"])),
                        FirstName           = (searchedResume.Rows[i]["FirstName"] as string) ?? "",
                        LastName            = (searchedResume.Rows[i]["LastName"] as string) ?? "",
                        Email               = (searchedResume.Rows[i]["Email"] as string) ?? "",
                        Resume              = resumePath,
                        UserId              = (searchedResume.Rows[i]["UserId"] as int?) ?? 0,
                        CityName            = (searchedResume.Rows[i]["CityName"] as string) ?? "",
                        JobIndustryAreaName = (searchedResume.Rows[i]["JobIndustryAreaName"] as string) ?? "",
                        JobTitle            = (searchedResume.Rows[i]["JobTitleName"] as string) ?? "",
                        //Address = (searchedResume.Rows[i]["Address"] as string) ?? "",
                        AboutMe           = (searchedResume.Rows[i]["AboutMe"] as string) ?? "",
                        ProfilePic        = Convert.ToString(searchedResume.Rows[i]["ProfilePic"]),
                        CurrentSalary     = Convert.ToString(searchedResume.Rows[i]["CurrentSalary"]),
                        ExpectedSalary    = Convert.ToString(searchedResume.Rows[i]["ExpectedSalary"]),
                        LinkedinProfile   = Convert.ToString(searchedResume.Rows[i]["LinkedinProfile"]),
                        ExperienceDetails = JsonConvert.DeserializeObject <ExperienceDetails[]>(searchedResume.Rows[i]["ExperienceDetails"].ToString())
                    };
                    lstSearchedResume.Add(skillsObject);
                    string picpath = Path.GetFullPath(_hostingEnviroment.WebRootPath + lstSearchedResume[i].ProfilePic);
                    if (!System.IO.File.Exists(picpath))
                    {
                        string fName = $@"\ProfilePic\" + "Avatar.jpg";
                        lstSearchedResume[i].ProfilePic = fName;
                    }
                }
                return(lstSearchedResume);
            }
            throw new UserNotFoundException("Data Not found");
        }
        public IActionResult AdvanceResumeSearchData(AdvanceResumeSearch model)
        {
            List <SearchResumeListViewModel> lstResumeList = new List <SearchResumeListViewModel>();
            var user = HttpContext.Session.Get <UserViewModel>(Constants.SessionKeyUserInfo);

            user = user ?? new UserViewModel();
            try
            {
                lstResumeList = searchresumehandler.GetAdvanceSearchResumeList(model, user.UserId);
            }
            catch (UserNotFoundException ex)
            {
                Logger.Logger.WriteLog(Logger.Logtype.Error, ex.Message, user.UserId, typeof(SearchResumeController), ex);
                ModelState.AddModelError("ErrorMessage", string.Format("{0}", ex.Message));
            }
            return(View(lstResumeList));
        }
        public List <AdvanceResumeSearch> AdvanceSearchStates(int UserId)
        {
            DataTable dt          = _serarchresumeProcess.AdvanceSearchStates(UserId);
            var       SearchStats = new List <AdvanceResumeSearch>();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                var search = new AdvanceResumeSearch()
                {
                    id = Convert.ToInt32(dt.Rows[i]["Id"]),
                    HiringRequirement = Convert.ToString(dt.Rows[i]["HiringRequirement"]),
                    AllKeyword        = Convert.ToString(dt.Rows[i]["AllKeyword"]),
                    skills            = Convert.ToString(dt.Rows[i]["Skills"]),
                    isSavedSearch     = Convert.ToBoolean(dt.Rows[i]["IsSavedSearch"])
                };
                SearchStats.Add(search);
            }
            return(SearchStats);

            throw new UserNotFoundException("data not found");
        }
        public List <AdvanceResumeSearch> AdvanceSearchById(int Id, int UserId)
        {
            DataTable dt          = _serarchresumeProcess.AdvanceSearchById(Id, UserId);
            var       SearchStats = new List <AdvanceResumeSearch>();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                var search = new AdvanceResumeSearch()
                {
                    HiringRequirement  = Convert.ToString(dt.Rows[i]["HiringRequirement"]),
                    AnyKeyword         = Convert.ToString(dt.Rows[i]["AnyKeyword"]),
                    AllKeyword         = Convert.ToString(dt.Rows[i]["AllKeyword"]),
                    ExculudeKeyword    = Convert.ToString(dt.Rows[i]["ExculudeKeyword"]),
                    MinExperiance      = Convert.ToInt32(dt.Rows[i]["MinExperience"]),
                    MaxExperiance      = Convert.ToInt32(dt.Rows[i]["MaxExperience"]),
                    MinSalary          = Convert.ToString(dt.Rows[i]["MinSalary"]),
                    MaxSalary          = Convert.ToString(dt.Rows[i]["MaxSalary"]),
                    CurrentLocation    = Convert.ToString(dt.Rows[i]["CurrentLocation"]),
                    PreferredLocation1 = Convert.ToString(dt.Rows[i]["PreferredLocation1"]),
                    PreferredLocation2 = Convert.ToString(dt.Rows[i]["PreferredLocation2"]),
                    PreferredLocation3 = Convert.ToString(dt.Rows[i]["PreferredLocation3"]),
                    FuncationlArea     = Convert.ToInt32(dt.Rows[i]["FuncationlArea"]),
                    JobIndustryAreaId  = Convert.ToInt32(dt.Rows[i]["JobIndustryAreaId"]),
                    CurrentDesignation = Convert.ToString(dt.Rows[i]["CurrentDesignation"]),
                    NoticePeriod       = Convert.ToString(dt.Rows[i]["NoticePeriod"]),
                    skills             = Convert.ToString(dt.Rows[i]["Skills"]),
                    AgeFrom            = Convert.ToInt32(dt.Rows[i]["AgeFrom"]),
                    AgeTo                = Convert.ToInt32(dt.Rows[i]["AgeTo"]),
                    Gender               = Convert.ToString(dt.Rows[i]["Gender"]),
                    CandidatesType       = Convert.ToString(dt.Rows[i]["CandidatesType"]),
                    ShowCandidateSeeking = Convert.ToInt32(dt.Rows[i]["ShowCandidateSeeking"]),
                    isSavedSearch        = Convert.ToBoolean(dt.Rows[i]["IsSavedSearch"]),
                };
                SearchStats.Add(search);
            }
            return(SearchStats);

            throw new UserNotFoundException("data not found");
        }
Exemplo n.º 5
0
        public DataTable GetAdvanceSearchResumeList(AdvanceResumeSearch searches, int userId)
        {
            var dt = new DataTable();

            using (var connection = new SqlConnection(connectionString))
            {
                try
                {
                    SqlParameter[] parameters = new SqlParameter[] {
                        new SqlParameter("@HiringRequirement", searches.HiringRequirement),
                        new SqlParameter("@AnyKeyword", searches.AnyKeyword),
                        new SqlParameter("@AllKeyword", searches.AllKeyword),
                        new SqlParameter("@ExculudeKeyword", searches.ExculudeKeyword),
                        new SqlParameter("@MinExp", searches.MinExperiance),
                        new SqlParameter("@MaxExp", searches.MaxExperiance),
                        new SqlParameter("@MinSalary", searches.MinSalary),
                        new SqlParameter("@MaxSalary", searches.MaxSalary),
                        new SqlParameter("@CurrentLocation", searches.CurrentLocation),
                        new SqlParameter("@PreferredLocation1", searches.PreferredLocation1),
                        new SqlParameter("@PreferredLocation2", searches.PreferredLocation2),
                        new SqlParameter("@PreferredLocation3", searches.PreferredLocation3),
                        new SqlParameter("@FuncationlArea", searches.FuncationlArea),
                        new SqlParameter("@JobIndustryAreaId", searches.JobIndustryAreaId),
                        new SqlParameter("@CurrentDesignation", searches.CurrentDesignation),
                        new SqlParameter("@NoticePeriod", searches.NoticePeriod),
                        new SqlParameter("@Skills", searches.skills),
                        new SqlParameter("@AgeFrom", searches.AgeFrom),
                        new SqlParameter("@AgeTO", searches.AgeTo),
                        new SqlParameter("@Gender", searches.Gender),
                        new SqlParameter("@CandidatesType", searches.CandidatesType),
                        //new SqlParameter("@ShowCandidateWith",searches.ShowCandidateWith),
                        new SqlParameter("@ShowCandidateSeeking", searches.ShowCandidateSeeking),
                        new SqlParameter("@UserId", userId),
                        new SqlParameter("@IsSavedSearch", searches.isSavedSearch)
                    };
                    var searchList =
                        SqlHelper.ExecuteReader
                        (
                            connection,
                            CommandType.StoredProcedure,
                            "usp_AdvanceSearchResume",
                            parameters
                        );
                    if (null != searchList && searchList.HasRows)
                    {
                        dt.Load(searchList);
                    }
                }
                catch (Exception ex)
                {
                    var data = ex;
                }
                finally
                {
                    SqlHelper.CloseConnection(connection);
                }
            }
            return(dt);

            throw new DataNotFound("Data not found");
        }