Ejemplo 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;
            GetEditableEmployees().Add(editEmployee);
        }
Ejemplo 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;
        }
Ejemplo n.º 3
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;
     GetEditableEmployees().Add(editEmployee);
 }
Ejemplo n.º 4
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;
        }
 public ActionResult DataBindingApplyChanges(EditableEmployee employee)
 {
     NorthwindDataProvider.UpdateEditableEmployee(employee);
     return DemoView("DataBinding", NorthwindDataProvider.GetEditableEmployeeByID(employee.EmployeeID));
 }
 public ActionResult DataBindingApplyChanges(EditableEmployee employee)
 {
     NorthwindDataProvider.UpdateEditableEmployee(employee);
     return(DemoView("DataBinding", NorthwindDataProvider.GetEditableEmployeeByID(employee.EmployeeID)));
 }