public async Task <IActionResult> Edit(decimal id, [Bind("EmployeeLoginId,EmpId,Pass")] EmployeeLogin employeeLogin)
        {
            if (id != employeeLogin.EmployeeLoginId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(employeeLogin);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EmployeeLoginExists(employeeLogin.EmployeeLoginId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmpId"] = new SelectList(_context.Employee, "EmpId", "EmpId", employeeLogin.EmpId);
            return(View(employeeLogin));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Edit(decimal id, [Bind("PaymentId,CreditCardId")] Payment payment)
        {
            if (id != payment.PaymentId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(payment);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PaymentExists(payment.PaymentId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CreditCardId"] = new SelectList(_context.CreditCard, "CreditCardId", "CreditCardId", payment.CreditCardId);
            return(View(payment));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Edit(decimal id, [Bind("CreditCardId,CusId,CreditCardNumber,CreditCardProvider,CreditCardHolderName,CreditCardSecurityCode")] CreditCard creditCard)
        {
            if (id != creditCard.CreditCardId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(creditCard);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CreditCardExists(creditCard.CreditCardId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CusId"] = new SelectList(_context.Customer, "CusId", "CusId", creditCard.CusId);
            return(View(creditCard));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Edit(decimal id, [Bind("OrderId,PaymentId,EmpId,ProdId,StatusUpdate")] Orders orders)
        {
            if (id != orders.OrderId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(orders);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OrdersExists(orders.OrderId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmpId"]     = new SelectList(_context.Employee, "EmpId", "EmpId", orders.EmpId);
            ViewData["PaymentId"] = new SelectList(_context.Payment, "PaymentId", "PaymentId", orders.PaymentId);
            ViewData["ProdId"]    = new SelectList(_context.Product, "ProdId", "ProdId", orders.ProdId);
            return(View(orders));
        }
Exemplo n.º 5
0
        public async Task <IActionResult> Edit(decimal id, [Bind("CusId,CusName,CusPhone,CusEmail,CusAddress,CusPostalCode")] Customer customer)
        {
            if (id != customer.CusId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(customer);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CustomerExists(customer.CusId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(customer));
        }
Exemplo n.º 6
0
        public async Task <IActionResult> Edit(decimal id, [Bind("ProdId,ProdType,ProdSize,ProdMaterial,ProdQuantity,ProductBriefDescription")] Product product)
        {
            if (id != product.ProdId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(product);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProductExists(product.ProdId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(product));
        }
Exemplo n.º 7
0
        public async Task <IActionResult> Edit(decimal id, [Bind("EmpId,EmpName,EmpPhone,EmpEmail,EmpAddress,EmpPostalCode")] Employee employee)
        {
            if (id != employee.EmpId)
            {
                return(NotFound());
            }

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