コード例 #1
0
        public ActionResult Create(TarefaGrupo tarefagrupo)
        {
            if (ModelState.IsValid)
            {
                db.TarefaGrupo.AddObject(tarefagrupo);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(tarefagrupo);
        }
コード例 #2
0
        public ActionResult Edit(TarefaGrupo tarefa)
        {
            if (ModelState.IsValid)
            {
                db.TarefaGrupo.Attach(tarefa);
                db.ObjectStateManager.ChangeObjectState(tarefa, EntityState.Modified);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(tarefa);
        }
コード例 #3
0
        public JsonResult NovoGrupo()
        {
            TarefaGrupo tg = new TarefaGrupo();
            tg.Id = int.Parse(Request.Form["Id"]);
            tg.Nome = Request.Form["NomeGrupo"];
            db.TarefaGrupo.AddObject(tg);
            db.ObjectStateManager.ChangeObjectState(tg, EntityState.Added);
            db.SaveChanges();

            return Json("ok", JsonRequestBehavior.AllowGet);
        }
コード例 #4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the TarefaGrupo EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToTarefaGrupo(TarefaGrupo tarefaGrupo)
 {
     base.AddObject("TarefaGrupo", tarefaGrupo);
 }
コード例 #5
0
 /// <summary>
 /// Create a new TarefaGrupo object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 public static TarefaGrupo CreateTarefaGrupo(global::System.Int32 id)
 {
     TarefaGrupo tarefaGrupo = new TarefaGrupo();
     tarefaGrupo.Id = id;
     return tarefaGrupo;
 }