示例#1
0
        public ActionResult CreateContraEntryCashWithdrawl(string id)
        {
            long AccountMasterID = string.IsNullOrEmpty(id.DecryptString()) ? default(long) : Convert.ToInt32(id.DecryptString());
            ContraEntryWithDrawlDto contraEntryWithDrawlDto = new ContraEntryWithDrawlDto();

            if (AccountMasterID > 0)
            {
                contraEntryWithDrawlDto = _ContraEntryService.GroupContraEntryWithDrawlGetByAccountMasterId(AccountMasterID);
            }


            int groupId = GroupInfo.GroupID;
            BankMasterViewDto        objBank     = new BankMasterViewDto();
            List <BankMasterViewDto> lstAllBanks = _ContraEntryService.GetAllGroupBanksByGroupId(groupId);
            SelectList lstgroupBanks             = new SelectList(lstAllBanks, "AHID", "AccountNumber", objBank.BankEntryID);

            ViewBag.GroupBanks = lstgroupBanks;

            AccountHeadDto objAccountHead = _accountheadService.GetCashInHandAccount(false);
            int            ahId           = objAccountHead.AHID;

            AccountHeadDto closeingBalance = _accountheadService.GetAccountHeadViewBalanceSummary(ahId, false, groupId);

            objAccountHead.ClosingBalance = closeingBalance.ClosingBalance;
            ViewBag.CashInHandDetails     = objAccountHead;
            int EmployeeID = UserInfo.UserID;

            contraEntryWithDrawlDto.UserID = UserInfo.UserID;
            EmployeeDto obj = _employeeService.GetByID(EmployeeID);

            contraEntryWithDrawlDto.EmployeeName = obj.EmployeeName;
            contraEntryWithDrawlDto.EmployeeCode = obj.EmployeeCode;

            if (contraEntryWithDrawlDto.contraEntryWithDrawlTransactions != null && contraEntryWithDrawlDto.contraEntryWithDrawlTransactions.Count > 0)
            {
                var totalCrAmmount = contraEntryWithDrawlDto.contraEntryWithDrawlTransactions[contraEntryWithDrawlDto.contraEntryWithDrawlTransactions.Count() - 1].CrAmount;
                ViewBag.TotalCrAmmount = totalCrAmmount;
            }
            return(View(contraEntryWithDrawlDto));
        }
        private void LoadDropDowns()
        {
            ReceiptMasterDto objreceipt = new ReceiptMasterDto();
            MemberDto        memberdto  = new MemberDto();
            int GroupId = GroupInfo.GroupID;
            List <MemberLookupDto> lstmemberlookupDto = _memberservice.LookUp(GroupId);

            //SelectList lstmemberCodes = new SelectList(lstmemberlookupDto, "MemberId", "MemberCode", memberdto.MemberID);
            SelectList lstmemberCodes = new SelectList(lstmemberlookupDto, "MemberId", "MemberName", memberdto.MemberID);

            ViewBag.MemberCodes = lstmemberCodes;

            int groupId = GroupInfo.GroupID;
            BankMasterViewDto        objBank     = new BankMasterViewDto();
            List <BankMasterViewDto> lstAllBanks = _ContraEntryService.GetAllGroupBanksByGroupId(groupId);
            SelectList lstgroupBanks             = new SelectList(lstAllBanks, "BankEntryID", "AccountNumber", objBank.BankEntryID);

            ViewBag.GroupBanks = lstgroupBanks;

            //BankMasterViewDto objBank = new BankMasterViewDto();
            //List<BankMasterViewDto> lstAllBanks = _groupReceiptService.GetGroupBanks();
            //SelectList lstgroupBanks = new SelectList(lstAllBanks, "AHID", "AccountNumber", objBank.BankEntryID);
            //ViewBag.GroupBanks = lstgroupBanks;
        }