public ActionResult DeleteConfirmed(int id)
        {
            centro_custo centro_custo = db.centro_custo.Find(id);

            db.centro_custo.Remove(centro_custo);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "id_centro_custo,codigo,descricao,ativo,sintetico,sin_ativo")] centro_custo centro_custo)
 {
     if (ModelState.IsValid)
     {
         db.Entry(centro_custo).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(centro_custo));
 }
        public ActionResult Create([Bind(Include = "id_centro_custo,codigo,descricao,ativo,sintetico,sin_ativo")] centro_custo centro_custo)
        {
            if (ModelState.IsValid)
            {
                db.centro_custo.Add(centro_custo);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(centro_custo));
        }
        // GET: centro_custo/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            centro_custo centro_custo = db.centro_custo.Find(id);

            if (centro_custo == null)
            {
                return(HttpNotFound());
            }
            return(View(centro_custo));
        }
Пример #5
0
 /// <summary>
 /// Deprecated Method for adding a new object to the centro_custo EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTocentro_custo(centro_custo centro_custo)
 {
     base.AddObject("centro_custo", centro_custo);
 }