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

            db.HfedProviders.Remove(hfedProvider);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "Id,Name,Address,MainPhone,Fax,Email,ContactName,ContactEmail,ContactPhone,BoxWeight,ProviderNote")] HfedProvider hfedProvider)
 {
     if (ModelState.IsValid)
     {
         db.Entry(hfedProvider).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(hfedProvider));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "Id,Name,Address,MainPhone,Fax,Email,ContactName,ContactEmail,ContactPhone,BoxWeight,ProviderNote")] HfedProvider hfedProvider)
        {
            if (ModelState.IsValid)
            {
                db.HfedProviders.Add(hfedProvider);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

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

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