Example #1
0
        public JsonResult SaveInterestedToCandidate(InterestedToCandidateViewModel model)
        {
            ResponseOut  responseOut = new ResponseOut();
            IRecruiterBL recruiterBL = new RecruiterEngine();

            try
            {
                int user_id = Convert.ToInt32(HttpContext.Session[SessionKey.CurrentUserID]);
                responseOut = recruiterBL.SaveInterestedCandidate(model, user_id);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Json(responseOut, JsonRequestBehavior.AllowGet));
        }
Example #2
0
        public ResponseOut SaveInterestedCandidate(InterestedToCandidateViewModel model, int user_id)
        {
            ResponseOut responseOut = new ResponseOut();

            using (PortalEntities _context = new PortalEntities())
            {
                try
                {
                    var vendor_id = _context.portal_recruiter_profile.Where(x => x.pk_resource_profile_id == model.candidate_id).Select(x => x.fk_vendor_id).FirstOrDefault();
                    portal_for_interested_Candidate _interested = new portal_for_interested_Candidate();
                    _interested.fk_user_id               = user_id;
                    _interested.requested_date           = DateTime.Now;
                    _interested.requirement_title_select = model.requirement_title_select;
                    _interested.requirement_title        = model.requirement_title;
                    _interested.fk_candidate_id          = model.candidate_id;
                    _interested.is_active = true;
                    if (vendor_id != 0 && vendor_id != null)
                    {
                        _interested.fk_vendor_id = vendor_id;
                    }
                    _context.portal_for_interested_Candidate.Add(_interested);
                    int return_code = _context.SaveChanges();
                    if (return_code > 0)
                    {
                        responseOut.status  = ActionStatus.Success;
                        responseOut.message = ActionMessage.SaveInterested;
                    }
                }
                catch (Exception ex)
                {
                    responseOut.status  = ActionStatus.Fail;
                    responseOut.message = ActionMessage.ApplicationException;
                }

                return(responseOut);
            }
        }