public IActionResult Add() { SnadReceiptViewModel snad = new SnadReceiptViewModel(); snad.SnadDate = DateTime.Now.ToString("d", CultureInfo.InvariantCulture); ViewBag.ExpenseId = new SelectList(_expense.GetExpenses(), "Id", "Name"); ViewBag.PaymentMethodId = new SelectList(_method.GetPaymentMethods(), "Id", "Name"); ViewBag.SnadReceiptTypeId = new SelectList(_type.GetSnadReceiptTypes(), "Id", "Name"); return(View(snad)); }
public IActionResult Index(int?page) { var PaymentMethodsList = _payment.GetPaymentMethods(); ViewBag.PaymentMethod = PaymentMethodsList; ViewBag.AccountTreeId = new SelectList(_Acctree.GetAccountTrees(), "Id", "DescriptionAr"); //if (nationality.Count() <= 10) { page = 1; } //int pageSize = 10; return(View()); }
public IActionResult Add() { ForeignAgencyTransferViewModel agencyTransfer = new ForeignAgencyTransferViewModel(); agencyTransfer.TransferDate = DateTime.Now.ToString("d", CultureInfo.InvariantCulture); ViewBag.PurposeId = new SelectList(_purpose.GetTransferPurposes(), "Id", "Name"); ViewBag.CurrencyId = new SelectList(_currency.GetCurrencies(), "Id", "Name"); ViewBag.TransferBankId = new SelectList(_bank.GetBankDetails(), "Id", "Name"); ViewBag.PaymentMethodId = new SelectList(_payment.GetPaymentMethods(), "Id", "Name"); ViewBag.ForeignAgencyId = new SelectList(_agency.GetAgencies(), "Id", "OfficeName"); return(View(agencyTransfer)); }
public IActionResult SnadReceiveIndex(int contractId, int contractType) { var contract_Value = new Contract(); var specContr = new SpecificContract(); ReceiptDocViewModel receiptDoc = new ReceiptDocViewModel(); if (contractType <= (int)EnumHelper.ContractType.Substitute) { contract_Value = _contrat.GetContractById(contractId); if (contract_Value != null) { receiptDoc.CustomerId = contract_Value.CustomerId; } } else { specContr = _spec_contract.GetSpecificContractById(contractId); if (specContr != null) { receiptDoc.CustomerId = specContr.CustomerId; } } receiptDoc.ContractTypeId = contractType; receiptDoc.ContractId = contractId; var ReceiptDocList = _receipt.GetReceiptDocs().Where(x => x.ContractId == contractId && x.ReceiptdocTypeId == (int)EnumHelper.ReceiptdocType.SnadReceive && x.ContractTypeId == receiptDoc.ContractType); ViewBag.ReceiptDocs = ReceiptDocList; receiptDoc.ReceiptdocTypeId = (int)EnumHelper.ReceiptdocType.SnadReceive; ViewBag.PaymentMethodId = new SelectList(_payment_Method.GetPaymentMethods(), "Id", "Name"); ViewBag.ReceiptdocTypeId = new SelectList(_type.GetReceiptDocTypes().Where(x => x.Id == receiptDoc.ReceiptdocTypeId), "Id", "Name"); ViewBag.CustomerId = new SelectList(_customer.GetCustomers().Where(x => x.Id == receiptDoc.CustomerId), "Id", "FirstName", receiptDoc.CustomerId); return(View(receiptDoc)); }