Пример #1
0
        public async Task <IActionResult> Create([Bind("CusId,CusName,CusPhone,CusEmail,CusAddress,CusPostalCode")] Customer customer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customer);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(customer));
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("ProdId,ProdType,ProdSize,ProdMaterial,ProdQuantity,ProductBriefDescription")] Product product)
        {
            if (ModelState.IsValid)
            {
                _context.Add(product);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(product));
        }
Пример #3
0
        public async Task <IActionResult> Create([Bind("EmpId,EmpName,EmpPhone,EmpEmail,EmpAddress,EmpPostalCode")] Employee employee)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employee);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(employee));
        }
Пример #4
0
        public async Task <IActionResult> Create([Bind("PaymentId,CreditCardId")] Payment payment)
        {
            if (ModelState.IsValid)
            {
                _context.Add(payment);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CreditCardId"] = new SelectList(_context.CreditCard, "CreditCardId", "CreditCardId", payment.CreditCardId);
            return(View(payment));
        }
        public async Task <IActionResult> Create([Bind("EmployeeLoginId,EmpId,Pass")] EmployeeLogin employeeLogin)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employeeLogin);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmpId"] = new SelectList(_context.Employee, "EmpId", "EmpId", employeeLogin.EmpId);
            return(View(employeeLogin));
        }
Пример #6
0
        public async Task <IActionResult> Create([Bind("CreditCardId,CusId,CreditCardNumber,CreditCardProvider,CreditCardHolderName,CreditCardSecurityCode")] CreditCard creditCard)
        {
            if (ModelState.IsValid)
            {
                _context.Add(creditCard);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CusId"] = new SelectList(_context.Customer, "CusId", "CusId", creditCard.CusId);
            return(View(creditCard));
        }
Пример #7
0
        public async Task <IActionResult> Create([Bind("OrderId,PaymentId,EmpId,ProdId,StatusUpdate")] Orders orders)
        {
            if (ModelState.IsValid)
            {
                _context.Add(orders);
                await _context.SaveChangesAsync();

                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));
        }