示例#1
0
        public async Task <ActionResult> Edit([Bind(Include = "CarId,Name,Year,Color,Avalaible,TimeAssurancy,DelayExchange")] Car car)
        {
            if (ModelState.IsValid)
            {
                db.Entry(car).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(car));
        }
示例#2
0
        public async Task <ActionResult> Edit([Bind(Include = "OrderID,DateOrder,DateDelivery")] Order order)
        {
            if (ModelState.IsValid)
            {
                db.Entry(order).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(order));
        }
示例#3
0
        public async Task <ActionResult> Edit([Bind(Include = "SellerId,DateOfBirth,Lastname,Firstname,Address,Postcode,City,PhoneNumber")] Seller seller)
        {
            if (ModelState.IsValid)
            {
                db.Entry(seller).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(seller));
        }
示例#4
0
        public async Task <ActionResult> Edit([Bind(Include = "ClientId,Lastname,Firstname,Address,Postcode,City,PhoneNumber")] Client client)
        {
            if (ModelState.IsValid)
            {
                db.Entry(client).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(client));
        }
示例#5
0
        public async Task <ActionResult> Edit([Bind(Include = "BrandId,Name,Description")] Brand brand)
        {
            if (ModelState.IsValid)
            {
                db.Entry(brand).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(brand));
        }
示例#6
0
        public async Task <ActionResult> Edit([Bind(Include = "CategoryId,Name,Description,Price,Tva")] Category category, long brandId)
        {
            if (ModelState.IsValid)
            {
                category       = db.DbCategory.Find(category.CategoryId);
                category.Brand = category.Brand = db.DbBrand.Find(brandId);

                //category.Brand = db.DbBrand.Find(brandId);
                //db.DbBrand.Attach(category.Brand);
                //db.DbCategory.Attach(category);
                db.Entry(category).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(category));
        }