public static void Delete(Employee employee) { var context = new SoftUniEntities(); context.Employees.Remove(employee); context.SaveChanges(); }
public static void Add(Employee emlpoyee) { var context = new SoftUniEntities(); context.Employees.Add(emlpoyee); context.SaveChanges(); }
public static void Add(string firstName, string lastName, string jobTitle, string department, DateTime hireDate, int salary) { var db = new SoftUniEntities(); var depName = db.Departments.First(d => d.Name == department.ToString()); var employee = new Employee() { FirstName = firstName, LastName = lastName, JobTitle = jobTitle, DepartmentID = depName.DepartmentID, HireDate = hireDate, Salary = salary }; db.Employees.Add(employee); db.SaveChanges(); }
public static void Modify(Employee employee) { var context = new SoftUniEntities(); }