Exemplo n.º 1
0
        public JsonResult AcceptRejectCandidtae(string JID, bool isAccept)

        {
            dbContext = new IFSTestDBcontext();
            bool      result       = false;
            Candidate objCandidate = new Candidate();

            try
            {
                objCandidate = GetCandidateById(JID);
                if (objCandidate != null)
                {
                    objCandidate.isAccepted  = isAccept;
                    objCandidate.isRecruited = false;
                    dbContext.CandidateMaster.Add(objCandidate);
                    dbContext.Technology.AddRange(objCandidate.Technology);
                    dbContext.SaveChanges();
                    result = true;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Json(new { result }, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
        //not implements.....
        public List <Candidate> GetSeachList(int min = 0, int max = 5)
        {
            dbContext = new IFSTestDBcontext();
            List <Candidate> objCandidate = new List <Candidate>();


            List <Candidate> objRegistredCandidates = new List <Candidate>();

            //Get Data From Local DB
            objRegistredCandidates = dbContext.CandidateMaster.ToList();

            //Get Data From Services
            List <Candidate> objCandidateList = Common.GetCandidateListFromWebServices();

            //Check for Data already Selected or not
            var excludCandidates = objCandidateList.Where(x => objRegistredCandidates.Select(y => y.JID).Contains(x.JID)).ToArray();
            var pageResponse     = objCandidateList.Except(excludCandidates).ToArray();

            pageResponse = pageResponse.Except(excludCandidates).Where(p => p.Technology.All(d => d.experianceYears > min && d.experianceYears > max)).ToArray();

            objCandidate.AddRange(pageResponse);


            return(objCandidate);
        }
Exemplo n.º 3
0
        public List <Candidate> GetCandidates(string search, string sort, string sortdir, int skip, int pageSize, out int totalRecord)
        {
            dbContext = new IFSTestDBcontext();
            List <Candidate> objCandidate = new List <Candidate>();


            List <Candidate> objRegistredCandidates = new List <Candidate>();

            //Get Data From Local DB
            objRegistredCandidates = dbContext.CandidateMaster.ToList();

            //Get Data From Services
            List <Candidate> objCandidateList = Common.GetCandidateListFromWebServices();

            //Check for Data already Selected or not
            var excludCandidates = objCandidateList.Where(x => objRegistredCandidates.Select(y => y.JID).Contains(x.JID)).ToArray();
            var pageResponse     = objCandidateList.Except(excludCandidates).ToArray();

            pageResponse = pageResponse.Except(excludCandidates).ToArray();

            objCandidate.AddRange(pageResponse);

            totalRecord = objCandidate.Count();
            if (pageSize > 0)
            {
                objCandidate = objCandidate.Skip(skip).Take(pageSize).ToList();
            }
            return(objCandidate);
        }
Exemplo n.º 4
0
        public List <Candidate> GetRecuritedCandidates(string search, string sort, string sortdir, int skip, int pageSize, out int totalRecord)
        {
            dbContext = new IFSTestDBcontext();
            List <Candidate> objRecruitedCandidates = new List <Candidate>();

            objRecruitedCandidates = dbContext.CandidateMaster.ToList().Where(m => m.isRecruited.Equals(true)).ToList();

            try
            {
                totalRecord = objRecruitedCandidates.Count();
                if (pageSize > 0)
                {
                    objRecruitedCandidates = objRecruitedCandidates.Skip(skip).Take(pageSize).ToList();
                }
                return(objRecruitedCandidates);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 5
0
        public JsonResult RecruitCandidtae(string JID, bool isRecruit)

        {
            dbContext = new IFSTestDBcontext();
            bool      result       = false;
            Candidate objCandidate = dbContext.CandidateMaster.ToList().Where(m => m.JID.Equals(JID)).FirstOrDefault();

            try
            {
                if (objCandidate != null)
                {
                    objCandidate.isRecruited = isRecruit;
                    dbContext.SaveChanges();
                    result = true;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Json(new { result }, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 6
0
 public AccountController()
 {
     dbContext = new IFSTestDBcontext();
 }