예제 #1
0
 public ActionResult Edit([Bind(Include = "Id,CityName,ShippingFee")] CityShippingFee cityShippingFee)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cityShippingFee).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(cityShippingFee));
 }
예제 #2
0
        public ActionResult Create([Bind(Include = "Id,CityName,ShippingFee")] CityShippingFee cityShippingFee)
        {
            if (ModelState.IsValid)
            {
                db.CityShippingFees.Add(cityShippingFee);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(cityShippingFee));
        }
예제 #3
0
        // GET: ADMIN/CityShippingFees/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CityShippingFee cityShippingFee = db.CityShippingFees.Find(id);

            if (cityShippingFee == null)
            {
                return(HttpNotFound());
            }
            return(View(cityShippingFee));
        }