Esempio n. 1
0
        public static void InsertEditableEmployee(EditableEmployee employee)
        {
            EditableEmployee editEmployee = new EditableEmployee();

            editEmployee.EmployeeID = GetNewEditableEmployeeID();
            editEmployee.FirstName  = employee.FirstName;
            editEmployee.LastName   = employee.LastName;
            editEmployee.BirthDate  = employee.BirthDate;
            editEmployee.HireDate   = employee.HireDate;
            editEmployee.Title      = employee.Title;
            editEmployee.Notes      = employee.Notes;
            editEmployee.ReportsTo  = employee.ReportsTo;
            editEmployee.Photo      = employee.Photo;
            GetEditableEmployees().Add(editEmployee);
        }
Esempio n. 2
0
        public static void UpdateEditableEmployee(EditableEmployee employee)
        {
            var editableEmployee = GetEditableEmployees().Where(e => e.EmployeeID == employee.EmployeeID).SingleOrDefault();

            if (editableEmployee == null)
            {
                return;
            }
            editableEmployee.FirstName = employee.FirstName;
            editableEmployee.LastName  = employee.LastName;
            editableEmployee.Title     = employee.Title;
            editableEmployee.BirthDate = employee.BirthDate;
            editableEmployee.HireDate  = employee.HireDate;
            editableEmployee.Notes     = employee.Notes;
            editableEmployee.ReportsTo = employee.ReportsTo;
            editableEmployee.HomePhone = employee.HomePhone;
            editableEmployee.Photo     = employee.Photo;
        }