public async Task <IActionResult> Create([Bind("CustomerID,LastAmount,Balance")] Deposit deposit)
        {
            if (ModelState.IsValid)
            {
                _context.Add(deposit);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(deposit));
        }
Пример #2
0
        public async Task <bool> Add(Site site)
        {
            if (customerRepository.IsIDExists(site.CustomerID))
            {
                _context.Add(site);
                await _context.SaveChangesAsync();

                return(true);
            }
            return(false);
        }
Пример #3
0
        public async Task <IActionResult> Create([Bind("OrderID,CustomerCID,PriceAmount,TansportAmount,AdvanceBalance")] Order order)
        {
            if (ModelState.IsValid)
            {
                _context.Add(order);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(order));
        }
Пример #4
0
        public async Task <IActionResult> Create([Bind("ProductID,ProductName,Price,Rate")] Product product)
        {
            if (ModelState.IsValid)
            {
                _context.Add(product);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(product));
        }
Пример #5
0
        public async Task <bool> Add(Customer customer)
        {
            if (!IsIDExists(customer.CustomerCID))
            {
                _context.Add(customer);
                await _context.SaveChangesAsync();

                return(true);
            }
            return(false);
        }