Exemple #1
0
 public static int InsertEmployee(Personeelslid pl)
 {
     using (var FinalDBEntities = new FinalDBEntities())
     {
         FinalDBEntities.Personeelslids.Add(pl);
         if (0 < FinalDBEntities.SaveChanges())
         {
             return(pl.PersoneelslidID);
         }
     }
     return(0);
 }
Exemple #2
0
        public static int DeleteEmployee(Personeelslid EmployeeDelete)
        {
            using (var FinalDBEntities = new FinalDBEntities())
            {
                var query = from Personeelslid in FinalDBEntities.Personeelslids
                            where Personeelslid.PersoneelslidID == EmployeeDelete.PersoneelslidID
                            select Personeelslid;
                Personeelslid personeelslid = query.FirstOrDefault();
                FinalDBEntities.Personeelslids.Remove(personeelslid);

                return(FinalDBEntities.SaveChanges());
            }
        }