Beispiel #1
0
        public async Task <ActionResult <User> > Post(User item)
        {
            _context.Users.Add(item);
            await _context.SaveChangesAsync();

            return(item);
        }
        public async Task <ActionResult <Bill> > Post(Bill item)
        {
            _context.Bills.Add(item);
            await _context.SaveChangesAsync();

            return(item);
        }
Beispiel #3
0
        public async Task <ActionResult <Admin> > Post(Admin item)
        {
            _context.Admins.Add(item);
            await _context.SaveChangesAsync();

            return(item);
        }
Beispiel #4
0
        public async Task <ActionResult <Product> > Post(Product item)
        {
            _context.Products.Add(item);
            await _context.SaveChangesAsync();

            return(item);
        }
Beispiel #5
0
        public async Task <ActionResult <Category> > Post(Category item)
        {
            _context.Categories.Add(item);
            await _context.SaveChangesAsync();

            return(item);
        }
Beispiel #6
0
        public async Task <IActionResult> Create([Bind("ID,Name,Address")] Providers providers)
        {
            if (ModelState.IsValid)
            {
                _context.Add(providers);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(providers));
        }
Beispiel #7
0
        public async Task <IActionResult> Create([Bind("ID,Name,Price,BrandsID")] Products products)
        {
            if (ModelState.IsValid)
            {
                _context.Add(products);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BrandsID"] = new SelectList(_context.Brands, "ID", "Name", products.Brands.Name);
            return(View(products));
        }
Beispiel #8
0
        public async Task <IActionResult> Create([Bind("ID,Name,Address,OwnersID")] Shops shops)
        {
            if (ModelState.IsValid)
            {
                _context.Add(shops);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["OwnersID"] = new SelectList(_context.Owners, "ID", "Name", shops.Owners.Name);
            return(View(shops));
        }
        public async Task <IActionResult> Create([Bind("ID,Name,Info,ProvidersID")] Brands brands)
        {
            if (ModelState.IsValid)
            {
                _context.Add(brands);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ProvidersID"] = new SelectList(_context.Providers, "ID", "Name", brands.Providers.Name);
            return(View(brands));
        }