Пример #1
0
 public void DeleteEmployeeInfo(Employee Entities)
 {
     using (var context = new WorkScheduleDBContext())
     {
         var existingvalue = context.Employees.Find(Entities.EmployeeID);
         context.Employees.Remove(existingvalue);
         context.SaveChanges();
     }
 }
Пример #2
0
 public void UpdateEmployeeInfo(Employee Entities)
 {
     using (var context = new WorkScheduleDBContext())
     {
         var updating = context.Employees.Attach(Entities);
         var matchingWithExistingValues = context.Entry <Employee>(updating);
         matchingWithExistingValues.State = System.Data.Entity.EntityState.Modified;
         context.SaveChanges();
     }
 }
Пример #3
0
 public void AddEmployeeInfo(Employee Entities)
 {
     using (var context = new WorkScheduleDBContext())
     { var adding = context.Employees.Add(Entities); context.SaveChanges(); }
 }
Пример #4
0
 public void AddLocationInfo(Location Entities)
 {
     using (var context = new WorkScheduleDBContext())
     { var adding = context.Locations.Add(Entities); context.SaveChanges(); }
 }