public async Task <IActionResult> Create([Bind("Id,Category_Name,Category_Status")] Category category)
        {
            if (ModelState.IsValid)
            {
                _context.Add(category);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(category));
        }
        public async Task <IActionResult> Create([Bind("Id,Signup_Name,Signup_Email,Signup_Subject,Signup_Massage")] Signup signup)
        {
            if (ModelState.IsValid)
            {
                _context.Add(signup);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(signup));
        }
        public async Task <IActionResult> Create([Bind("Id,Brand_Name,Brand_Status")] Brand brand)
        {
            if (ModelState.IsValid)
            {
                _context.Add(brand);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(brand));
        }
Пример #4
0
        public async Task <IActionResult> Create([Bind("Id,Order_Quantity,Order_Status,ProductId,SignupId")] Order order)
        {
            if (ModelState.IsValid)
            {
                _context.Add(order);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ProductId"] = new SelectList(_context.Set <Product>(), "Id", "Product_Name", order.ProductId);
            ViewData["SignupId"]  = new SelectList(_context.Signup, "Id", "Signup_Email", order.SignupId);
            return(View(order));
        }
        public async Task <IActionResult> Create([Bind("Id,Product_Name,Product_Description,Product_Type,Product_Material,Product_Color,Product_Size,Product_Rating,Product_Price,BrandId,CategoryId")] Product product)
        {
            if (ModelState.IsValid)
            {
                _context.Add(product);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BrandId"]    = new SelectList(_context.Brand, "Id", "Brand_Name", product.BrandId);
            ViewData["CategoryId"] = new SelectList(_context.Category, "Id", "Category_Name", product.CategoryId);
            return(View(product));
        }