Пример #1
0
        public static void Delete(Employee employee)
        {
            var context = new SoftUniEntities();

            context.Employees.Remove(employee);
            context.SaveChanges();
        }
Пример #2
0
        public static void Add(Employee emlpoyee)
        {
            var context = new SoftUniEntities();

            context.Employees.Add(emlpoyee);
            context.SaveChanges();
        }
Пример #3
0
        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();
        }
Пример #4
0
 public static void Modify(Employee employee)
 {
     var context = new SoftUniEntities();
 }