Esempio n. 1
0
 /// <summary>
 /// Parse of Language data from the DS object to the model object.
 /// Returns null if the row is null.
 /// </summary>
 /// <param name="row">MasterDS.TabLanguageRow row</param>
 /// <returns>MasterModel</returns>
 public static TabMasterModel Parse(MasterDS.TabLanguageRow row)
 {
     if (row == null)
     {
         return(null);
     }
     else
     {
         TabMasterModel masterModel = new TabMasterModel();
         masterModel._dataId          = row.LID;
         masterModel._dataDescription = row.LanguageName;
         return(masterModel);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Parse of Category data from the DS object to the model object.
 /// Returns null if the row is null.
 /// </summary>
 /// <param name="row">MasterDS.TabCategoryRow row</param>
 /// <returns>MasterModel</returns>
 public static TabMasterModel Parse(MasterDS.TabCategoryRow row)
 {
     if (row == null)
     {
         return(null);
     }
     else
     {
         TabMasterModel masterModel = new TabMasterModel();
         masterModel._dataId          = row.CID;
         masterModel._dataDescription = row.CategoryName;
         return(masterModel);
     }
 }
Esempio n. 3
0
        /// <summary>
        /// Return Languages.
        /// </summary>
        /// <returns>List<TabMasterModel></returns>
        /// <exception cref="ex">Exception</exception>
        public List <TabMasterModel> GetAllLanguages()
        {
            try
            {
                _listTabMasterModel   = new List <TabMasterModel>();
                _tabLanguageDataTable = _masterDAO.GetAllLanguages();

                foreach (MasterDS.TabLanguageRow row in _tabLanguageDataTable.Rows)
                {
                    _listTabMasterModel.Add(TabMasterModel.Parse(row));
                }

                return(_listTabMasterModel);
            }
            catch (Exception ex)
            {
                //Error log simulate
                Console.WriteLine(ex.ToString());
                Console.WriteLine(ex.GetBaseException().ToString());
                throw;
            }
        }