Ejemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("ID,DeviceID,ProductID,DeviceProductStock,DeviceProductSale")] DeviceProduct deviceProduct)
        {
            if (ModelState.IsValid)
            {
                _context.Add(deviceProduct);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(deviceProduct));
        }
        public async Task <IActionResult> Create([Bind("ID,CategoryID,CategoryName,CategoryInfo")] ProductCategory productCategory)
        {
            if (ModelState.IsValid)
            {
                _context.Add(productCategory);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(productCategory));
        }
        public async Task <IActionResult> Create([Bind("ID,UserNickName,UserOpenID,UserPhone,UserGender,UserBirthday")] User user)
        {
            if (ModelState.IsValid)
            {
                _context.Add(user);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(user));
        }
        public async Task <IActionResult> Create([Bind("ID,ProductID,CategoryID,BrandID,ProductName,ProductImage,ProductWeight,ProductPrice,ProductStock,ProductSale")] CommodityManage commodityManage)
        {
            if (ModelState.IsValid)
            {
                _context.Add(commodityManage);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(commodityManage));
        }
Ejemplo n.º 5
0
        public async Task <IActionResult> Create([Bind("ID,BrandID,BrandName,BrandInfo")] BrandCategory brandCategory)
        {
            if (ModelState.IsValid)
            {
                _context.Add(brandCategory);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(brandCategory));
        }
        public async Task <IActionResult> Create([Bind("ID,DeviceID,DeviceNumber,DeviceProductKey,DeviceSecret,DeviceProvince,DeviceCity,DeviceAddress,DeviceSetDay")] DeviceManage deviceManage)
        {
            if (ModelState.IsValid)
            {
                _context.Add(deviceManage);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(deviceManage));
        }
Ejemplo n.º 7
0
        public async Task <IActionResult> Create([Bind("ID,AdminUserName,AdminPassword,AdminUserNumber,AdminUserPhone,AdminUserEmail,AdminUserRole")] AdminUser adminUser)
        {
            if (ModelState.IsValid)
            {
                _context.Add(adminUser);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(adminUser));
        }
        public async Task <IActionResult> Create([Bind("ID,UserOrderID,UserPhone,ProductID,ProductNumber")] UserOrder userOrder)
        {
            if (ModelState.IsValid)
            {
                _context.Add(userOrder);
                await _context.SaveChangesAsync();

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