/// <summary> /// Constructor /// </summary> public MasterLogic() { try { _masterDAO = new MasterDAO(); _tabAuthorDataTable = new MasterDS.TabAuthorDataTable(); _tabCategoryDataTable = new MasterDS.TabCategoryDataTable(); _tabLanguageDataTable = new MasterDS.TabLanguageDataTable(); _listTabMasterModel = new List <TabMasterModel>(); } catch (Exception ex) { //Error log simulate Console.WriteLine(ex.ToString()); Console.WriteLine(ex.GetBaseException().ToString()); throw; } }
/// <summary> /// Return Categories. /// </summary> /// <returns>List<TabMasterModel></returns> /// <exception cref="ex">Exception</exception> public List <TabMasterModel> GetAllCategories() { try { _listTabMasterModel = new List <TabMasterModel>(); _tabCategoryDataTable = _masterDAO.GetAllCategories(); foreach (MasterDS.TabCategoryRow row in _tabCategoryDataTable.Rows) { _listTabMasterModel.Add(TabMasterModel.Parse(row)); } return(_listTabMasterModel); } catch (Exception ex) { //Error log simulate Console.WriteLine(ex.ToString()); Console.WriteLine(ex.GetBaseException().ToString()); throw; } }