Esempio n. 1
0
        public ActionResult CreateGroupLoanApplication(string id)
        {
            int loanmasterId = string.IsNullOrEmpty(id.DecryptString()) ? default(int) : Convert.ToInt32(id.DecryptString());

            GroupLoanApplicationDto grouploanapplicationDto = new GroupLoanApplicationDto();

            if (loanmasterId > 0)
            {
                //grouploanapplicationDto = _grouploanapplicationService.GetByID(loanmasterId);
                grouploanapplicationDto = _grouploanapplicationService.GetGroupApplicationDetailsByID(loanmasterId);
            }

            GroupLoanApplicationModel objgrouploanmodel = Mapper.Map <GroupLoanApplicationDto, GroupLoanApplicationModel>(grouploanapplicationDto);

            if (objgrouploanmodel.GroupID > 0)
            {
                JsonResult groupDetails = GetGroupName(objgrouploanmodel.GroupID);

                objgrouploanmodel.GroupName   = groupDetails.Data.GetType().GetProperty("GroupName").GetValue(groupDetails.Data, null).ToString();
                objgrouploanmodel.VillageCode = groupDetails.Data.GetType().GetProperty("VillageCode").GetValue(groupDetails.Data, null).ToString();
                objgrouploanmodel.VillageName = groupDetails.Data.GetType().GetProperty("VillageName").GetValue(groupDetails.Data, null).ToString();
                objgrouploanmodel.ClusterCode = groupDetails.Data.GetType().GetProperty("ClusterCode").GetValue(groupDetails.Data, null).ToString();
                objgrouploanmodel.ClusterName = groupDetails.Data.GetType().GetProperty("ClusterName").GetValue(groupDetails.Data, null).ToString();
            }

            LoadGroupLoanApplicationDropDowns();

            return(View(objgrouploanmodel));
        }
Esempio n. 2
0
        public GroupLoanApplicationDto GetGroupApplicationDetailsByID(int loanMasterId)
        {
            GroupLoanApplicationDto objGroupLoanApp = new GroupLoanApplicationDto();

            AdoHelper obj = new AdoHelper();

            SqlParameter[] parms = new SqlParameter[1];
            parms[0]           = new SqlParameter("@LoanMasterID", loanMasterId);
            parms[0].SqlDbType = System.Data.SqlDbType.Int;

            SqlDataReader Dr = obj.ExecDataReaderProc("uspGroupLoanApplicationGetByLoanMasterID", parms);

            if (Dr.Read())
            {
                objGroupLoanApp.LoanMasterId             = Convert.ToInt32(Dr["LoanMasterID"]);
                objGroupLoanApp.LoanCode                 = Convert.ToString(Dr["LoanCode"]);
                objGroupLoanApp.LoanType                 = Convert.ToString(Dr["LoanType"]);
                objGroupLoanApp.GroupID                  = Convert.ToInt32(Dr["GroupID"]);
                objGroupLoanApp.LoanApplicationDate      = Convert.ToDateTime(Dr["LoanApplicationDate"]);
                objGroupLoanApp.LoanPurpose              = Convert.ToInt32(Dr["LoanPurpose"]);
                objGroupLoanApp.FundSourse               = Convert.ToInt32(Dr["FundSourceID"]);
                objGroupLoanApp.LoanAmountApplied        = Convert.ToDecimal(Dr["LoanAmountApplied"]);
                objGroupLoanApp.NoofInstallmentsProposed = Convert.ToByte(Dr["NoofInstallmentsProposed"]);
                objGroupLoanApp.Mode       = Convert.ToInt32(Dr["Mode"]);
                objGroupLoanApp.ProjectID  = Convert.ToInt32(Dr["ProjectID"]);
                objGroupLoanApp.StatusCode = Convert.ToString(Dr["StatusCode"]);
                objGroupLoanApp.Status     = Convert.ToString(Dr["Status"]);
            }
            return(objGroupLoanApp);
        }
Esempio n. 3
0
        public ActionResult LoanApplicationView(string id)
        {
            int loanmasterId = string.IsNullOrEmpty(id.DecryptString()) ? default(int) : Convert.ToInt32(id.DecryptString());

            if (loanmasterId <= 0)
            {
                return(RedirectToAction("GroupLoanApplicationLookup"));
            }
            GroupLoanApplicationDto grouploanapplicationdto = _grouploanapplicationService.GetViewById(loanmasterId);

            return(View(grouploanapplicationdto));
        }
        private ResultDto InsertupdateLoanApplication(GroupLoanApplicationDto LoanApplication)
        {
            ResultDto resultDto = new ResultDto();

            LoanApplication.LoanType = "G";
            string obectName = "Loan Application";

            try
            {
                ObjectParameter paramLoanMasterID = new ObjectParameter("LoanMasterID", LoanApplication.LoanMasterId);
                ObjectParameter paramloanCode     = new ObjectParameter("LoanCode", string.Empty);

                int count = _dbContext.uspLoanApplicationInsertUpdate(paramLoanMasterID, paramloanCode, LoanApplication.LoanType, LoanApplication.MemberID, LoanApplication.GroupID,
                                                                      LoanApplication.LoanApplicationDate, LoanApplication.LoanPurpose, LoanApplication.FundSourse, LoanApplication.ProjectID, LoanApplication.LoanAmountApplied, LoanApplication.NoofInstallmentsProposed, LoanApplication.Mode, LoanApplication.UserID, LoanApplication.InterestMasterID);

                resultDto.ObjectId   = (int)paramLoanMasterID.Value;
                resultDto.ObjectCode = string.IsNullOrEmpty((string)paramloanCode.Value) ? LoanApplication.LoanCode : (string)paramloanCode.Value;

                if (resultDto.ObjectId > 0)
                {
                    resultDto.Message = string.Format("{0} details saved successfully with code : {1}", obectName, resultDto.ObjectCode);
                }
                else if (resultDto.ObjectId == -1)
                {
                    resultDto.Message = string.Format("Error occured while generating {0} code", obectName);
                }
                else
                {
                    resultDto.Message = string.Format("Error occured while saving {0} details", obectName);
                }
            }
            catch (Exception)
            {
                resultDto.Message  = string.Format("Service layer error occured while saving the {0} details", obectName);
                resultDto.ObjectId = -98;
            }
            return(resultDto);
        }
 public ResultDto Update(GroupLoanApplicationDto LoanApplication)
 {
     return(InsertupdateLoanApplication(LoanApplication));
 }