Exemplo n.º 1
0
        public ActionResult GetDepositOB(int?id)
        {
            int          GroupID         = Convert.ToInt32(id);
            DepositOBDto lstDepositOBDto = new DepositOBDto();
            DepositOBBll objDepositOBBll = new DepositOBBll();

            if (GroupID > 0)
            {
                lstDepositOBDto = objDepositOBBll.GetByID(GroupID);
            }
            List <SelectListDto> lstClusters = _clusterService.GetClusterSelectList();
            SelectList           slClusters  = new SelectList(lstClusters, "ID", "Text");

            ViewBag.clusters = slClusters;

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

            ViewBag.interests = slInterests;


            List <SelectListDto> lstvilllages = _villageService.GetVillageSelectList();
            SelectList           slvillages   = new SelectList(lstvilllages, "ID", "Text");

            ViewBag.village = slvillages;

            List <SelectListDto> lstgroups = _groupService.GetGroupsSelectList();
            SelectList           slgroups  = new SelectList(lstgroups, "ID", "Text");

            ViewBag.group = slgroups;

            return(View(lstDepositOBDto));
        }
Exemplo n.º 2
0
        public ActionResult DepositLookup()
        {
            DepositOBBll           DepositOBBll = new DepositOBBll();
            List <DepositOBLookup> lstDepositOB = DepositOBBll.DepositOBLookUpList(false, 0);

            return(View(lstDepositOB));
        }
        public ActionResult DepositLookup()
        {
            DepositOBBll DepositOBBll = new DepositOBBll();
            DataSet      dsDepositOB  = DepositOBBll.DepositOBLookUpTable(true, GroupInfo.GroupID);

            /*List<DepositOBLookup> lstDepositOB = DepositOBBll.DepositOBLookUp(true, GroupInfo.GroupID);
             * List<DepositOBPPivot> lstDepositOBPPivot = new List<DepositOBPPivot>();
             * var lstLoanOBGroup = lstDepositOB.GroupBy(l => l.MemberId).Select(m => m.Key).ToList();
             * foreach (var member in lstLoanOBGroup)
             * {
             *
             *  var memberLoans = lstDepositOB.FindAll(l => l.MemberId == member);
             *  DepositOBPPivot depositOBPPivot = new DepositOBPPivot();
             *  depositOBPPivot.MemberName = lstDepositOB.Find(l => l.MemberId == member).MemberName;
             *  depositOBPPivot.MemberId = member;
             *  foreach (var loan in memberLoans)
             *  {
             *      if (memberLoans.IndexOf(loan) == 0)
             *      {
             *          depositOBPPivot.DepositAmount1 = loan.DepositAmount;
             *      }
             *      else if (memberLoans.IndexOf(loan) == 1)
             *      {
             *          depositOBPPivot.DepositAmount2 = loan.DepositAmount;
             *      }
             *      else if (memberLoans.IndexOf(loan) == 2)
             *      {
             *          depositOBPPivot.DepositAmount3 = loan.DepositAmount;
             *      }
             *      else
             *          break;
             *  }
             *
             *  lstDepositOBPPivot.Add(depositOBPPivot);
             * }
             * var amount1 = lstDepositOBPPivot.Sum(l => l.DepositAmount1);
             * var amount2 = lstDepositOBPPivot.Sum(l => l.DepositAmount2);
             * var amount3 = lstDepositOBPPivot.Sum(l => l.DepositAmount3);
             * ViewBag.DepositAmount1 = amount1;
             * ViewBag.DepositAmount2 = amount2;
             * ViewBag.DepositAmount3 = amount3;
             * return View(lstDepositOBPPivot);
             */
            ViewBag.DSDEPOSITOB = dsDepositOB;
            return(View());
        }
Exemplo n.º 4
0
        public JsonResult SaveDepositOB(DepositOBDto depositOBDto)
        {
            DepositOBBll objDepositOBBll = new DepositOBBll();

            depositOBDto.UserID = UserInfo.UserID;
            depositOBDto        = objDepositOBBll.InsertLoanOB(depositOBDto);
            string Message = null;

            if (depositOBDto.Id1 != 0 || depositOBDto.Id2 != 0 || depositOBDto.Id3 != 0 || depositOBDto.Id4 != 0)
            {
                Message = "Successfully Inserted";
            }
            else
            {
                Message = "Not Inserted";
            }
            return(Json(new { result = Message }));
        }
        public ActionResult CreateDepositOB(int?id)
        {
            int          MemberId        = Convert.ToInt32(id);
            DepositOBDto lstDepositOBDto = new DepositOBDto();
            DepositOBBll objDepositOBBll = new DepositOBBll();

            if (MemberId > 0)
            {
                lstDepositOBDto = objDepositOBBll.GetByMemberID(MemberId);
            }
            ViewBag.clusters   = GroupInfo.Cluster;
            ViewBag.village    = GroupInfo.Village;
            ViewBag.GroupName  = GroupInfo.GroupName;
            ViewBag.MeetingDay = GroupInfo.MeetingDay;
            int GroupId = GroupInfo.GroupID;

            List <MemberLookupDto> lstMembers = _memberService.GetByGroupId(GroupInfo.GroupID);
            SelectList             slMembers  = null;

            if (lstDepositOBDto.MemberId == 0)
            {
                DepositOBBll           depositOBBll = new DepositOBBll();
                List <DepositOBLookup> lstDepositOB = depositOBBll.DepositOBLookUpList(true, GroupInfo.GroupID);
                foreach (var member in lstDepositOB)
                {
                    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 == lstDepositOBDto.MemberId)
                    {
                        lstMembersTemp.Add(lstMembers.Find(l => l.MemberID == member.MemberID));
                    }
                }
                slMembers = new SelectList(lstMembersTemp, "MemberID", "MemberName");
            }

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

            ViewBag.interests = slInterests;

            //ViewBag.lastpaidDate = string.Format("{0}/Mar/2016", GroupInfo.MeetingDay);
            //lstDepositOBDto.LastPaidDate1 =Convert.ToDateTime(ViewBag.lastpaidDate);
            //lstDepositOBDto.LastPaidDate2 = Convert.ToDateTime(ViewBag.lastpaidDate);
            //lstDepositOBDto.LastPaidDate3 = Convert.ToDateTime(ViewBag.lastpaidDate);
            //lstDepositOBDto.LastPaidDate4 = Convert.ToDateTime(ViewBag.lastpaidDate);

            //var DB1 = (lstDepositOBDto.DepositBalance1) > 0 ?lstDepositOBDto.DepositBalance1 : 0;
            //var DB2 = (lstDepositOBDto.IneterestDue1) > 0 ? lstDepositOBDto.IneterestDu*e1 : 0;
            //ViewBag.Total1 = DB1 + DB2;
            //var DB3 = (lstDepositOBDto.DepositBalance2) > 0 ? lstDepositOBDto.DepositBalance2 : 0;
            //var DB4 = (lstDepositOBDto.IneterestDue2) > 0 ? lstDepositOBDto.IneterestDue2 : 0;
            //ViewBag.Total2 = DB3 + DB4;
            //var DB5 = (lstDepositOBDto.DepositBalance3) > 0 ? lstDepositOBDto.DepositBalance3 : 0;
            //var DB6 = (lstDepositOBDto.IneterestDue3) > 0 ? lstDepositOBDto.IneterestDue3 : 0;
            //ViewBag.Total3 = DB5 + DB6;
            //var DB7 = (lstDepositOBDto.DepositBalance4) > 0 ? lstDepositOBDto.DepositBalance4 : 0;
            //var DB8 = (lstDepositOBDto.IneterestDue4) > 0 ? lstDepositOBDto.IneterestDue4 : 0;
            //ViewBag.Total4 = DB7 + DB8;

            int Id = lstDepositOBDto.MemberId;

            MemberDto obj = _memberService.GetById(Id);

            lstDepositOBDto.MemberCode = obj == null ? string.Empty: obj.MemberCode;

            return(View(lstDepositOBDto));
        }