Esempio n. 1
0
        private WebAPI.Models.YouTube DataRowToWebApiModel(DataRow dr)
        {
            WebAPI.Models.YouTube utube = new WebAPI.Models.YouTube();
            try
            {
                if (dr["RSSID"] != System.DBNull.Value) { utube.RSSID = (String)dr["RSSID"].ToString(); }
                if (dr["RSSName"] != System.DBNull.Value) { utube.Name = (String)dr["RSSName"]; }
                if (dr["RSSIcon"] != System.DBNull.Value) { utube.Icon = (String)dr["RSSIcon"]; }
                if (dr["RSSDescription"] != System.DBNull.Value) { utube.Description = (String)dr["RSSDescription"]; }

                return utube;
            }
            catch (Exception ex)
            {
                return null;
            }
        }
Esempio n. 2
0
        private WebAPI.Models.YouTube DALObjectToWebApiModel(YouTube.RSS data)
        {
            WebAPI.Models.YouTube utube = new WebAPI.Models.YouTube();
            try
            {
                utube.RSSID = data.RSSID.ToString();
                utube.Name = data.Name;
                utube.Icon = data.Icon;
                utube.Description = data.Description;

                return utube;
            }
            catch (Exception ex)
            {
                return null;
            }
        }