Example #1
0
        public async Task <IActionResult> Create(OriginalListing originalListing)
        {
            if (ModelState.IsValid)
            {
                _context.Add(originalListing);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(originalListing));
        }
        public async Task <IActionResult> Create([Bind("Id,Cnmd,Type,FullName,ReceiveMoney,Tax,RealRecevieMoney,Created,OriginalId,BankAccountId,IsPaid,PaidDate")] Transaction transaction)
        {
            if (ModelState.IsValid)
            {
                _context.Add(transaction);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BankAccountId"] = new SelectList(_context.BankAccount, "Id", "CmndNumber", transaction.BankAccountId);
            ViewData["OriginalId"]    = new SelectList(_context.OriginalListing, "Id", "Id", transaction.OriginalId);
            return(View(transaction));
        }
Example #3
0
        public async Task <IActionResult> Create([Bind("Id,CmndNumber,Beneficiaries,NumberAccount,Bank,Created,Updated,CreatedBy,UpdateBy")] BankAccount bankAccount)
        {
            if (ModelState.IsValid)
            {
                _context.Add(bankAccount);
                await _context.SaveChangesAsync();

                await _context.Database.ExecuteSqlCommandAsync("modify_banks_transaction");

                return(RedirectToAction(nameof(Index)));
            }
            return(View(bankAccount));
        }