コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            tariffs tariffs = db.tariffs.Find(id);

            db.tariffs.Remove(tariffs);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "id,name,minute_number,sms_number,price")] tariffs tariffs)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tariffs).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tariffs));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "id,name,minute_number,sms_number,price")] tariffs tariffs)
        {
            if (ModelState.IsValid)
            {
                db.tariffs.Add(tariffs);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tariffs));
        }
コード例 #4
0
        // GET: Tariffs/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tariffs tariffs = db.tariffs.Find(id);

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