public async Task <ActionResult> Create([Bind(Include = "OrderID,DateOrder,DateDelivery")] Order order) { if (ModelState.IsValid) { db.Orders.Add(order); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(order)); }
public async Task <ActionResult> Create([Bind(Include = "SellerId,DateOfBirth,Lastname,Firstname,Address,Postcode,City,PhoneNumber")] 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 = "CategoryId,Name,Description,Price,Tva")] Category category) { if (ModelState.IsValid) { db.DbCategory.Add(category); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(category)); }
public async Task <ActionResult> Create([Bind(Include = "ClientId,Lastname,Firstname,Address,Postcode,City,PhoneNumber")] Client client) { if (ModelState.IsValid) { db.Clients.Add(client); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(client)); }
public async Task <ActionResult> Create([Bind(Include = "BrandId,Name,Description")] Brand brand) { if (ModelState.IsValid) { db.DbBrand.Add(brand); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(brand)); }
public async Task <ActionResult> Create([Bind(Include = "CarId,Name,Year,Color,Avalaible,TimeAssurancy,DelayExchange")] Car car, long categoryId) { if (ModelState.IsValid) { car.Category = db.DbCategory.Find(categoryId); db.DbCar.Add(car); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(car)); }