public ActionResult togTache([Bind(Include = "CdTache, Statut")] TacheCandidat tache) { TacheCandidat tc = db.TacheCandidat.Find(tache.CdTache); if (ModelState.IsValid) { tc.Statut = tache.Statut; db.SaveChanges(); return(Json(new { success = true, statut = tc.Statut }, JsonRequestBehavior.AllowGet)); } return(Json(new { success = false, responseText = "model invalid" }, JsonRequestBehavior.AllowGet)); }
public ActionResult ajouterTache( [Bind(Include = "CdCandidat, CdReceveur, DtAction, Details")] TacheCandidat tache) { tache.DtEnvoi = DateTime.Now; tache.Statut = false; tache.CdCreateur = User.Identity.GetUserId(); if (ModelState.IsValid) { db.TacheCandidat.Add(tache); db.SaveChanges(); return(Json(new { success = true }, JsonRequestBehavior.AllowGet)); } return(Json(new { success = false, responseText = "model invalid" }, JsonRequestBehavior.AllowGet)); }