コード例 #1
0
        public async Task <IActionResult> Create([Bind("Id,NameSize")] Size size)
        {
            if (ModelState.IsValid)
            {
                _context.Add(size);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(size));
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("Id, IdModle, Image, Price, Sale, Description, CreateDate, StartTime, EndTime, IdSupplier, NameProduct")] Product product)
        {
            if (ModelState.IsValid)
            {
                _context.Add(product);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(product));
        }
コード例 #3
0
        public async Task <IActionResult> Create([Bind("Id,FullName,Username,Password,Email,Address,Phone,IdRole,CreateDate,Image")] Customers customers)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customers);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(customers));
        }
コード例 #4
0
        public async Task <IActionResult> Create([Bind("Id,NameColor,CodeColor")] Color color)
        {
            if (ModelState.IsValid)
            {
                _context.Add(color);
                await _context.SaveChangesAsync();

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