コード例 #1
0
        public async Task <IActionResult> Create([Bind("InventoriesId,InventoryTitle,Quantity,LocationId")] Inventory inventory)
        {
            if (ModelState.IsValid)
            {
                _context.Add(inventory);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(inventory));
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("LocationId,Address,LocationName")] Location location)
        {
            if (ModelState.IsValid)
            {
                _context.Add(location);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(location));
        }
コード例 #3
0
        public async Task <IActionResult> Create([Bind("ProductId,ProductName,Price,Brands,Sizes,Description,InventoriesId")] BeautyProduct beautyProduct)
        {
            if (ModelState.IsValid)
            {
                _context.Add(beautyProduct);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(beautyProduct));
        }
コード例 #4
0
        public async Task <IActionResult> Create([Bind("CustomerName,Password,CustomerID,EmailAddress,PhoneNumber,HomeAddress,BillingAddress")] Customer customer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customer);
                await _context.SaveChangesAsync();

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