示例#1
0
 public void updateFromModel(projet projet)
 {
     this.id = projet.id_projet;
     this.nom = projet.nom;
     this.reference = projet.reference;
     this.id_client = projet.id_client;
 }
示例#2
0
 public ActionResult Editer(ProjetView projetview, int? id)
 {
     if (ModelState.IsValid)
     {
         if (id == null)
         {
             projet projetx = new projet();
             projetx.updateFromModel(projetview);
             cnx.projet.AddObject(projetx);
         }
         else {
             projet projetx = cnx.projet.Where(p => p.id_projet == id).Single();
             projetx.updateFromModel(projetview);
             cnx.ObjectStateManager.ChangeObjectState(projetx, EntityState.Modified);
         }
             cnx.SaveChanges();
             return Json(new { succes = 1 });
     }
     return Json(new { succes = 0, erreurs = ModelState.ListeErreurs() });
 }
示例#3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the projet EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToprojet(projet projet)
 {
     base.AddObject("projet", projet);
 }
示例#4
0
 /// <summary>
 /// Create a new projet object.
 /// </summary>
 /// <param name="id_projet">Initial value of the id_projet property.</param>
 /// <param name="id_client">Initial value of the id_client property.</param>
 public static projet Createprojet(global::System.Int32 id_projet, global::System.Int32 id_client)
 {
     projet projet = new projet();
     projet.id_projet = id_projet;
     projet.id_client = id_client;
     return projet;
 }