Ejemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("UserId,UserName,MobileNumber,Address,Email,Password")] Users users)
        {
            if (ModelState.IsValid)
            {
                _context.Add(users);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(users));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("ShipmentId,DateStamp")] Shipments shipments)
        {
            if (ModelState.IsValid)
            {
                _context.Add(shipments);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(shipments));
        }
        public async Task <IActionResult> Create([Bind("OrderNumber,OrderId,SellerId,Quantity,TotalPrice,Tax,DateStamp,Freight")] OrderDetails orderDetails)
        {
            if (ModelState.IsValid)
            {
                _context.Add(orderDetails);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(orderDetails));
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> Create([Bind("PaymentId,UserId,ModeOfPayment,DateStamp,Amount")] Payments payments)
        {
            if (ModelState.IsValid)
            {
                _context.Add(payments);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(payments));
        }
Ejemplo n.º 5
0
        public async Task <IActionResult> Create([Bind("AccountNumber,SellerId,BankName,IFSC,MobileNumber")] SellerAccounts sellerAccounts)
        {
            if (ModelState.IsValid)
            {
                _context.Add(sellerAccounts);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(sellerAccounts));
        }
Ejemplo n.º 6
0
        public async Task <IActionResult> Create([Bind("CategoryId,Description,CategoryName")] Categories categories)
        {
            if (ModelState.IsValid)
            {
                _context.Add(categories);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(categories));
        }
Ejemplo n.º 7
0
        public async Task <IActionResult> Create([Bind("SellerId,SellerName,MobileNumber,Address,Email,GSTNumber,AccountNumber")] Sellers sellers)
        {
            if (ModelState.IsValid)
            {
                _context.Add(sellers);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AccountNumber"] = new SelectList(_context.SellerAccounts, "AccountNumber", "BankName", sellers.AccountNumber);
            return(View(sellers));
        }
Ejemplo n.º 8
0
        public async Task <IActionResult> Create([Bind("ProductId,SellerId,ProductName,MRP,SellingPrice,Discount,Vendor,CategoryId,Description")] Products products)
        {
            if (ModelState.IsValid)
            {
                _context.Add(products);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CategoryId"] = new SelectList(_context.Categories, "CategoryId", "CategoryName", products.CategoryId);
            ViewData["SellerId"]   = new SelectList(_context.Sellers, "SellerId", "Address", products.SellerId);
            return(View(products));
        }
Ejemplo n.º 9
0
        public async Task <IActionResult> Create([Bind("OrderId,ProductId,SellerId,UserId,OrderNumber,ShipmentId,PaymentId,DateStamp,EstimatedDeliveryDate")] Orders orders)
        {
            if (ModelState.IsValid)
            {
                _context.Add(orders);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["OrderNumber"] = new SelectList(_context.OrderDetails, "OrderNumber", "OrderNumber", orders.OrderNumber);
            ViewData["PaymentId"]   = new SelectList(_context.Payments, "PaymentId", "ModeOfPayment", orders.PaymentId);
            ViewData["ProductId"]   = new SelectList(_context.Products, "ProductId", "Description", orders.ProductId);
            ViewData["ShipmentId"]  = new SelectList(_context.Shipments, "ShipmentId", "ShipmentId", orders.ShipmentId);
            ViewData["UserId"]      = new SelectList(_context.Users, "UserId", "Address", orders.UserId);
            return(View(orders));
        }