Exemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("Id,Brand_Name,Brand_Branch_Location,Brand_Email")] Brand_Detail brand_Detail)
        {
            if (ModelState.IsValid)
            {
                _context.Add(brand_Detail);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(brand_Detail));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Id,Product,Category_Type")] Category_Detail category_Detail)
        {
            if (ModelState.IsValid)
            {
                _context.Add(category_Detail);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(category_Detail));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("Id,Customer_Name,Email,Phone,Delivery_Address")] Customer_Detail customer_Detail)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customer_Detail);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(customer_Detail));
        }
        public async Task <IActionResult> Create([Bind("Id,Quantity,Discount,Customer_DetailId,Product_DetailId")] Order_Detail order_Detail)
        {
            if (ModelState.IsValid)
            {
                _context.Add(order_Detail);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Customer_DetailId"] = new SelectList(_context.Customer_Detail, "Id", "Customer_Name", order_Detail.Customer_DetailId);
            ViewData["Product_DetailId"]  = new SelectList(_context.Product_Detail, "Id", "Product_Name", order_Detail.Product_DetailId);
            return(View(order_Detail));
        }
Exemplo n.º 5
0
        public async Task <IActionResult> Create([Bind("Id,Product_Name,Price,Brand_DetailId,Category_DetailId")] Product_Detail product_Detail)
        {
            if (ModelState.IsValid)
            {
                _context.Add(product_Detail);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Brand_DetailId"]    = new SelectList(_context.Brand_Detail, "Id", "Brand_Name", product_Detail.Brand_DetailId);
            ViewData["Category_DetailId"] = new SelectList(_context.Category_Detail, "Id", "Product", product_Detail.Category_DetailId);
            return(View(product_Detail));
        }