Beispiel #1
0
 public JsonResult delete(Tarefa data)
 {
     Tarefa emp = db.tarefa.Find(data.cod_project);
     db.tarefa.Remove(emp);
     db.SaveChanges();
     return null;
 }
Beispiel #2
0
        public JsonResult save(Tarefa data)
        {
            //O cod_member chega null, vamos resolver isso
               data.cod_member = db.member.Find(data.memberCod);

            //O cod_project chega null, vamos resolver isso
               data.cod_project = db.project.Find(data.trabalhoCod);

            db.tarefa.Add(data);
            db.SaveChanges();

            return null;
        }
Beispiel #3
0
        /*  public JsonResult getListProject(List<Tarefa> t)
        {
            db.Configuration.ProxyCreationEnabled = false; //Para não dar erro de circular reference

            var emp = new List<Project>();

            foreach(var e in t)
            {
                emp.Add(e.cod_project);
            }

            return Json(emp, JsonRequestBehavior.AllowGet);
        }
        */
        public JsonResult update(Tarefa emp)
        {
            db.Entry(emp).State = EntityState.Modified;
            db.SaveChanges();
            return null;
        }