public void TestAjouterArticle() { using (var ctx = new GSMDBEntities()) { Article art = new Article(); art.Désignation = "05 55 26 33 20"; art.Type = "Puce Oooredoo"; ctx.Articles.Add(art); int affectedRecords = ctx.SaveChanges(); Assert.IsTrue(affectedRecords > 0); } }
public static GSMEF.Article ConvertFromDTO(ArticleDTO data) { GSMEF.Article A = new GSMEF.Article() { Id = data.Id, Désignation = data.Désignation, Type = data.Type, Observations = data.Observations }; foreach(VenteDTO a in data.VentesDto) { A.Ventes.Add(Vente.ConvertFromDTO(a)); } return A; }