Exemplo n.º 1
0
        public JsonResult GetGroupName(int id)
        {
            GroupMasterDto     groupMasterDto     = _groupService.GetByID(id);
            PanchayatLookupDto panchayatlookupDto = _panchayatService.GetByGroupID(id);

            return(Json(new { VillageName = panchayatlookupDto.Village, ClusterName = panchayatlookupDto.Cluster, GroupName = groupMasterDto.GroupName, VillageCode = panchayatlookupDto.VillageCode, ClusterCode = panchayatlookupDto.ClusterCode }));
        }
Exemplo n.º 2
0
        public ActionResult CreateMember(string id)
        {
            int memberId = string.IsNullOrEmpty(id.DecryptString()) ? default(int) : Convert.ToInt32(id.DecryptString());

            OrganizationService _organizationService = new OrganizationService();
            OrganizationDto     org = _organizationService.GetAll();

            ViewBag.MemberRetirementAge = org != null ? org.MemberRetirementAge : 60;

            ViewBag.EducationQualification = GetDropDownListByMasterCode(Enums.RefMasterCodes.EDUCATION_QUALIFICATION);

            SelectList nomineeRelationship = GetDropDownListByMasterCode(Enums.RefMasterCodes.NOMINEE_RELATIONSHIP);

            ViewBag.nomineeRelationship = nomineeRelationship;

            SelectList parentGuardionRelationship = GetDropDownListByMasterCode(Enums.RefMasterCodes.PARENT_GUARDIAN_RELATIONSHIP);

            ViewBag.parentGuardionRelationship = parentGuardionRelationship;

            SelectList socialCategory = GetDropDownListByMasterCode(Enums.RefMasterCodes.SOCIAL_CATEGORY);

            ViewBag.socialCategory = socialCategory;

            SelectList monthlyIncome = GetDropDownListByMasterCode(Enums.RefMasterCodes.MONTHLY_INCOME);

            ViewBag.monthlyIncome = monthlyIncome;

            SelectList incomefrequency = GetDropDownListByMasterCode(Enums.RefMasterCodes.INCOME_FREQUENCY);

            ViewBag.incomefrequency = incomefrequency;

            SelectList religion = GetDropDownListByMasterCode(Enums.RefMasterCodes.RELIGION);

            ViewBag.religion = religion;

            List <SelectListDto> lstoccupationDto = _occupationService.GetOccupationSelectList();
            SelectList           lstoccupation    = new SelectList(lstoccupationDto, "ID", "Text");

            ViewBag.OccupationName = lstoccupation;

            List <GroupLookupDto> lstGroupDto = _groupService.Lookup();
            SelectList            lstgroup    = new SelectList(lstGroupDto, "GroupID", "GroupCode");

            ViewBag.GroupNames = lstgroup;

            List <SelectListDto> lstaccountheaddto = _accountheadservice.GetAccountHeadSelectList();
            SelectList           lstaccounthead    = new SelectList(lstaccountheaddto, "ID", "Text");

            ViewBag.accounthead = lstaccounthead;

            SelectList FederationDesigination = GetDropDownListByMasterCode(Enums.RefMasterCodes.FED_DESG);

            ViewBag.FED_DESG = FederationDesigination;

            SelectList GroupDesigination = GetDropDownListByMasterCode(Enums.RefMasterCodes.GROUP_DESG);

            ViewBag.GROUP_DESG = GroupDesigination;

            SelectList ClusterDesigination = GetDropDownListByMasterCode(Enums.RefMasterCodes.CLUSTER_DESG);

            ViewBag.CLUSTER_DESG = ClusterDesigination;

            MemberDto memberdto = new MemberDto();

            if (memberId > 0)
            {
                memberdto = _memberservice.GetById(memberId);
                if (memberdto.DOB != DateTime.MinValue)
                {
                    memberdto.DateOfRetirement = memberdto.DOB.AddYears(org.MemberRetirementAge);
                }
            }
            MemberModel         memberModel  = Mapper.Map <MemberDto, MemberModel>(memberdto);
            List <MemberKYCDto> memberkycdto = new List <MemberKYCDto>();

            if (memberId > 0)
            {
                memberkycdto = _memberKycService.GetByMemberID(memberId);
                if (memberkycdto != null && memberkycdto.Count > 0)
                {
                    List <ReferenceValueDto> kycTypeRefereces = _referenceValueService.GetByRefMasterCode(Enums.RefMasterCodes.KYCTYPE.ToString());

                    //Fill Member Model With Kyc Aadhar details
                    var          aarharType = (kycTypeRefereces.Find(k => k.RefCode.ToUpper() == Utilities.Enums.KycType.AADHAR.ToString()));
                    MemberKYCDto AadharKYC  = memberkycdto.Find(a => a.KYCType == aarharType.RefID);
                    if (AadharKYC != null)
                    {
                        memberModel.AadharNo        = AadharKYC.KYCNumber;
                        memberModel.AadharImagePath = AadharKYC.FileName;
                    }

                    //Fill Member Model With Kyc PAN details
                    var          panType = (kycTypeRefereces.Find(k => k.RefCode.ToUpper() == Utilities.Enums.KycType.PAN.ToString()));
                    MemberKYCDto panKYC  = memberkycdto.Find(a => a.KYCType == panType.RefID);
                    if (panKYC != null)
                    {
                        memberModel.PANNo        = panKYC.KYCNumber;
                        memberModel.PANImagePath = panKYC.FileName;
                    }

                    //Fill Member Model With Kyc Voter details
                    var          voterType = (kycTypeRefereces.Find(k => k.RefCode.ToUpper() == Utilities.Enums.KycType.VOTERID.ToString()));
                    MemberKYCDto voterKYC  = memberkycdto.Find(a => a.KYCType == voterType.RefID);
                    if (voterKYC != null)
                    {
                        memberModel.VoterNo        = voterKYC.KYCNumber;
                        memberModel.VoterImagePath = voterKYC.FileName;
                    }

                    //Fill Member Model With Kyc Ration details
                    var          rationType = (kycTypeRefereces.Find(k => k.RefCode.ToUpper() == Utilities.Enums.KycType.RATIONCARD.ToString()));
                    MemberKYCDto rationKYC  = memberkycdto.Find(a => a.KYCType == rationType.RefID);
                    if (rationKYC != null)
                    {
                        memberModel.RationNo        = rationKYC.KYCNumber;
                        memberModel.RationImagePath = rationKYC.FileName;
                    }



                    //Fill Member Model With Kyc Ration details
                    var          jobcardType = (kycTypeRefereces.Find(k => k.RefCode.ToUpper() == Utilities.Enums.KycType.JOBCARD.ToString()));
                    MemberKYCDto jobcardKYC  = memberkycdto.Find(a => a.KYCType == jobcardType.RefID);
                    if (jobcardKYC != null)
                    {
                        memberModel.JobcardNo        = jobcardKYC.KYCNumber;
                        memberModel.JobcardImagePath = jobcardKYC.FileName;
                    }
                }
            }

            if (memberId > 0)
            {
                ViewBag.MemberID = memberId;
            }

            int groupid = GroupInfo.GroupID;
            PanchayatLookupDto panchayatlookupDto = _panchayatService.GetByGroupID(groupid);

            memberModel.GroupID   = GroupInfo.GroupID;
            memberModel.GroupName = GroupInfo.GroupName;
            memberModel.GroupCode = GroupInfo.GroupCode;
            memberModel.cluster   = GroupInfo.Cluster;
            memberModel.village   = GroupInfo.Village;
            memberModel.panchayat = panchayatlookupDto.Panchayat;


            //int GroupId = GroupInfo.GroupID;
            var lstmemberleadership = _memberservice.LeaderShipLookUp(memberId);

            ViewBag.LeadershipDetails = lstmemberleadership;
            //return View(lstmemberleadership);



            return(View(memberModel));
        }