Пример #1
0
 //should return a compound object with the list as a property, and any errors as another as per pattern
 public Employee[] GetAllEmloyees()
 {
     IList<Employee> result = new List<Employee>();
     if (_configuration == null)
         Initialize();
     RepositoryFactory rf = new RepositoryFactory();
     result = new List<Employee>(rf.GetAllEmployees());
     return result.ToArray();
 }
Пример #2
0
 public TransactionResponse DeleteEmployee(int employeeId)
 {
     TransactionResponse response = new TransactionResponse();
     try
     {
         if (_configuration == null)
             Initialize();
         RepositoryFactory rf = new RepositoryFactory();
         rf.DeleteEmployee(new Employee(){PersonId=employeeId});
     }
     catch (Exception ex)
     {
         response.Status.Success = false;
         response.Status.AddError("general", string.Format("{0} - {1}", MethodInfo.GetCurrentMethod().Name, ex.StackTrace));
     }
     return response;
 }
Пример #3
0
 public Employee GetEmployee(int employeeId)
 {
     if (_configuration==null)
         Initialize();
     RepositoryFactory rf = new RepositoryFactory();
     return rf.GetEmployee(employeeId);
 }