private void InitializeSociete(DeclarationContext context) { var societe = new TSociete { Adresse = string.Empty, CodeBureau = "00", CodePostal = "3000", CurrentExerciceNo = 1, MatriculFiscal = "00000000", NumeroEmployeur = "12345678", CleEmployeur = "00", RaisonSocial = "TVS", Pays = "Tunisie", Ville = "Tunis", Activite = "Activité", MatriculCategorie = "M", MatriculCle = "C", MatriculEtablissement = "000", MatriculCodeTva = "E", //RibSociete = string.Empty }; try { context.Societes.Add(societe); context.SaveChanges(); } catch (DbEntityValidationException e) { var newException = new FormattedDbEntityValidationException(e); throw newException; } }
private void InitializeExercice(DeclarationContext context) { var exercice = new TExercice { Annee = "2016", IsArchive = false, IsCloturer = false, }; try { context.Exercices.Add(exercice); context.SaveChanges(); } catch (DbEntityValidationException e) { var newException = new FormattedDbEntityValidationException(e); throw newException; } }