示例#1
0
        public async Task <IActionResult> Create([Bind("Idkhachhang,Hotenkhachhang,Diachikhachhang")] Khachhang khachhang)
        {
            if (ModelState.IsValid)
            {
                _context.Add(khachhang);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(khachhang));
        }
        public async Task <IActionResult> Create([Bind("Idmathang,Tenhang,Loaihang,Quycach,Giaban,Soluong")] Mathang mathang)
        {
            if (ModelState.IsValid)
            {
                _context.Add(mathang);
                await _context.SaveChangesAsync();

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