public async Task <IActionResult> Edit(int id, [Bind("Id,Quantity,Discount,Customer_DetailId,Product_DetailId")] Order_Detail order_Detail)
        {
            if (id != order_Detail.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(order_Detail);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!Order_DetailExists(order_Detail.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                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));
        }
Esempio n. 2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Brand_Name,Brand_Branch_Location,Brand_Email")] Brand_Detail brand_Detail)
        {
            if (id != brand_Detail.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(brand_Detail);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!Brand_DetailExists(brand_Detail.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(brand_Detail));
        }
Esempio n. 3
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Product_Name,Price,Brand_DetailId,Category_DetailId")] Product_Detail product_Detail)
        {
            if (id != product_Detail.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(product_Detail);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!Product_DetailExists(product_Detail.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                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));
        }
Esempio n. 4
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Product,Category_Type")] Category_Detail category_Detail)
        {
            if (id != category_Detail.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(category_Detail);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!Category_DetailExists(category_Detail.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(category_Detail));
        }
Esempio n. 5
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Customer_Name,Email,Phone,Delivery_Address")] Customer_Detail customer_Detail)
        {
            if (id != customer_Detail.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(customer_Detail);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!Customer_DetailExists(customer_Detail.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(customer_Detail));
        }