コード例 #1
0
        public JsonResult CreateEdit(KYCBasicDetailsVM model)
        {
            try
            {
                if (Session["ApplicantImage"] != null)
                {
                    model.ApplicantPhoto = (byte[])Session["ApplicantImage"];
                    model.ImageName      = Session["ApplicantImageName"].ToString();
                    model.ContentType    = Session["ApplicantImageContentType"].ToString();
                }

                model.CreatedBy = Convert.ToInt32(Session["UserLoginId"]);
                model.UpdatedBy = Convert.ToInt32(Session["UserLoginId"]);
                model.FYID      = Convert.ToInt32(Session["FinancialYearId"]);
                model.BranchID  = Convert.ToInt32(Session["BranchId"]);
                model.CmpID     = Convert.ToInt32(Session["CompanyId"]);
                bool check = false;
                model.DocumentUploadList = (List <DocumentUploadDetailsVM>)Session["docsub"];
                if (model.CustomerID != null)
                {
                    _kycService.SaveRecord(model);
                    check = true;
                }
                return(Json(check));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
コード例 #2
0
        public ActionResult Index()
        {
            ButtonVisiblity("Index");
            ViewBag.SourceList = new SelectList(_kycService.GetSourceOfApplicationList(), "Soa_Id", "Soa_Name");
            var pincodelist = _kycService.GetPincodeWithArea();

            ViewBag.PinCodeList      = new SelectList(pincodelist, "PcId", "PincodeWithArea");
            ViewBag.DocumentTypeList = new SelectList(_documentUploadService.GetDocumentTypeList(), "Id", "Name");
            ViewBag.DocumentList     = new SelectList(_documentUploadService.GetDocumentMasterList(), "DocumentID", "DocumentName");
            KYCBasicDetailsVM kycVM     = new KYCBasicDetailsVM();
            KYCAddressesVM    addressvm = new KYCAddressesVM();

            kycVM.Trans_KYCAddresses.Add(addressvm);
            kycVM.ApplicationNo = _kycService.GenerateApplicationNo();
            int    appno = Convert.ToInt32(kycVM.ApplicationNo);
            Random rand  = new Random(100);
            int    cid   = rand.Next(000000000, 999999999) + appno;

            kycVM.CustomerID                     = "C" + cid.ToString();
            kycVM.AppliedDate                    = DateTime.Now;
            Session["docsub"]                    = null;
            Session["ApplicantImage"]            = null;
            Session["ApplicantImageName"]        = null;
            Session["ApplicantImageContentType"] = null;
            return(View(kycVM));
        }
コード例 #3
0
        public PreSanctionDetailsVM ToViewModelPreSanction(KYCBasicDetailsVM model)
        {
            PreSanctionDetailsVM preSanctionDetailsVM = new PreSanctionDetailsVM();
            Random rand = new Random(100);
            int    cid  = rand.Next(000000000, 999999999) + 1;

            preSanctionDetailsVM.TransactionId = "T" + cid.ToString();
            preSanctionDetailsVM.ApplicationNo = model.ApplicationNo;
            preSanctionDetailsVM.AppliedDate   = model.AppliedDate.ToShortDateString();
            preSanctionDetailsVM.CustomerId    = model.CustomerID;
            preSanctionDetailsVM.KycId         = model.KYCID;
            return(preSanctionDetailsVM);
        }
コード例 #4
0
ファイル: KYCService.cs プロジェクト: rashmirai1/MangalWebApp
 /// <summary>
 /// Save KYC
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public void SaveRecord(KYCBasicDetailsVM model)
 {
     _kycRepository.SaveRecord(model);
 }
コード例 #5
0
        public ResidenceVerificationVM ToViewModelResidenceVerification(KYCBasicDetailsVM model)
        {
            ResidenceVerificationVM residenceVerificationVM = new ResidenceVerificationVM();

            var fillAddressByPinCode = (from aa in _context.Mst_PinCode
                                        join bb in _context.tblZonemasters on aa.Pc_ZoneId equals bb.ZoneID
                                        join cc in _context.tblCityMasters on aa.Pc_CityId equals cc.CityID
                                        join dd in _context.tblStateMasters on cc.StateID equals dd.StateID
                                        where aa.Pc_Id == model.PinCode
                                        select new FillAddressByPinCode()
            {
                AreaName = aa.Pc_AreaName,
                ZoneName = bb.Zone,
                ZoneID = bb.ZoneID,
                CityId = cc.CityID,
                CityName = cc.CityName,
                StateID = dd.StateID,
                StateName = dd.StateName
            }).FirstOrDefault();

            residenceVerificationVM.ApplicationNo   = model.ApplicationNo;
            residenceVerificationVM.AppliedDate     = model.AppliedDate.ToShortDateString();
            residenceVerificationVM.CustomerId      = model.CustomerID;
            residenceVerificationVM.PreSanctionId   = model.PreSanctionId;
            residenceVerificationVM.AddressCategory = "02";
            residenceVerificationVM.BldgHouseName   = model.BldgHouseName;
            residenceVerificationVM.BldgPlotNo      = model.BldgPlotNo;
            residenceVerificationVM.Distance        = model.Distance;
            residenceVerificationVM.Landmark        = model.Landmark;
            residenceVerificationVM.PinCode         = model.PinCode;
            residenceVerificationVM.ResidenceCode   = model.ResidenceCode;
            residenceVerificationVM.Road            = model.Road;
            residenceVerificationVM.RoomBlockNo     = model.RoomBlockNo;
            residenceVerificationVM.city            = fillAddressByPinCode.CityName;
            residenceVerificationVM.zone            = fillAddressByPinCode.ZoneName;
            residenceVerificationVM.state           = fillAddressByPinCode.StateName;
            residenceVerificationVM.Area            = fillAddressByPinCode.AreaName;

            var docuploaddetails = (from a in _context.Trn_DocUploadDetails
                                    join b in _context.Mst_DocumentType on a.DocumentTypeId equals b.Id
                                    join c in _context.tblDocumentMasters on a.DocumentId equals c.DocumentID
                                    where a.KycId == model.KYCID && a.Status != "Rejected"
                                    select new DocumentUploadDetailsVM()
            {
                ID = a.Id,
                DocumentTypeId = a.DocumentTypeId,
                DocumentTypeName = b.Name,
                DocumentName = c.DocumentName,
                DocumentId = a.DocumentId,
                ExpiryDate = a.ExpiryDate,
                FileName = a.FileName,
                FileExtension = a.ContentType,
                KycId = a.KycId,
                Status = a.Status,
                VerifiedBy = a.VerifiedBy,
                SpecifyOther = a.SpecifyOther,
                NameonDocument = a.NameonDocument,
                ReasonForRejection = a.ReasonForRejection
            }).ToList();

            residenceVerificationVM.DocumentUploadList = docuploaddetails;
            return(residenceVerificationVM);
        }
コード例 #6
0
        /// <summary>
        /// check if adhar already exists
        /// </summary>
        /// <param name="AdharNo"></param>
        /// <returns></returns>
        public KYCBasicDetailsVM doesAdharExist(string AdharNo)
        {
            int branchid = Convert.ToInt32(HttpContext.Current.Session["BranchId"]);
            var fyid     = Convert.ToInt32(HttpContext.Current.Session["FinancialYearId"]);

            var kyc = _context.TGLKYC_BasicDetails
                      .Include("Trans_KYCAddresses")
                      .Where(x => x.AdhaarNo == AdharNo &&
                             x.BranchID == branchid &&
                             x.FYID == fyid)
                      .OrderByDescending(x => x.AppliedDate)
                      .FirstOrDefault();
            KYCBasicDetailsVM kycVm = new KYCBasicDetailsVM();

            if (kyc != null)
            {
                kycVm.KYCID                 = kyc.KYCID;
                kycVm.KycType               = kyc.KycType;
                kycVm.isPanAdharExist       = true;
                kycVm.Age                   = kyc.Age;
                kycVm.AppFName              = kyc.AppFName;
                kycVm.AppliedDate           = kyc.AppliedDate;
                kycVm.ApplicantPrefix       = kyc.ApplicantPrefix.Trim();
                kycVm.FatherPrefix          = kyc.FatherPrefix.Trim();
                kycVm.ResidenceCode         = kyc.ResidenceCode;
                kycVm.AppLName              = kyc.AppLName;
                kycVm.AppMName              = kyc.AppMName;
                kycVm.ImageName             = kyc.ImageName;
                kycVm.BirthDate             = kyc.BirthDate;
                kycVm.BldgHouseName         = kyc.BldgHouseName;
                kycVm.BldgPlotNo            = kyc.BldgPlotNo;
                kycVm.BranchID              = kyc.BranchID;
                kycVm.CmpID                 = kyc.CmpID;
                kycVm.CreatedBy             = kyc.CreatedBy;
                kycVm.CreatedDate           = kyc.CreatedDate;
                kycVm.CustomerID            = kyc.CustomerID;
                kycVm.Designation           = kyc.Designation;
                kycVm.EmailID               = kyc.EmailID;
                kycVm.ExistingPLCaseNo      = kyc.ExistingPLCaseNo;
                kycVm.FYID                  = kyc.FYID;
                kycVm.Gender                = kyc.Gender;
                kycVm.IndustriesType        = kyc.IndustriesType;
                kycVm.isActive              = true;
                kycVm.Landmark              = kyc.Landmark;
                kycVm.MaritalStatus         = kyc.MaritalStatus;
                kycVm.MobileNo              = kyc.MobileNo;
                kycVm.NomAddress            = kyc.NomAddress;
                kycVm.NomFName              = kyc.NomFName;
                kycVm.NomLName              = kyc.NomLName;
                kycVm.NomMName              = kyc.NomMName;
                kycVm.NomRelation           = kyc.NomRelation;
                kycVm.Occupation            = kyc.Occupation;
                kycVm.OperatorID            = kyc.OperatorID;
                kycVm.OrganizationName      = kyc.OrganizationName;
                kycVm.PANNo                 = kyc.PANNo;
                kycVm.PresentIncome         = kyc.PresentIncome;
                kycVm.Road                  = kyc.Road;
                kycVm.RoomBlockNo           = kyc.RoomBlockNo;
                kycVm.Spouse                = kyc.Spouse;
                kycVm.TelephoneNo           = kyc.TelephoneNo;
                kycVm.UpdatedBy             = kyc.UpdatedBy;
                kycVm.UpdatedDate           = DateTime.Now;
                kycVm.KYCDate               = DateTime.Now;
                kycVm.AdhaarNo              = kyc.AdhaarNo;
                kycVm.ApplicationNo         = kyc.ApplicationNo;
                kycVm.SourceofApplicationID = kyc.SourceofApplicationID;
                kycVm.SourceType            = _context.Mst_SourceofApplication.Where(x => x.Soa_Id == kycVm.SourceofApplicationID).Select(x => x.Soa_Category).FirstOrDefault();
                kycVm.MotherName            = kyc.MotherName;
                kycVm.Father_Spouse         = kyc.Father_Spouse;
                kycVm.CKYCNo                = kyc.CKYCNo;
                kycVm.OccupationOther       = kyc.OccupationOther;
                kycVm.IndustryOther         = kyc.IndustryOther;
                kycVm.NomineeMobileNo       = kyc.NomineeMobileNo;
                kycVm.NomineePanNo          = kyc.NomineePanNo;
                kycVm.NomineeAdharNo        = kyc.NomineeAdharNo;
                kycVm.PinCode               = kyc.PinCode;
                kycVm.Distance              = kyc.Distance;
                kycVm.FatherPrefix          = kyc.FatherPrefix;
                kycVm.Trans_KYCAddresses    = kyc.Trans_KYCAddresses
                                              .Select(
                    x => new KYCAddressesVM()
                {
                    AddressCategory   = x.AddressCategory,
                    BuildingHouseName = x.BuildingHouseName,
                    BuildingPlotNo    = x.BuildingPlotNo,
                    CreatedDate       = x.CreatedDate,
                    Distance_km       = x.Distance_km,
                    ID              = x.ID,
                    KYCID           = x.KYCID,
                    NearestLandmark = x.NearestLandmark,
                    PinCode         = (int)x.PinCode,
                    ResidenceCode   = x.ResidenceCode,
                    Road            = x.Road,
                    RoomBlockNo     = x.RoomBlockNo,
                }).ToList();

                var docuploaddetails = (from a in _context.Trn_DocUploadDetails
                                        join b in _context.Mst_DocumentType on a.DocumentTypeId equals b.Id
                                        join c in _context.tblDocumentMasters on a.DocumentId equals c.DocumentID
                                        where a.KycId == kycVm.KYCID
                                        select new DocumentUploadDetailsVM()
                {
                    ID = a.Id,
                    DocumentTypeId = a.DocumentTypeId,
                    DocumentTypeName = b.Name,
                    DocumentName = c.DocumentName,
                    DocumentId = a.DocumentId,
                    ExpiryDate = a.ExpiryDate,
                    FileName = a.FileName,
                    FileExtension = a.ContentType,
                    KycId = a.KycId,
                    Status = a.Status,
                    VerifiedBy = a.VerifiedBy,
                    SpecifyOther = a.SpecifyOther,
                    NameonDocument = a.NameonDocument,
                    ReasonForRejection = a.ReasonForRejection
                }).ToList();

                kycVm.DocumentUploadList = docuploaddetails;
            }
            else
            {
                kycVm.isPanAdharExist = false;
            }
            return(kycVm);
        }
コード例 #7
0
        /// <summary>
        /// Save kyc
        /// </summary>
        /// <param name="model"></param>
        public void SaveRecord(KYCBasicDetailsVM model)
        {
            try
            {
                TGLKYC_BasicDetails tGLKYC_Basic = new TGLKYC_BasicDetails();
                if (model != null)
                {
                    int kycId = _context.TGLKYC_BasicDetails
                                .Where(x => x.CustomerID == model.CustomerID)
                                .OrderByDescending(x => x.AppliedDate)
                                .Select(x => x.KYCID).FirstOrDefault();
                    if (kycId == 0)
                    {
                        _context.TGLKYC_BasicDetails.Add(tGLKYC_Basic);
                        tGLKYC_Basic.CreatedBy   = model.CreatedBy;
                        tGLKYC_Basic.CreatedDate = DateTime.Now;
                        model.KYCID = kycId;
                    }
                    else
                    {
                        tGLKYC_Basic = _context.TGLKYC_BasicDetails.Where(x => x.KYCID == kycId && x.isActive == true).FirstOrDefault();
                        model.KYCID  = tGLKYC_Basic.KYCID;
                        int count = _context.SP_SaveKYCHistory(model.KYCID);
                    }
                    tGLKYC_Basic.AddressCategory       = "02";
                    tGLKYC_Basic.KycType               = model.KycType;
                    tGLKYC_Basic.Age                   = Convert.ToInt32(model.Age);
                    tGLKYC_Basic.AppliedDate           = Convert.ToDateTime(model.AppliedDate);
                    tGLKYC_Basic.AppFName              = model.AppFName;
                    tGLKYC_Basic.AppMName              = model.AppMName;
                    tGLKYC_Basic.AppLName              = model.AppLName;
                    tGLKYC_Basic.AppPhoto              = model.ApplicantPhoto;
                    tGLKYC_Basic.ImageName             = model.ImageName;
                    tGLKYC_Basic.ContentType           = model.ContentType;
                    tGLKYC_Basic.BirthDate             = Convert.ToDateTime(model.BirthDate);
                    tGLKYC_Basic.BldgHouseName         = model.BldgHouseName;
                    tGLKYC_Basic.BldgPlotNo            = model.BldgPlotNo;
                    tGLKYC_Basic.BranchID              = model.BranchID;
                    tGLKYC_Basic.CmpID                 = model.CmpID;
                    tGLKYC_Basic.CustomerID            = model.CustomerID;
                    tGLKYC_Basic.Designation           = model.Designation;
                    tGLKYC_Basic.EmailID               = model.EmailID;
                    tGLKYC_Basic.ExistingPLCaseNo      = model.ExistingPLCaseNo;
                    tGLKYC_Basic.FYID                  = model.FYID;
                    tGLKYC_Basic.Gender                = model.Gender;
                    tGLKYC_Basic.IndustriesType        = model.IndustriesType;
                    tGLKYC_Basic.isActive              = true;
                    tGLKYC_Basic.Landmark              = model.Landmark;
                    tGLKYC_Basic.MaritalStatus         = model.MaritalStatus;
                    tGLKYC_Basic.MobileNo              = model.MobileNo;
                    tGLKYC_Basic.NomAddress            = model.NomAddress;
                    tGLKYC_Basic.NomFName              = model.NomFName;
                    tGLKYC_Basic.NomLName              = model.NomLName;
                    tGLKYC_Basic.NomMName              = model.NomMName;
                    tGLKYC_Basic.NomRelation           = model.NomRelation;
                    tGLKYC_Basic.Occupation            = model.Occupation;
                    tGLKYC_Basic.OperatorID            = model.CreatedBy;
                    tGLKYC_Basic.OrganizationName      = model.OrganizationName;
                    tGLKYC_Basic.PANNo                 = model.PANNo;
                    tGLKYC_Basic.PresentIncome         = model.PresentIncome;
                    tGLKYC_Basic.Road                  = model.Road;
                    tGLKYC_Basic.RoomBlockNo           = model.RoomBlockNo;
                    tGLKYC_Basic.SourceofApplicationID = Convert.ToInt32(model.SourceofApplicationID);
                    tGLKYC_Basic.Spouse                = model.Spouse;
                    tGLKYC_Basic.TelephoneNo           = model.TelephoneNo;
                    tGLKYC_Basic.UpdatedBy             = model.UpdatedBy;
                    tGLKYC_Basic.UpdatedDate           = DateTime.Now;
                    tGLKYC_Basic.KYCDate               = DateTime.Now;
                    tGLKYC_Basic.AdhaarNo              = model.AdhaarNo;
                    tGLKYC_Basic.ApplicationNo         = model.ApplicationNo;
                    tGLKYC_Basic.ApplicantPrefix       = model.ApplicantPrefix;
                    tGLKYC_Basic.MotherName            = model.MotherName;
                    tGLKYC_Basic.Father_Spouse         = model.Father_Spouse;
                    tGLKYC_Basic.CKYCNo                = model.CKYCNo;
                    tGLKYC_Basic.OccupationOther       = model.OccupationOther;
                    tGLKYC_Basic.IndustryOther         = model.IndustryOther;
                    tGLKYC_Basic.NomineeMobileNo       = model.NomineeMobileNo;
                    tGLKYC_Basic.NomineePanNo          = model.NomineePanNo;
                    tGLKYC_Basic.NomineeAdharNo        = model.NomineeAdharNo;
                    tGLKYC_Basic.PinCode               = model.PinCode;
                    tGLKYC_Basic.Distance              = model.Distance;
                    tGLKYC_Basic.ResidenceCode         = model.ResidenceCode;
                    tGLKYC_Basic.FatherPrefix          = model.FatherPrefix;
                    tGLKYC_Basic.CibilGender           = model.Gender == 1 ? "F" : "M";
                    _context.SaveChanges();
                    int kycid = _context.TGLKYC_BasicDetails.Max(x => x.KYCID);
                    if (model.KYCID == 0)
                    {
                        model.KYCID = kycid;
                    }

                    foreach (var item in model.Trans_KYCAddresses)
                    {
                        Trans_KYCAddresses trans_KYCAddresses = new Trans_KYCAddresses();
                        trans_KYCAddresses = _context.Trans_KYCAddresses.Where(x => x.ID == item.ID).FirstOrDefault();
                        if (trans_KYCAddresses == null)
                        {
                            trans_KYCAddresses = new Trans_KYCAddresses();
                            _context.Trans_KYCAddresses.Add(trans_KYCAddresses);
                        }
                        trans_KYCAddresses.AddressCategory   = item.AddressCategory;
                        trans_KYCAddresses.BuildingHouseName = item.BuildingHouseName;
                        trans_KYCAddresses.BuildingPlotNo    = item.BuildingPlotNo;
                        trans_KYCAddresses.CreatedDate       = DateTime.Now;
                        trans_KYCAddresses.Distance_km       = item.Distance_km;
                        trans_KYCAddresses.KYCID             = (int)model.KYCID;
                        trans_KYCAddresses.NearestLandmark   = item.NearestLandmark;
                        trans_KYCAddresses.PinCode           = item.PinCode;
                        trans_KYCAddresses.ResidenceCode     = item.ResidenceCode;
                        trans_KYCAddresses.Road        = item.Road;
                        trans_KYCAddresses.RoomBlockNo = item.RoomBlockNo;

                        _context.SaveChanges();
                    }

                    List <Trn_DocUploadDetails> NewDocUploadDetails = new List <Trn_DocUploadDetails>();
                    foreach (var p in model.DocumentUploadList)
                    {
                        var Findobject = _context.Trn_DocUploadDetails.Where(x => x.Id == p.ID && x.KycId == model.KYCID).FirstOrDefault();
                        if (Findobject == null)
                        {
                            var trnnew = new Trn_DocUploadDetails
                            {
                                KycId          = (int)model.KYCID,
                                DocumentTypeId = (int)p.DocumentTypeId,
                                DocumentId     = (int)p.DocumentId,
                                ExpiryDate     = p.ExpiryDate,
                                FileName       = p.FileName,
                                ContentType    = p.FileExtension,
                                UploadFile     = p.UploadDocName,
                                SpecifyOther   = p.SpecifyOther,
                                NameonDocument = p.NameonDocument,
                                Status         = "Pending"
                            };
                            _context.Trn_DocUploadDetails.Add(trnnew);
                        }
                        else
                        {
                            Findobject.KycId          = (int)model.KYCID;
                            Findobject.DocumentTypeId = (int)p.DocumentTypeId;
                            Findobject.DocumentId     = (int)p.DocumentId;
                            Findobject.ExpiryDate     = p.ExpiryDate;
                            Findobject.FileName       = p.FileName;
                            Findobject.ContentType    = p.FileExtension;
                            Findobject.UploadFile     = p.UploadDocName;
                            Findobject.SpecifyOther   = p.SpecifyOther;
                            Findobject.NameonDocument = p.NameonDocument;
                        }
                        NewDocUploadDetails.Add(Findobject);
                    }
                    #region document details remove
                    //take the loop of table and check from list if found in list then not remove else remove from table itself
                    var trnobjlist = _context.Trn_DocUploadDetails.Where(x => x.KycId == model.KYCID).ToList();
                    if (trnobjlist != null)
                    {
                        foreach (Trn_DocUploadDetails item in trnobjlist)
                        {
                            if (NewDocUploadDetails.Contains(item))
                            {
                                continue;
                            }
                            else
                            {
                                _context.Trn_DocUploadDetails.Remove(item);
                            }
                        }
                        _context.SaveChanges();
                    }
                    #endregion document trn remove
                }
            }
            catch (Exception e)
            {
                throw e;
            }
        }