本文整理汇总了C#中Projet.dbProjetE2ProdEntities.SaveChanges方法的典型用法代码示例。如果您正苦于以下问题:C# dbProjetE2ProdEntities.SaveChanges方法的具体用法?C# dbProjetE2ProdEntities.SaveChanges怎么用?C# dbProjetE2ProdEntities.SaveChanges使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Projet.dbProjetE2ProdEntities
的用法示例。
在下文中一共展示了dbProjetE2ProdEntities.SaveChanges方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ajouter
public static void ajouter(Utilisateur u)
{
var db = new dbProjetE2ProdEntities();
var add = new tblUtilisateur();
add.NomUtil = u.NomUtilisateur;
add.MotPasUtil = u.MotDePasse;
add.MotPasExpire = u.Expire;
add.PremiereConex = u.Premiere;
add.DateModifMotPas = u.DateModifMotPas;
add.IdEmp = u.Emp;
add.IdRole = u.Role;
add.Actif = u.UtilActif;
db.tblUtilisateur.Add(add);
try
{
db.SaveChanges();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
示例2: setCompte
public static void setCompte(Utilisateur u)
{
var db = new dbProjetE2ProdEntities();
var i = u.NomUtilisateur;
var r =
(from the in db.tblUtilisateur
where the.NomUtil == i
select the).First();
r.NomUtil = u.NomUtilisateur;
r.MotPasUtil = u.MotDePasse;
r.MotPasExpire = u.Expire;
r.PremiereConex = u.Premiere;
r.IdEmp = u.Emp;
r.IdRole = u.Role;
r.Actif = u.UtilActif;
try
{
db.SaveChanges();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
示例3: addEmploye
public static void addEmploye(Employe settings)
{
var bd = new dbProjetE2ProdEntities();
var ajout = new tblEmploye();
var lstTypeTest = new List<tblTypeTest>();
var tt =
from e in bd.tblTypeTest
select e;
int i = 0;
foreach (tblTypeTest item in tt)
{
foreach (TypeTest ty in settings.lstEmTypeTest)
{
if (item.CodeTypeTest == ty.codeTypeTest)
{
ajout.tblTypeTest.Add(item);
i++;
break;
}
}
if (settings.lstEmTypeTest.Count == i)
break;
}
ajout.IdEmp = settings.idEmp;
ajout.PrenomEmp = settings.prenomEmp;
ajout.NomEmp = settings.nomEmp;
ajout.CourrielEmp = settings.courrielEmp;
ajout.NoTelPrincipal = settings.noTelPrincipal;
ajout.NoTelSecondaire = settings.noTelSecondaire;
ajout.AdressePostale = settings.adressePostale;
ajout.DateEmbaucheEmp = settings.dateEmbaucheEmp;
ajout.CompetenceParticuliere = settings.competenceParticuliere;
ajout.Statut = settings.statut;
ajout.CommentaireEmp = settings.commentaireEmp;
//ajout.tblTypeTest = lstTypeTest;
bd.tblEmploye.Add(ajout);
try
{
bd.SaveChanges();
}
catch (Exception e)
{
Console.WriteLine(e);
MessageBox.Show("Une erreur est survenue lors de l'ajout du nouvel employe", "Erreur système", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
示例4: ajouter
public void ajouter(object o)
{
var ajout = new tblPlateforme();
tblSysExp systemp;
//List<tblPlateforme> lstPlat = new List<tblPlateforme>();
//lstPlat.Add(ajout);
//systemp.tblPlateforme = lstPlat;
ICollection<tblSysExp> lstSysExp = new List<tblSysExp>();
ajout.CodePlateforme = ((plateforme)o).codePlate;
ajout.NomPlateforme = ((plateforme)o).nomPlate;
ajout.CodeCategorie = ((plateforme)o).codeCateg;
ajout.CPU = ((plateforme)o).cpuPlate;
ajout.CarteMere = ((plateforme)o).carteMerePlate;
ajout.RAM = ((plateforme)o).ramPlate;
ajout.Stockage=((plateforme)o).stockage;
ajout.DescPlateforme = ((plateforme)o).descPlate;
ajout.InfoSupPlateforme = ((plateforme)o).infoSupPlate;
var db = new dbProjetE2ProdEntities();
foreach (SystemeExploitation item in ((plateforme)o).lstSysExpPlate)
{
systemp = new tblSysExp();
systemp.CodeSysExp = item.CodeSysExp;
systemp.EditionSysExp = item.editSysExp;
systemp.IdSysExp = item.idSysExp;
systemp.InfoSupSysExp = item.infoSysExp;
systemp.NomSysExp = item.nomSysExp;
systemp.Tag = item.tagSysExp;
systemp.VersionSysExp = item.versionSysExp;
systemp.IdSysExp = item.idSysExp;
ajout.tblSysExp.Add(systemp);
// lstSysExp.Add(systemp);
}
//ajout.tblSysExp = lstSysExp;
db.tblPlateforme.Add(ajout);
//ajout.tblSysExp = lstSysExp;
//RequeteSql.addPlateforme(ajout);
try
{
db.SaveChanges();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
示例5: addEmploye
public static void addEmploye(Employe settings)
{
var bd = new dbProjetE2ProdEntities();
var add = new tblEmploye();
var lstTypeTest = new List<tblTypeTest>();
var tt =
from e in bd.tblTypeTest
select e;
int i = 0;
foreach (tblTypeTest item in tt)
{
foreach (TypeTest ty in settings.lstEmTypeTest)
{
if (item.CodeTypeTest == ty.codeTypeTest)
{
lstTypeTest.Add(item);
i++;
break;
}
}
if (settings.lstEmTypeTest.Count == i)
break;
}
add.IdEmp = settings.idEmp;
add.PrenomEmp = settings.prenomEmp;
add.NomEmp = settings.nomEmp;
add.CourrielEmp = settings.courrielEmp;
add.NoTelPrincipal = settings.noTelPrincipal;
add.NoTelSecondaire = settings.noTelSecondaire;
add.AdressePostale = settings.adressePostale;
add.DateEmbaucheEmp = settings.dateEmbaucheEmp;
add.CompetenceParticuliere = settings.competenceParticuliere;
add.Statut = settings.statut;
add.CommentaireEmp = settings.commentaireEmp;
add.tblTypeTest = lstTypeTest;
bd.tblEmploye.Add(add);
try
{
bd.SaveChanges();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
示例6: addPlateforme
public static void addPlateforme(tblPlateforme p)
{
var db = new dbProjetE2ProdEntities();
foreach (tblSysExp tblSysExpTemp in p.tblSysExp)
{
db.tblPlateforme.Add(p);
try
{
db.SaveChanges();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
示例7: addJeu
//static public void setJeu(Jeu jeu)
//{
// var db = new dbProjetE2ProdEntities();
// var r =
// (from j in db.tblJeu
// where j.IdJeu == jeu.idJeu
// select j).First();
// r.NomJeu = jeu.nomJeu;
// r.DescJeu = jeu.descJeu;
// r.Actif = jeu.actif;
// r.InfoSupJeu = jeu.infoSupJeu;
// r.CoteESRB = jeu.coteESRB;
// r.IdGenre = jeu.idGenre;
// r.IdMode = jeu.idMode;
// //Manque le lien aux thèmes
// try
// {
// db.SaveChanges();
// }
// catch (Exception e)
// {
// Console.WriteLine(e);
// }
//}
public static void addJeu(tblJeu p)
{
var db = new dbProjetE2ProdEntities();
foreach (tblTheme tblThemeTemp in p.tblTheme)
{
db.tblJeu.Add(p);
try
{
db.SaveChanges();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
示例8: addGenre
public static void addGenre(Genre genre)
{
var db = new dbProjetE2ProdEntities();
var add = new tblGenre();
add.NomGenre = genre.nomGenre;
add.ComGenre = genre.comGenre;
db.tblGenre.Add(add);
try
{
db.SaveChanges();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
示例9: addMode
public static void addMode(Mode mode)
{
var db = new dbProjetE2ProdEntities();
var add = new tblMode();
add.NomMode = mode.nomMode;
add.DescMode = mode.descMode;
db.tblMode.Add(add);
try
{
db.SaveChanges();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
示例10: addClassification
public static void addClassification(Classification classification)
{
var db = new dbProjetE2ProdEntities();
var add = new tblClassification();
add.CoteESRB = classification.coteESRB;
add.NomESRB = classification.nomESRB;
add.DescESRB = classification.descESRB;
db.tblClassification.Add(add);
try
{
db.SaveChanges();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
示例11: addCateg
public static void addCateg(Categorie settings)
{
var db = new dbProjetE2ProdEntities();
var add = new tblCategorie();
add.CodeCategorie = settings.codeCateg;
add.ComCategorie = settings.comCateg;
add.DescCategorie = settings.descCateg;
db.tblCategorie.Add(add);
try
{
db.SaveChanges();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
示例12: setClassification
public static void setClassification(Classification classification)
{
var db = new dbProjetE2ProdEntities();
var r =
(from classif in db.tblClassification
where classif.CoteESRB == classification.coteESRB
select classif).First();
r.NomESRB = classification.nomESRB;
r.DescESRB = classification.descESRB;
try
{
db.SaveChanges();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
示例13: deleteEmploye
public static void deleteEmploye(int cle)
{
var bd = new dbProjetE2ProdEntities();
var i = cle;
var r =
(from e in bd.tblEmploye
where e.IdEmp == i
select e).First();
r.Statut = "n";
try
{
bd.SaveChanges();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
示例14: ChangerMDP
public static bool ChangerMDP(Utilisateur u,string NouvMDP)
{
var db = new dbProjetE2ProdEntities();
var r = (from the in db.tblUtilisateur
where the.NomUtil == u.NomUtilisateur
select the).First();
r.MotPasUtil = NouvMDP;
r.PremiereConex = "n";
r.MotPasExpire = "n";
r.DateModifMotPas = DateTime.Now;
try
{
db.SaveChanges();
}
catch (Exception e)
{
return false;
}
return true;
}
示例15: deleteClassification
public static void deleteClassification(string coteESRB)
{
var db = new dbProjetE2ProdEntities();
var r =
from classif in db.tblClassification
where classif.CoteESRB == coteESRB
select classif;
foreach (var item in r)
{
db.tblClassification.Remove(item);
}
try
{
db.SaveChanges();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}