public async Task <ActionResult> Create([Bind(Include = "Id,Name,BasePrice,Dictionnary")] ProductType productType)
        {
            if (ModelState.IsValid)
            {
                db.ProductTypes.Add(productType);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(productType));
        }
        public async Task <ActionResult> Create([Bind(Include = "Id,StockEnterAt,StockSelledAt,Dictionnary")] Product product)
        {
            if (ModelState.IsValid)
            {
                db.Products.Add(product);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(product));
        }
        public async Task <ActionResult> Create([Bind(Include = "Id,OrderDate,IsValidated")] Order order)
        {
            if (ModelState.IsValid)
            {
                db.Orders.Add(order);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(order));
        }
Example #4
0
        public async Task <ActionResult> Create([Bind(Include = "Id,Login,Password,Firstname,Lastname,Email,DateOfBirth")] Seller seller)
        {
            if (ModelState.IsValid)
            {
                db.Sellers.Add(seller);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(seller));
        }
        public async Task <ActionResult> Create([Bind(Include = "Id,Name")] Category category)
        {
            if (ModelState.IsValid)
            {
                db.Categories.Add(category);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(category));
        }
Example #6
0
        public async Task <ActionResult> Create([Bind(Include = "Id,Money,Firstname,Lastname,Email,DateOfBirth")] Buyer buyer)
        {
            if (ModelState.IsValid)
            {
                db.Buyers.Add(buyer);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(buyer));
        }