Exemplo n.º 1
0
        public void AddDeviationRange(TGLPreSanctionVM model)
        {
            string pageUrl = "/PreSanction/GetPreSanctionForApprove/" + model.PreSanctionID;
            string message = string.Format("Deviation raised on presanction-Customer({0})", model.CustomerID);
            string remarks = string.Empty;

            var roiDeviation = _preSanctionRepository.GetDeviationRange(1, model.ROI ?? 0);

            if (roiDeviation.IsDeviation ?? false)
            {
                remarks = string.Format("Deviation raised for ROI which is beyond the range");
            }

            var tenureDeviation = _preSanctionRepository.GetDeviationRange(5, model.Tenure ?? 0);

            if (tenureDeviation.IsDeviation ?? false)
            {
                remarks += string.Format(", Deviation raised for Tenure which is beyond the range");
            }

            if (!string.IsNullOrEmpty(remarks))
            {
                var actionId = _MessageActionRepository.AddMessageAction(0, message, remarks, pageUrl, roiDeviation.UserCategoryId ?? 0, true, model.CreatedBy ?? 0);
                _preSanctionRepository.UpdateActionIDToPreSanction(model.PreSanctionID, actionId);
            }
        }
Exemplo n.º 2
0
        // GET: PreSanction
        public ActionResult Index()
        {
            ButtonVisiblity("Index");
            var model = new TGLPreSanctionVM();

            model.RMList       = new SelectList(_preSanctionService.GetAllRMByBranch(), "UserID", "UserName");
            model.LoanPurposes = new SelectList(_preSanctionService.GetLoanPurposes(), "LoanPuposeID", "LoanPupose");
            model.Schemes      = new SelectList(_schemeService.GetAllSchemeMasters(), "SID", "SchemeName");
            model.Products     = new SelectList(_productrateService.GetProductList(), "Id", "Name");
            return(View(model));
        }
Exemplo n.º 3
0
        public TGLPreSanctionVM SavePreSanction(TGLPreSanctionVM model, out Dictionary <string, string> errors)
        {
            errors = new Dictionary <string, string>();

            var preSanction = CreateTGLPreSanction(model);

            if (model.PreSanctionID <= 0)
            {
                preSanction.CreatedDate = DateTime.Now;
                var dbRecord = _preSanctionRepository.AddPreSanction(preSanction, out errors);

                if (dbRecord != null)
                {
                    model.PreSanctionID = dbRecord.PreSanctionID;
                    if (errors.Count <= 0)
                    {
                        AddDeviationRange(model);
                    }
                }
            }
            else if (model.PreSanctionID > 0 && model.IsApproval == "1")
            {
                preSanction.Status           = model.DeviationApprove;
                preSanction.ApproverComments = model.ApproverComment;

                var dbRecord = _preSanctionRepository.UpdatePreSanctionApprove(preSanction, out errors);
            }
            else if (model.PreSanctionID > 0)
            {
                var dbRecod = _preSanctionRepository.UpdatePreSanction(preSanction, out errors);
                if (errors.Count <= 0)
                {
                    _preSanctionRepository.DeleteMessageAction(dbRecod.MessageActionID ?? 0);
                    AddDeviationRange(model);
                }
            }



            return(model);
        }
Exemplo n.º 4
0
        public ActionResult SavePreSanction(TGLPreSanctionVM model)
        {
            try
            {
                model.CreatedBy = UserInfo.UserID;
                model.FYID      = UserInfo.FinancialYearId;
                model.CMPID     = UserInfo.CompanyId;
                model.BranchID  = UserInfo.BranchId;

                Dictionary <string, string> errors;

                var preSanction = _preSanctionService.SavePreSanction(model, out errors);
                if (errors != null && errors.Count > 0)
                {
                    Response.StatusCode = (int)HttpStatusCode.BadRequest;
                    return(Json(errors));
                }
                return(Json(preSanction));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 5
0
 private TGLPreSanction CreateTGLPreSanction(TGLPreSanctionVM model)
 {
     return(new TGLPreSanction
     {
         PreSanctionID = model.PreSanctionID,
         KYCID = model.KYCID,
         LoanType = model.LoanType,
         LoanPurposeID = model.LoanPurposeID,
         Comments = model.Comments,
         CreatedBy = model.CreatedBy,
         LTV = model.LTV,
         ProductID = model.ProductID,
         ReqLoanAmount = model.ReqLoanAmount,
         RMID = model.RMID,
         ROI = model.ROI,
         SchemeID = model.SchemeID,
         Tenure = model.Tenure,
         ResidenceVerification = model.ResidenceVerification,
         TransactionID = model.TransactionID,
         FYID = model.FYID,
         CMPID = model.CMPID,
         BranchID = model.BranchID,
     });
 }