예제 #1
0
 public ActionResult Edit([Bind(Include = "ID,VehicleAdvertisementNextRefNo")] ConfigSetting configSetting)
 {
     if (ModelState.IsValid)
     {
         db.Entry(configSetting).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(configSetting));
 }
 public ActionResult Edit([Bind(Include = "ID,VehicleModel1")] VehicleModel vehicleModel)
 {
     if (ModelState.IsValid)
     {
         db.Entry(vehicleModel).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(vehicleModel));
 }
예제 #3
0
 public ActionResult Edit([Bind(Include = "ID,Name,ContactPhone,ContactMobile,ContactEMail,PickupAddress,PostCode")] Seller seller)
 {
     if (ModelState.IsValid)
     {
         db.Entry(seller).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(seller));
 }
예제 #4
0
 public ActionResult Edit([Bind(Include = "ID,BodyDescription,ImageURL")] VehicleBody vehicleBody)
 {
     if (ModelState.IsValid)
     {
         db.Entry(vehicleBody).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(vehicleBody));
 }
 public ActionResult Edit([Bind(Include = "ID,Description")] ViewPort viewPort)
 {
     if (ModelState.IsValid)
     {
         db.Entry(viewPort).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ID = new SelectList(db.ViewPortSettings, "ID", "SettingCode", viewPort.ID);
     return(View(viewPort));
 }
예제 #6
0
 public ActionResult Edit([Bind(Include = "ID,VehicleID,SellerID")] VehicleSeller vehicleSeller)
 {
     if (ModelState.IsValid)
     {
         db.Entry(vehicleSeller).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.SellerID  = new SelectList(db.Sellers, "ID", "Name", vehicleSeller.SellerID);
     ViewBag.VehicleID = new SelectList(db.VehicleAdvertisements, "Reference_ID", "Title", vehicleSeller.VehicleID);
     return(View(vehicleSeller));
 }
        public IHttpActionResult PutVehicleAdvertisement(int id, CarSalesVehicleAdvertisement carSalesVehicleAdvertisement)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != carSalesVehicleAdvertisement.Reference_ID)
            {
                return(BadRequest());
            }

            VehicleAdvertisement vehicleAdvertisement = new VehicleAdvertisement()
            {
                AudoMeter      = carSalesVehicleAdvertisement.AudoMeter,
                BodyType       = carSalesVehicleAdvertisement.BodyType,
                Description    = carSalesVehicleAdvertisement.Description,
                EngineCapacity = carSalesVehicleAdvertisement.EngineCapacity,
                Feature        = carSalesVehicleAdvertisement.Feature,
                Fuel           = carSalesVehicleAdvertisement.Fuel,
                IsFeatured     = carSalesVehicleAdvertisement.IsFeatured,
                Make           = carSalesVehicleAdvertisement.Make,
                Model          = carSalesVehicleAdvertisement.Make,
                Price          = carSalesVehicleAdvertisement.Price,
                Reference_ID   = carSalesVehicleAdvertisement.Reference_ID,
                Reference_No   = carSalesVehicleAdvertisement.Reference_No,
                Spects         = carSalesVehicleAdvertisement.Spects,
                Title          = carSalesVehicleAdvertisement.Title,
                Transmission   = carSalesVehicleAdvertisement.Transmission
            };

            db.Entry(vehicleAdvertisement).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!VehicleAdvertisementExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
예제 #8
0
        public IHttpActionResult PutVehicleModel(int id, CarSalesVehicleModel carSalesVehicleModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != carSalesVehicleModel.ID)
            {
                return(BadRequest());
            }

            VehicleModel vehicleModel = new VehicleModel()
            {
                ID            = carSalesVehicleModel.ID,
                VehicleMakeID = carSalesVehicleModel.VehicleMakeID,
                VehicleModel1 = carSalesVehicleModel.VehicleModel1
            };


            db.Entry(vehicleModel).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!VehicleModelExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult PutVehicleBody(int id, CarSalesVehicleBody carSalesVehicleBody)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != carSalesVehicleBody.ID)
            {
                return(BadRequest());
            }

            VehicleBody vehicleBody = new VehicleBody()
            {
                ID = carSalesVehicleBody.ID,
                BodyDescription = carSalesVehicleBody.BodyDescription,
                ImageURL        = carSalesVehicleBody.ImageURL
            };

            db.Entry(vehicleBody).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!VehicleBodyExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
예제 #10
0
        public IHttpActionResult PutViewPortSetting(int id, CarSalesViewPortSetting carSalesViewPortSetting)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != carSalesViewPortSetting.ID)
            {
                return(BadRequest());
            }
            ViewPortSetting ViewPortSetting = new ViewPortSetting();

            ViewPortSetting.ID          = carSalesViewPortSetting.ID;
            ViewPortSetting.PageSize    = carSalesViewPortSetting.PageSize;
            ViewPortSetting.SettingCode = carSalesViewPortSetting.SettingCode;
            ViewPortSetting.ViewPortID  = carSalesViewPortSetting.ViewPortID;

            db.Entry(ViewPortSetting).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ViewPortSettingExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public ActionResult SellerRegisterEdit(SellerRegisterModel SellerRegisterModel)
        {
            CarSalesDBEntities db     = new CarSalesDBEntities();
            Seller             seller = db.Sellers.Find(SellerRegisterModel.ID);

            if (seller == null)
            {
                return(HttpNotFound());
            }
            else
            {
                seller.Name            = SellerRegisterModel.Name;
                seller.ContactEMail    = SellerRegisterModel.ContactEMail;
                seller.ContactMobile   = SellerRegisterModel.ContactMobile;
                seller.ContactPhone    = SellerRegisterModel.ContactPhone;
                seller.PickupAddress   = SellerRegisterModel.PickupAddress;
                seller.PostCode        = SellerRegisterModel.PostCode;
                db.Entry(seller).State = EntityState.Modified;
                db.SaveChanges();

                return(RedirectToAction("SellerRegisterDetail", "Account", new { ID = seller.ID }));
            }
        }
예제 #12
0
        public IHttpActionResult PutConfigSetting(int id, CarSalesConfigSetting carSalesConfigSetting)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != carSalesConfigSetting.ID)
            {
                return(BadRequest());
            }
            ConfigSetting configSetting = new ConfigSetting();

            configSetting.ID = carSalesConfigSetting.ID;
            configSetting.VehicleAdvertisementNextRefNo = carSalesConfigSetting.VehicleAdvertisementNextRefNo;

            db.Entry(configSetting).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ConfigSettingExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
예제 #13
0
        public IHttpActionResult PutViewPort(int id, CarSalesViewPort carSalesViewPort)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != carSalesViewPort.ID)
            {
                return(BadRequest());
            }
            ViewPort ViewPort = new ViewPort();

            ViewPort.ID          = carSalesViewPort.ID;
            ViewPort.Description = carSalesViewPort.Description;

            db.Entry(ViewPort).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ViewPortExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }