/// <summary> /// Loads All the Managers for one company /// </summary> /// <param name="companyId">Company Primary key </param> /// <returns></returns> public static ManagerCollection Load(int companyId) { try { //Create a Manager Data Service Object ManagerDataService dataService = new ManagerDataService(); //Excuet the Get All Method to get the Dataset with the company Id as a Parameter DataSet ds = dataService.GetAll(companyId); //Create a manager Collection Object ManagerCollection obj = new ManagerCollection(); //Reads the Dataset and Manager Objects to collection obj.MapObjects(ds); //Return Collection return(obj); } catch { throw; } }
/// <summary> /// Loads All Company Managers from the Database /// </summary> /// <returns></returns> public static ManagerCollection GetAll() { try { //Create a Manager Data Service Object ManagerDataService dataService = new ManagerDataService(); //Excuet the Get All Method to get the Dataset DataSet ds = dataService.GetAll(); // Create a manager Collection Objects ManagerCollection obj = new ManagerCollection(); //Reads the Dataset and Manager Objects to collection obj.MapObjects(ds); //Return Collection return(obj); } catch { throw; } }
public void Insert(int companyId) { try { ManagerDataService dataService = new ManagerDataService(); dataService.Insert(ref _managerId, companyId, _firstName, _lastName, _email, _phoneCell, _phoneWork, _address, _city, _state, _zipcode, _title , _organization, _department); } catch { throw; } }
public static Manager Load(int managerId) { try { ManagerDataService dataService = new ManagerDataService(); DataSet ds = dataService.Load(managerId); Manager obj = new Manager(); return(obj.MapData(ds) ? obj : null); } catch { throw; } }