Ejemplo n.º 1
0
        public JsonResult GetInterestDetails(int id)
        {
            InterestService   _interestService  = new InterestService();
            InterestMasterDto interestMasterDto = _interestService.GetByIDExt(id);

            return(Json(new { result = interestMasterDto }));
        }
Ejemplo n.º 2
0
        public InterestMasterDto GetInterestRatesByID(int GroupID, int PrincipleAHID)
        {
            InterestMasterDto objInterestRates = null;

            AdoHelper obj = new AdoHelper();

            SqlParameter[] parms = new SqlParameter[2];

            parms[0]           = new SqlParameter("@GroupId", GroupID);
            parms[0].SqlDbType = System.Data.SqlDbType.Int;

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

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

            if (Dr.Read())
            {
                objInterestRates = new InterestMasterDto();
                if (!string.IsNullOrEmpty(Convert.ToString(Dr["PenalAHID"])))
                {
                    objInterestRates.PenalAHID = Convert.ToInt32(Dr["PenalAHID"]);
                }
                objInterestRates.InterestAHID = Convert.ToInt32(Dr["InterestAHID"]);
                objInterestRates.InterestRate = Convert.ToDecimal(Dr["ROI"]);
                objInterestRates.DueDay       = Convert.ToInt32(Dr["DueDay"]);
                objInterestRates.InterestID   = Convert.ToInt32(Dr["InterestID"]);
                objInterestRates.PenalROI     = Convert.ToDecimal(Dr["PROI"]);
            }

            return(objInterestRates);
        }
        public InterestMasterDto GetInterestRatesByID(int GroupID, int PrincipleAHID)
        {
            InterestMasterDto objInterestMasterDto = new InterestMasterDto();

            objInterestMasterDto = _LoanDisbursementDataAccess.GetInterestRatesByID(GroupID, PrincipleAHID);
            return(objInterestMasterDto);
        }
Ejemplo n.º 4
0
        public InterestMasterDto GetInterestDetailsDto(int id)
        {
            InterestService   _interestService  = new InterestService();
            InterestMasterDto interestMasterDto = _interestService.GetByIDExt(id);

            return(interestMasterDto);
        }
Ejemplo n.º 5
0
        public ActionResult CreateLoanInterestDetails(int?GroupID)
        {
            // int GroupId = Convert.ToInt32(Request.Form["hdnObjectID"]);
            var groupinterestDto = new InterestMasterDto();
            List <GroupInterestRatesDto> lstinterest = new List <GroupInterestRatesDto>();
            string type = "L";

            if (GroupID > 0)
            {
                lstinterest = _groupService.GetInterestByID(GroupID.Value, type);
                ViewBag.GroupInterestRates = lstinterest;
            }
            //InterestMasterModel interestModel = new InterestMasterModel();
            LoadLoanInterestDropDowns();
            InterestMasterDto interestDto = new InterestMasterDto();

            //List<SelectListDto> lstAccountHead = _accountHeadService.GetAccountHeadSelectList();
            //SelectList slstAccountHead = new SelectList(lstAccountHead, "ID", "Text");
            //ViewBag.AccountHead = slstAccountHead;
            //SelectList interestBaseType = GetDropDownListByMasterCode(Enums.RefMasterCodes.INTEREST_BASE_TYPE);
            //SelectList interestCalcType = GetDropDownListByMasterCode(Enums.RefMasterCodes.INTEREST_CALC_TYPE);
            //var interestCalType = new SelectList(interestCalcType, "", "", interestDto.InterestID);
            //ViewBag.InterestBaseType = interestBaseType;
            //ViewBag.InterestCalcType = interestCalcType;
            return(View());
        }
Ejemplo n.º 6
0
        public InterestMasterDto FedGetByID(int id)
        {
            InterestMasterDto interestMasterDto = new InterestMasterDto();
            AdoHelper         obj = new AdoHelper();

            SqlParameter[] parms = new SqlParameter[1];

            parms[0]           = new SqlParameter("@InterestID", id);
            parms[0].SqlDbType = System.Data.SqlDbType.Int;

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

            if (Dr.Read())
            {
                interestMasterDto.PrincipalAHCode = Dr["AHCode"].ToString();
                interestMasterDto.PrincipalAHName = Dr["AHName"].ToString();
                if (Dr["IntrestRateID"] != DBNull.Value)
                {
                    interestMasterDto.InterestRate = Convert.ToDecimal(Dr["IntrestRateID"]);
                }
                if (Dr["PrincipalAHID"] != DBNull.Value)
                {
                    interestMasterDto.PrincipalAHID = Convert.ToInt32(Dr["PrincipalAHID"]);
                }
            }
            return(interestMasterDto);
        }
        public ActionResult CreateMemberLoanDisbursement(string Id)
        {
            int  ID       = string.IsNullOrEmpty(Id.DecryptString()) ? default(int) : Convert.ToInt32(Id.DecryptString());
            char LoanType = 'M';
            var  groupLoanDisbursementDto = new GroupLoanDisbursementDto();

            if (ID > 0)
            {
                LoadLoanInterestDropDowns();

                groupLoanDisbursementDto = GetLoanDisbursementDto(ID, LoanType);
                if (groupLoanDisbursementDto.InterestMasterID > 0)
                {
                    InterestMasterDto objInterestMasterDto = GetInterestDetailsDto(groupLoanDisbursementDto.InterestMasterID);
                    groupLoanDisbursementDto.PrincipleAHName = objInterestMasterDto.PrincipalAHName;
                    groupLoanDisbursementDto.InterestAHName  = objInterestMasterDto.InterestName;
                    groupLoanDisbursementDto.PrincipleAHId   = Convert.ToInt32(objInterestMasterDto.PrincipalAHID);
                    groupLoanDisbursementDto.InterestRateID  = objInterestMasterDto.InterestRateID;
                    groupLoanDisbursementDto.ROI             = objInterestMasterDto.InterestRate;
                }

                List <SelectListDto> memberselectlist = _memberService.GetMemberCodeByGroupId(groupLoanDisbursementDto.GroupID);
                SelectList           lstmembernames   = new SelectList(memberselectlist, "id", "text");
                ViewBag.membercodes = lstmembernames;
            }
            List <GroupMeetingDto> lstGroupMeetings = new GroupOtherReceiptService().GetGroupOpenMeetingDates(GroupInfo.GroupID);

            ViewBag.MonthMeetings = new SelectList(lstGroupMeetings, "DisplayMeetingDate", "DisplayMeetingDate");

            TypeQueryResult lstBankAh = _masterService.GetTypeQueryResult("GROUP_OR_BANK_AH", GroupInfo.GroupID.ToString());

            ViewBag.slBankAh = new SelectList(lstBankAh.OrderBy(a => a.Name), "Id", "Name");
            return(View(groupLoanDisbursementDto));
        }
Ejemplo n.º 8
0
        public ActionResult CreateGroupLoanDisbursement(string Id)
        {
            int  ID       = string.IsNullOrEmpty(Id.DecryptString()) ? default(int) : Convert.ToInt32(Id.DecryptString());
            char LoanType = 'G';
            var  groupLoanDisbursementDto = new GroupLoanDisbursementDto();

            if (ID > 0)
            {
                Disbursement(ID);

                groupLoanDisbursementDto = GetLoanDisbursementDto(ID, LoanType);

                //Set interst ahnames while edit aftersaving, these are empty for 1st time
                if (groupLoanDisbursementDto.InterestMasterID > 0)
                {
                    InterestMasterDto objInterestMasterDto = GetInterestDetailsDto(groupLoanDisbursementDto.InterestMasterID);
                    groupLoanDisbursementDto.PrincipleAHName = objInterestMasterDto.AHName;
                    groupLoanDisbursementDto.InterestAHName  = objInterestMasterDto.InterestAHName;
                    groupLoanDisbursementDto.PrincipleAHId   = Convert.ToInt32(objInterestMasterDto.PrincipalAHID);
                    groupLoanDisbursementDto.InterestRateID  = objInterestMasterDto.InterestRateID;
                }
                List <SelectListDto> memberselectlist = _memberService.GetMemberCodeByGroupId(groupLoanDisbursementDto.GroupID);
                SelectList           lstmembernames   = new SelectList(memberselectlist, "id", "text");
                ViewBag.membercodes = lstmembernames;

                TypeQueryResult lstBankAh = _masterService.GetTypeQueryResult("GROUP_OR_BANK_AH", groupLoanDisbursementDto.GroupID.ToString());
                ViewBag.slBankAh = new SelectList(lstBankAh.OrderBy(a => a.Name), "Id", "Name");
            }

            return(View(groupLoanDisbursementDto));
        }
Ejemplo n.º 9
0
        private InterestMasterDto ReadLoanInterestFormData(FormCollection form)
        {
            InterestMasterDto interestMasterDto = new InterestMasterDto();
            int interestId = default(int);

            int.TryParse(form["InterestID"], out interestId);

            int?penalAhId = null;

            //int.TryParse(form["PenalAHID"], out penalAhId);


            interestMasterDto.InterestID         = interestId;
            interestMasterDto.InterestCode       = Convert.ToString(form["InterestCode"]);
            interestMasterDto.InterestName       = Convert.ToString(form["InterestName"]);
            interestMasterDto.Base               = Convert.ToInt32(form["Base"]);
            interestMasterDto.CaluculationMethod = Convert.ToInt32(form["CaluculationMethod"]);
            if (form["PrincipalAHID"] != "")
            {
                interestMasterDto.PrincipalAHID = Convert.ToInt32(form["PrincipalAHID"]);
            }
            interestMasterDto.InterestAHID = Convert.ToInt32(form["InterestAHID"]);

            interestMasterDto.PenalAHID = penalAhId;

            interestMasterDto.UserId = UserInfo.UserID;

            int maxIndex = Convert.ToInt32(form["hdnMaxRateIndex"]);

            interestMasterDto.InterestRates = new List <InterestRatesDto>();
            InterestRatesDto rate = null;

            for (int i = 1; i <= maxIndex; i++)
            {
                if (form["hdnROI_" + i] == null)
                {
                    continue;
                }

                DateTime dtFromDate = form["hdnFDate_" + i].ConvertToDateTime();
                DateTime dtToDate   = form["hdnToDate_" + i].ConvertToDateTime();

                rate               = new InterestRatesDto();
                rate.ROI           = Convert.ToDecimal(form["hdnROI_" + i]);
                rate.PenalROI      = Convert.ToDecimal(form["hdnPROI_" + i]);
                rate.FromDate      = dtFromDate;
                rate.ToDate        = dtToDate;
                rate.IntrestRateID = Convert.ToInt32(form["hdnRateId_" + i]);

                interestMasterDto.InterestRates.Add(rate);
            }

            return(interestMasterDto);
        }
Ejemplo n.º 10
0
        public ActionResult selectIntrestRate(int GroupId, int PrAhID)
        {
            InterestMasterDto objInterestRates = _groupLoanDisbursementService.GetInterestRatesByID(GroupId, PrAhID);

            if (objInterestRates == null)
            {
                objInterestRates = new InterestMasterDto();
            }

            return(Json(new { ROI = objInterestRates.InterestRate, penalAHId = objInterestRates.PenalAHID, interestRateId = objInterestRates.InterestAHID, DueDay = objInterestRates.DueDay, InterestRateId = objInterestRates.InterestID, PROI = objInterestRates.PenalROI }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 11
0
 public JsonResult GetInterestDetails(int id)
 {
     try
     {
         InterestMasterDto interestDto = GetInterestDetailsDto(id);
         return(Json(new { result = interestDto }));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 12
0
        public InterestMasterDto GetIntrestRateByIntrestId(int Id)
        {
            InterestMasterDto objIntrestMasterDto = null;
            AdoHelper         obj = new AdoHelper();

            SqlParameter[] parms = new SqlParameter[1];

            parms[0]           = new SqlParameter("@InterestID", Id);
            parms[0].SqlDbType = System.Data.SqlDbType.Int;

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

            if (Dr.Read())
            {
                objIntrestMasterDto = new InterestMasterDto();
                if (!string.IsNullOrEmpty(Convert.ToString(Dr["PenalAHID"])))
                {
                    objIntrestMasterDto.PenalAHID = Convert.ToInt32(Dr["PenalAHID"]);
                }
                objIntrestMasterDto.InterestAHID       = Convert.ToInt32(Dr["InterestAHID"]);
                objIntrestMasterDto.InterestCode       = Convert.ToString(Dr["InterestCode"]);
                objIntrestMasterDto.InterestName       = Convert.ToString(Dr["InterestName"]);
                objIntrestMasterDto.InterestID         = Convert.ToInt32(Dr["InterestID"]);
                objIntrestMasterDto.PrincipalAHID      = Convert.ToInt32(Dr["PrincipalAHID"]);
                objIntrestMasterDto.AHName             = Convert.ToString(Dr["AHName"]);
                objIntrestMasterDto.InterestAHName     = Convert.ToString(Dr["INTERESTAHNAME"]);
                objIntrestMasterDto.CaluculationMethod = Convert.ToInt32(Dr["CaluculationMethod"]);
                objIntrestMasterDto.Base = Convert.ToInt32(Dr["Base"]);
            }
            List <InterestRatesDto> lstrates = new List <InterestRatesDto>();
            InterestRatesDto        rateDto  = null;

            if (Dr.NextResult())
            {
                while (Dr.Read())
                {
                    rateDto = new InterestRatesDto();
                    rateDto.IntrestRateID = Convert.ToInt32(Dr["IntrestRateID"]);
                    rateDto.ROI           = Convert.ToInt32(Dr["ROI"]);
                    rateDto.PenalROI      = Convert.ToInt32(Dr["PenalROI"]);
                    rateDto.FromDate      = Convert.ToDateTime(Dr["FromDate"]);
                    if (Dr["ToDate"] != DBNull.Value)
                    {
                        rateDto.ToDate = Convert.ToDateTime(Dr["ToDate"]);
                    }
                    lstrates.Add(rateDto);
                }
                objIntrestMasterDto.InterestRates = lstrates;
            }
            return(objIntrestMasterDto);
        }
Ejemplo n.º 13
0
        public ActionResult CreateDepositInterest(string id)
        {
            int interestId = string.IsNullOrEmpty(id.DecryptString()) ? default(int) : Convert.ToInt32(id.DecryptString());

            var interestDto = new InterestMasterDto();

            if (interestId > 0)
            {
                interestDto = _interestService.GetByID(interestId);
            }

            LoadDropDowns();

            ViewBag.Result = new ResultDto();

            return(View(interestDto));
        }
Ejemplo n.º 14
0
        public InterestMasterDto GetInterestDetailsDto(int id)
        {
            //InterestMasterDto interestDto = _interestService.GetByID(id);
            InterestMasterDto interestDto     = _loanDisbursementDataAccess.GetIntrestRateByIntrestId(id);
            InterestRatesDto  interestRateDto = interestDto.InterestRates.Find(l => l.FromDate < DateTime.Now && (DateTime.Now < l.ToDate || l.ToDate == DateTime.MinValue));

            if (interestRateDto != null && interestRateDto.ROI > 0)
            {
                interestDto.InterestRate = interestRateDto.ROI;
            }
            if (interestRateDto != null && interestRateDto.PenalROI > 0)
            {
                interestDto.PenalROI = interestRateDto.PenalROI;
            }
            if (interestRateDto != null && interestRateDto.IntrestRateID > 0)
            {
                interestDto.InterestRateID = interestRateDto.IntrestRateID;
            }
            return(interestDto);
        }
        //public JsonResult GetGroupName(int id)
        //{
        //    GroupLoanDisbursementDto groupLoanDisbursementDto = _groupLoanDisbursementService.GetByID(id);

        //    return Json(new
        //    {
        //        GroupName = groupLoanDisbursementDto.GroupName,LoanCode = groupLoanDisbursementDto.LoanCode,
        //        LoanApplicationDate = groupLoanDisbursementDto.LoanApplicationDate,LoanPurpose = groupLoanDisbursementDto.LoanPurpose,
        //        LoanAmountApplied = groupLoanDisbursementDto.LoanAmountApplied,
        //        NoOfInstallments = groupLoanDisbursementDto.NoOfInstallments,
        //        Mode = groupLoanDisbursementDto.Mode
        //    });
        //}

        public InterestMasterDto GetInterestDetailsDto(int id)
        {
            InterestMasterDto interestDto = _interestService.GetByIDExt(id);

            // InterestRatesDto interestRateDto = interestDto.InterestRates.Find(l => l.FromDate < DateTime.Now && DateTime.Now < l.ToDate);
            //InterestRatesDto interestRateDto = interestDto;
            //if (interestRateDto != null && interestRateDto.ROI > 0)
            //{
            //    interestDto.InterestRate = interestRateDto.ROI;

            //}
            //if (interestRateDto != null && interestRateDto.PenalROI > 0)
            //{
            //    interestDto.PenalROI = interestRateDto.PenalROI;
            //}
            //if (interestRateDto != null && interestRateDto.IntrestRateID > 0)
            //{
            //    interestDto.InterestRateID = interestRateDto.IntrestRateID;
            //}
            return(interestDto);
        }
Ejemplo n.º 16
0
        private ResultDto InsertUpdateInterest(InterestMasterDto interest, Enums.InterestTypes type)
        {
            ResultDto resultDto  = new ResultDto();
            string    objectName = type.ToString() == "D" ? "deposit interest" : "loan interest";

            try
            {
                string interestratexml = CommonMethods.SerializeListDto <List <InterestRatesDto> >(interest.InterestRates);

                ObjectParameter paraminterestID   = new ObjectParameter("InterestID", interest.InterestID);
                ObjectParameter paraminterestCode = new ObjectParameter("InterestCode", string.Empty);

                int effectedcount = _dbContext.uspInterestInsertUpdate(paraminterestID, interest.InterestName, interest.PrincipalAHID, interest.InterestAHID, interest.PenalAHID, interest.Base, interest.CaluculationMethod, type.ToString(), interest.UserId, interestratexml, paraminterestCode);

                resultDto.ObjectId   = (int)paraminterestID.Value;
                resultDto.ObjectCode = string.IsNullOrEmpty((string)paraminterestCode.Value) ? interest.InterestCode : (string)paraminterestCode.Value;

                if (resultDto.ObjectId > 0)
                {
                    resultDto.Message = string.Format("{0} details saved successfully with code : {1}", objectName, resultDto.ObjectCode);
                }
                else if (resultDto.ObjectId == -1)
                {
                    resultDto.Message = string.Format("Error occured while generating {0} code", objectName);
                }
                else
                {
                    resultDto.Message = string.Format("Error occured while saving {0} details", objectName);
                }
            }
            catch (Exception)
            {
                resultDto.Message  = string.Format("Service layer error occured while saving the {0} details", objectName);
                resultDto.ObjectId = -98;
            }
            return(resultDto);
        }
Ejemplo n.º 17
0
        public InterestMasterDto GetGroupInterestByID(int id)
        {
            InterestMasterDto interestMasterDto = new InterestMasterDto();
            AdoHelper         obj = new AdoHelper();

            SqlParameter[] parms = new SqlParameter[1];

            parms[0]           = new SqlParameter("@InterestID", id);
            parms[0].SqlDbType = System.Data.SqlDbType.Int;

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

            if (Dr.Read())
            {
                interestMasterDto.PrincipalAHCode    = DBNull.Value == Dr["AHCode"] ? string.Empty : Dr["AHCode"].ToString();
                interestMasterDto.PrincipalAHName    = DBNull.Value == Dr["AHName"] ? string.Empty : Dr["AHName"].ToString();
                interestMasterDto.PrincipalAHID      = DBNull.Value == Dr["InterestAHID"] ? 0 : Convert.ToInt32(Dr["PrincipalAHID"]);
                interestMasterDto.InterestAHID       = DBNull.Value == Dr["InterestAHID"] ? 0 : Convert.ToInt32(Dr["InterestAHID"]);
                interestMasterDto.InterestID         = DBNull.Value == Dr["InterestID"] ? 0 : Convert.ToInt32(Dr["InterestID"]);
                interestMasterDto.Base               = Dr["Base"] == DBNull.Value ? 0 : Convert.ToInt32(Dr["Base"]);
                interestMasterDto.CaluculationMethod = Dr["CaluculationMethod"] == DBNull.Value ? 0 : Convert.ToInt32(Dr["CaluculationMethod"]);
                interestMasterDto.InterestRates      = new List <InterestRatesDto>();
            }
            Dr.NextResult();
            while (Dr.Read())
            {
                InterestRatesDto rate = new InterestRatesDto();
                rate.FromDate      = Dr["FromDate"] == DBNull.Value ? DateTime.MinValue : Convert.ToDateTime(Dr["FromDate"]);
                rate.ToDate        = Dr["ToDate"] == DBNull.Value ? DateTime.MinValue : Convert.ToDateTime(Dr["ToDate"]);
                rate.ROI           = Dr["ROI"] == DBNull.Value ? 0 : Convert.ToInt32(Dr["ROI"]);
                rate.PenalROI      = Dr["PenalROI"] == DBNull.Value ? 0 : Convert.ToDecimal(Dr["PenalROI"]);
                rate.IntrestRateID = Dr["InterestRateID"] == DBNull.Value ? 0 : Convert.ToInt32(Dr["InterestRateID"]);
                interestMasterDto.InterestRates.Add(rate);
            }
            return(interestMasterDto);
        }
Ejemplo n.º 18
0
        public ActionResult GetLoanOB(int?id)
        {
            ViewBag.clusters   = GroupInfo.Cluster;
            ViewBag.village    = GroupInfo.Village;
            ViewBag.GroupName  = GroupInfo.GroupName;
            ViewBag.MeetingDay = GroupInfo.MeetingDay;
            ViewBag.LockStatus = GroupInfo.LockStatus;
            int             LoanMasterId = Convert.ToInt32(id);
            LoanOBByLoanDto lstdtos      = new LoanOBByLoanDto();
            LoanOBBll       objLoanOBBll = new LoanOBBll();
            LoanOBDto       lstLoanOBDto = new LoanOBDto();

            if (LoanMasterId > 0)
            {
                lstLoanOBDto        = objLoanOBBll.GetByID(LoanMasterId);
                lstLoanOBDto.Total1 = lstLoanOBDto.PrincipalOutstanding1 + lstLoanOBDto.InterestDue1;
                lstLoanOBDto.Total2 = lstLoanOBDto.PrincipalOutstanding2 + lstLoanOBDto.InterestDue2;
                lstLoanOBDto.Total3 = lstLoanOBDto.PrincipalOutstanding3 + lstLoanOBDto.InterestDue3;
                lstLoanOBDto.Total4 = lstLoanOBDto.PrincipalOutstanding4 + lstLoanOBDto.InterestDue4;
            }

            List <LoanPurposeLookupDto> lstLoanpurposeDto = _loanpurposeService.Lookup();
            SelectList lstloanpurpose = new SelectList(lstLoanpurposeDto, "LoanPurposeID", "Purpose");

            ViewBag.lonapurpose = lstloanpurpose;
            List <SelectListDto> lstProjects = _projectService.GetProjectSelectList();
            SelectList           slProjects  = new SelectList(lstProjects, "ID", "Text");

            ViewBag.projects = slProjects;
            List <MemberLookupDto> lstMembers = _memberService.GetByGroupId(GroupInfo.GroupID);
            SelectList             slMembers  = new SelectList(lstMembers, "MemberID", "MemberName");

            if (lstLoanOBDto.MemberID == 0)
            {
                LoanOBBll           loanOBBll = new LoanOBBll();
                List <LoanOBLookup> lstLoanOB = loanOBBll.LoanOBLookUpList('M', GroupInfo.GroupID);
                foreach (var member in lstLoanOB)
                {
                    lstMembers.Remove(lstMembers.Find(l => l.MemberID == member.MemberID));
                }
                slMembers = new SelectList(lstMembers, "MemberID", "MemberName");
            }
            else
            {
                List <MemberLookupDto> lstMembersTemp = new List <MemberLookupDto>();
                foreach (var member in lstMembers)
                {
                    if (member.MemberID == lstLoanOBDto.MemberID)
                    {
                        lstMembersTemp.Add(lstMembers.Find(l => l.MemberID == member.MemberID));
                    }
                }
                slMembers = new SelectList(lstMembersTemp, "MemberID", "MemberName");
            }


            ViewBag.Members = slMembers;

            List <SelectListDto> lstFundSources = _fundSourceService.GetFundSourceSelectList();
            SelectList           slFundsource   = new SelectList(lstFundSources, "ID", "Text");

            ViewBag.fundsource = slFundsource;

            List <SelectListDto> lstInterests = _interestService.GetInterestsSelectList(GroupInfo.GroupID);
            SelectList           slInterests  = new SelectList(lstInterests, "ID", "Text");

            ViewBag.interests = slInterests;

            if (LoanMasterId == 0)
            {
                if (lstInterests != null && lstInterests.Count > 0 && lstInterests.Exists(l => l.Text.ToUpper().Contains("BIG LOANS TO")))
                {
                    SelectListDto     s        = lstInterests.Find(l => l.Text.ToUpper().Contains("BIG LOANS TO"));
                    InterestMasterDto interest = GetInterestDetailsDto(s.ID);
                    lstLoanOBDto.AHCode1 = interest.PrincipalAHCode;
                    lstLoanOBDto.AHName1 = interest.PrincipalAHName;
                    lstLoanOBDto.ROI1    = Convert.ToInt32(interest.InterestRate);
                    //lstLoanOBDto.InterestDue1 = 0;
                    lstLoanOBDto.Interest1 = s.ID;
                }

                if (lstInterests != null && lstInterests.Count > 0 && lstInterests.Exists(l => l.Text.ToUpper().Contains("SMALL LOANS TO")))
                {
                    SelectListDto     s        = lstInterests.Find(l => l.Text.ToUpper().Contains("SMALL LOANS TO"));
                    InterestMasterDto interest = GetInterestDetailsDto(s.ID);
                    lstLoanOBDto.AHCode2 = interest.PrincipalAHCode;
                    lstLoanOBDto.AHName2 = interest.PrincipalAHName;
                    lstLoanOBDto.ROI2    = Convert.ToInt32(interest.InterestRate);
                    //lstLoanOBDto.InterestDue2 = 0;
                    lstLoanOBDto.Interest2 = s.ID;
                }
                if (lstInterests != null && lstInterests.Count > 0 && lstInterests.Exists(l => l.Text.ToUpper().Contains("HOUSING LOANS TO")))
                {
                    SelectListDto     s        = lstInterests.Find(l => l.Text.ToUpper().Contains("HOUSING LOANS TO"));
                    InterestMasterDto interest = GetInterestDetailsDto(s.ID);
                    lstLoanOBDto.AHCode3 = interest.PrincipalAHCode;
                    lstLoanOBDto.AHName3 = interest.PrincipalAHName;
                    lstLoanOBDto.ROI3    = Convert.ToInt32(interest.InterestRate);
                    //lstLoanOBDto.InterestDue3 = 0;
                    lstLoanOBDto.Interest3 = s.ID;
                }
            }
            else if (LoanMasterId > 0 && lstLoanOBDto.AHCode1 != null && lstLoanOBDto.AHCode2 != null && lstLoanOBDto.AHCode3 != null)
            {
            }
            else if (LoanMasterId > 0 && lstLoanOBDto.AHCode1 != null && lstLoanOBDto.AHCode2 != null)
            {
                if (lstInterests != null && lstInterests.Count > 0 && lstInterests.Exists(l => l.Text.ToUpper().Contains("BIG LOANS TO")))
                {
                    SelectListDto     s        = lstInterests.Find(l => l.Text.ToUpper().Contains("BIG LOANS TO"));
                    InterestMasterDto interest = GetInterestDetailsDto(s.ID);
                    lstLoanOBDto.AHCode3 = interest.PrincipalAHCode;
                    lstLoanOBDto.AHName3 = interest.PrincipalAHName;

                    lstLoanOBDto.Interest3 = s.ID;
                }
            }
            else
            {
                if (lstInterests != null && lstInterests.Count > 0 && lstInterests.Exists(l => l.Text.ToUpper().Contains("BIG LOANS TO")))
                {
                    SelectListDto     s        = lstInterests.Find(l => l.Text.ToUpper().Contains("BIG LOANS TO"));
                    InterestMasterDto interest = GetInterestDetailsDto(s.ID);
                    lstLoanOBDto.AHCode2 = interest.PrincipalAHCode;
                    lstLoanOBDto.AHName2 = interest.PrincipalAHName;

                    lstLoanOBDto.Interest2 = s.ID;
                }

                if (lstInterests != null && lstInterests.Count > 0 && lstInterests.Exists(l => l.Text.ToUpper().Contains("SMALL LOANS TO")))
                {
                    SelectListDto     s        = lstInterests.Find(l => l.Text.ToUpper().Contains("SMALL LOANS TO"));
                    InterestMasterDto interest = GetInterestDetailsDto(s.ID);
                    lstLoanOBDto.AHCode2 = interest.PrincipalAHCode;
                    lstLoanOBDto.AHName2 = interest.PrincipalAHName;

                    lstLoanOBDto.Interest2 = s.ID;
                }

                if (lstInterests != null && lstInterests.Count > 0 && lstInterests.Exists(l => l.Text.ToUpper().Contains("HOUSING LOANS TO")))
                {
                    SelectListDto     s        = lstInterests.Find(l => l.Text.ToUpper().Contains("HOUSING LOANS TO"));
                    InterestMasterDto interest = GetInterestDetailsDto(s.ID);
                    lstLoanOBDto.AHCode3 = interest.PrincipalAHCode;
                    lstLoanOBDto.AHName3 = interest.PrincipalAHName;

                    lstLoanOBDto.Interest3 = s.ID;
                }
            }
            ViewBag.lastpaidDate       = string.Format("{0}/Mar/2016", GroupInfo.MeetingDay);
            lstLoanOBDto.LastPaidDate1 = ViewBag.lastpaidDate;
            lstLoanOBDto.LastPaidDate2 = ViewBag.lastpaidDate;
            lstLoanOBDto.LastPaidDate3 = ViewBag.lastpaidDate;
            lstLoanOBDto.LastPaidDate4 = ViewBag.lastpaidDate;
            ViewBag.meetingDay         = GroupInfo.MeetingDay;
            //List<SelectListDto> lstPrincipalAHIDs=_accountHeadService.loan

            ViewBag.LoanAccountHeads = slInterests;
            return(View(lstLoanOBDto));
        }
Ejemplo n.º 19
0
 public ResultDto Update(InterestMasterDto interest, Enums.InterestTypes type)
 {
     return(InsertUpdateInterest(interest, type));
 }