예제 #1
0
 public ActionResult Edit([Bind(Include = "contractTypeid,contract_Type_code,contract_type_name,contract_type_description")] contract_type contract_type)
 {
     if (ModelState.IsValid)
     {
         db.Entry(contract_type).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(contract_type));
 }
예제 #2
0
        public ActionResult Create([Bind(Include = "contractTypeid,contract_Type_code,contract_type_name,contract_type_description")] contract_type contract_type)
        {
            if (ModelState.IsValid)
            {
                db.contract_type.Add(contract_type);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(contract_type));
        }
예제 #3
0
        // GET: /contracttype/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            contract_type contract_type = db.contract_type.Find(id);

            if (contract_type == null)
            {
                return(HttpNotFound());
            }
            return(View(contract_type));
        }
예제 #4
0
 public ActionResult DeleteConfirmed(int id)
 {
     try
     {
         contract_type contract_type = db.contract_type.Find(id);
         db.contract_type.Remove(contract_type);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch (Exception ex)
     {
         return(View(ex));
     }
 }