public static Module Load(int moduleId) { try { ModuleDataService dataService = new ModuleDataService(); DataSet ds = dataService.Load(moduleId); Module objModule = new Module(); return(objModule.MapData(ds) ? objModule : null); } catch { throw; } }
/// <summary> /// Loads all the Modules From the Database /// </summary> /// <returns></returns> public static ModuleCollection GetAll() { try { // Craete a Module DataService Object ModuleDataService dataService = new ModuleDataService(); //Create a Module Collection Object ModuleCollection obj = new ModuleCollection(); //Excute the DataService Get All Method which returns a populated Dataset DataSet ds = dataService.GetAll(); //Create objects from data set and Add to collection obj.MapObjects(ds); //Return Collection return(obj); } catch { throw; } }
public ModuleDataController(ModuleDataService moduleDataService) { _moduleDataService = moduleDataService; }