示例#1
0
        public IActionResult CreateAccountTransaction()
        {
            CodesRepository codeRepository = new CodesRepository(context);

            ViewBag.Accounts          = new AccountsRepository(context).GetAccounts(userManager.GetUserId(User));
            ViewBag.TransactionTypes  = codeRepository.GetCodesByCodeGroupGuid(CodeGroups.TransactionType);
            ViewBag.TransactionStates = codeRepository.GetCodesByCodeGroupGuid(CodeGroups.TransactionState);

            return(View());
        }
示例#2
0
        public List <SelectListItem> GetAllStateByType(string type)
        {
            ICodesRepository      codesRepo = new CodesRepository();
            List <SelectListItem> itemList  = new List <SelectListItem>();

            itemList = codesRepo.GetAllByType(type).Select(x => new SelectListItem()
            {
                Text = x.Value, Value = x.ID.ToString()
            }).ToList();
            return(itemList);
        }
示例#3
0
        public IActionResult EditCheckTransaction(Guid transactionGuid)
        {
            if (transactionGuid == null)
            {
                return(BadRequest());
            }

            var checkTransaction = context.CheckTransaction
                                   .Where(x => x.TransactionGuid == transactionGuid)
                                   .SingleOrDefault();

            if (checkTransaction == null)
            {
                return(NotFound());
            }

            var transaction = context.Transaction
                              .Where(x => x.TransactionGuid == transactionGuid)
                              .SingleOrDefault();

            EditCheckTransactionViewModel model = new EditCheckTransactionViewModel()
            {
                TransactionGuid = transaction.TransactionGuid,
                AccountGuid     = transaction.AccountGuid,
                TypeGuid        = transaction.TypeCodeGuid,
                StateGuid       = transaction.StateCodeGuid,
                Title           = transaction.Title,
                Cost            = transaction.Cost.ToString(),
                AccountSide     = transaction.AccountSide,
                Serial          = checkTransaction.Serial,
                Description     = transaction.Description,
                IssueDate       = checkTransaction.IssueDate.ToString(),
                ReceiptDate     = transaction.ReceiptDate.ToString()
            };

            CodesRepository codeRepository = new CodesRepository(context);

            ViewBag.Accounts          = new AccountsRepository(context).GetAccounts(userManager.GetUserId(User));
            ViewBag.TransactionTypes  = codeRepository.GetCodesByCodeGroupGuid(CodeGroups.TransactionType);
            ViewBag.TransactionStates = codeRepository.GetCodesByCodeGroupGuid(CodeGroups.TransactionState);

            return(View(model));
        }