示例#1
0
        public ActionResult FinalStatus()
        {
            userId = Convert.ToInt32(System.Web.HttpContext.Current.User.Identity.Name.Split('|')[1]);
            var userDetails  = _IUserService.GetById(userId);
            var relationList = _IRelationService.GetAll(null, null, "");
            CandidateProgressDetails candidateProgressDetails = new CandidateProgressDetails(_IUserService, _IRelationService, _ICandidateProgressDetailService, _IEmploymentCountService);
            var candidateGraphProgressDetailViewModel         = candidateProgressDetails.SaveCandidateProgressDetails(userId);
            FinalSubmitViewModel finalSubmitViewModel         = new FinalSubmitViewModel();

            if (userDetails != null)
            {
                finalSubmitViewModel.FinalStatus = userDetails.IsSubmitted == null ? false : userDetails.IsSubmitted.Value;
                var personalDetail              = userDetails.EmployeePersonalDetails.FirstOrDefault(x => x.IsActive == true);
                var contactDetail               = userDetails.EmployeeContactDetails.FirstOrDefault();
                var userEmployemntList          = userDetails.EmploymentDetails.Where(x => x.IsActive == true);
                var assignedEducationCategaries = userDetails.AdminEducationCategoryForUsers.Where(x => x.IsActive == true).ToList();
                var userEducationList           = userDetails.EmployeeEducationDetails.Where(x => x.IsActive == true);
                var documentDetails             = userDetails.DocumentDetails.Where(x => x.IsActive == true);
                var familydetails               = userDetails.EmployeeFamilyDetails.Where(x => x.IsActive == true).ToList();
                relationList = relationList.Where(r => r.RelationID != Constants.Spouse && r.RelationID != Constants.Child).ToList();

                if (personalDetail == null)
                {
                    finalSubmitViewModel.PersonalDetailsError = "Personal Details";
                }

                if (contactDetail == null)
                {
                    finalSubmitViewModel.ContactDetailsError = "Contact Details";
                }

                //if (!userEmployemntList.Any(x => x.IsCurrentEmployment == true))
                //{
                //        finalSubmitViewModel.EmploymentDetailsError = "Employment Details";
                //}

                if (candidateGraphProgressDetailViewModel.EmploymentDetailsPercentage != null && candidateGraphProgressDetailViewModel.EmploymentDetailsPercentage < 100)
                {
                    finalSubmitViewModel.EmploymentDetailsError = "Employment Details";
                }

                if (userEducationList.Any() && assignedEducationCategaries.Any())
                {
                    assignedEducationCategaries.Remove(assignedEducationCategaries.FirstOrDefault(x => x.EducationCategoryId == 8));

                    if (userEducationList.Where(x => x.EducationCategoryID != 8).Count() != assignedEducationCategaries.Count)
                    {
                        finalSubmitViewModel.EducationDetailsError = "Education Details";
                    }
                }
                else
                {
                    finalSubmitViewModel.EducationDetailsError = "Education Details";
                }

                if (familydetails.Any())
                {
                    //if (personalDetail != null && personalDetail.MaritalStatID == Constants.Single)
                    //{
                    //    relationList = relationList.Where(r => r.RelationID != Constants.Spouse && r.RelationID != Constants.Child && r.RelationID != Constants.Sibling && r.RelationID != Constants.Relative).ToList();

                    //    if (familydetails.Where(a => a.RelationshipID == Constants.Father || a.RelationshipID ==  Constants.Mother).ToList().Count != relationList.Count())
                    //    {
                    //        finalSubmitViewModel.FamilyDetailsError = "Family Details";
                    //    }
                    //}
                    //else if (personalDetail != null && personalDetail.MaritalStatID == Constants.Married)
                    //{

                    //    relationList = relationList.Where(r => r.RelationID != Constants.Child && r.RelationID != Constants.Sibling && r.RelationID != Constants.Relative).ToList();

                    //    if (familydetails.Count <= relationList.Count())
                    //    {
                    //        finalSubmitViewModel.FamilyDetailsError = "Family Details";
                    //    }
                    //}
                    if (candidateGraphProgressDetailViewModel.FamilyDetailsPercentage < 100)
                    {
                        finalSubmitViewModel.FamilyDetailsError = "Family Details";
                    }
                }
                else
                {
                    finalSubmitViewModel.FamilyDetailsError = "Family Details";
                }
                if (documentDetails.Any() && documentDetails.Count() != 0)
                {
                    //var docValidation = true;

                    //if (documentDetails.FirstOrDefault(x => x.DocumentID == Constant.IDProof.PANCard) == null)
                    //{
                    //    docValidation = false;

                    //}


                    //foreach (var item in userDetails.AdminEducationCategoryForUsers)
                    //{
                    //    var education= item.Master_EducationCategory.EducationDocumentCategoryMappings.FirstOrDefault();
                    //    if (education != null)
                    //    {
                    //        var docid = education.DocumentID;
                    //        if (!documentDetails.Any(x => x.DocumentID == docid))
                    //        {
                    //            docValidation = false;
                    //        }
                    //    }
                    //}


                    //foreach (var item in userEmployemntList)
                    //{
                    //    if (item.IsCurrentEmployment.HasValue && item.IsCurrentEmployment.Value)
                    //    {
                    //        if (!documentDetails.Any(x => x.EmploymentDetID == item.EmploymentDetID && x.DocumentID == Constant.EmploymentProof.Latest3PaySlips))
                    //        {
                    //            docValidation = false;
                    //        }
                    //    }
                    //    else
                    //    {
                    //        if (!documentDetails.Any(x => x.EmploymentDetID == item.EmploymentDetID && (x.DocumentID == Constant.EmploymentProof.Latest3PaySlips)))
                    //        {
                    //            docValidation = false;
                    //        }

                    //        if (!documentDetails.Any(x => x.EmploymentDetID == item.EmploymentDetID && (x.DocumentID == Constant.EmploymentProof.ExperienceLetter)))
                    //        {
                    //            docValidation = false;
                    //        }


                    //    }
                    //}

                    //if (!docValidation)
                    //{
                    //    finalSubmitViewModel.UploadDetailsError = "Upload Documents";
                    //}
                    if (candidateGraphProgressDetailViewModel.UploadDcoumentsPercentage < 100)
                    {
                        finalSubmitViewModel.UploadDetailsError = "Upload Documents";
                    }
                }
                else
                {
                    finalSubmitViewModel.UploadDetailsError = "Upload Documents";
                }
            }
            return(View(finalSubmitViewModel));
        }
示例#2
0
        public ActionResult GetCandidateProgressBar()
        {
            userId = Convert.ToInt32(System.Web.HttpContext.Current.User.Identity.Name.Split('|')[1]);
            CandidateProgressDetails candidateProgressDetails = new CandidateProgressDetails(_IUserService, _IRelationService, _ICandidateProgressDetailService, _IEmploymentCountService);

            CandidateGraphProgressDetailViewModel candidateGraphProgressDetailViewModel = candidateProgressDetails.SaveCandidateProgressDetails(userId);

            return(View(candidateGraphProgressDetailViewModel));
        }