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));
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 5
0
        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));
        }
Ejemplo n.º 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));
        }