コード例 #1
0
ファイル: LatestNews.cs プロジェクト: samnuriu13/APIXERP
        public static CustomList <LatestNews> GetAllLatestNewsForDisplay()
        {
            ConnectionManager       conManager           = new ConnectionManager(ConnectionName.HR);
            CustomList <LatestNews> LatestNewsCollection = new CustomList <LatestNews>();
            IDataReader             reader = null;
            String sql = "Exec GetLatestNews";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    LatestNews newLatestNews = new LatestNews();
                    newLatestNews.NewsDetails = reader.GetString("NewsDetails");
                    LatestNewsCollection.Add(newLatestNews);
                }
                return(LatestNewsCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
コード例 #2
0
ファイル: LatestNews.cs プロジェクト: samnuriu13/APIXERP
        public static CustomList <LatestNews> GetAllLatestNews()
        {
            ConnectionManager       conManager           = new ConnectionManager(ConnectionName.HR);
            CustomList <LatestNews> LatestNewsCollection = new CustomList <LatestNews>();
            IDataReader             reader = null;
            const String            sql    = "select *from LatestNews";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    LatestNews newLatestNews = new LatestNews();
                    newLatestNews.SetData(reader);
                    LatestNewsCollection.Add(newLatestNews);
                }
                LatestNewsCollection.InsertSpName = "spInsertLatestNews";
                LatestNewsCollection.UpdateSpName = "spUpdateLatestNews";
                LatestNewsCollection.DeleteSpName = "spDeleteLatestNews";
                return(LatestNewsCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
コード例 #3
0
ファイル: LatestNews.cs プロジェクト: samnuriu13/APIXERP
 public static CustomList<LatestNews> GetAllLatestNews()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<LatestNews> LatestNewsCollection = new CustomList<LatestNews>();
     IDataReader reader = null;
     const String sql = "select *from LatestNews";
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             LatestNews newLatestNews = new LatestNews();
             newLatestNews.SetData(reader);
             LatestNewsCollection.Add(newLatestNews);
         }
         LatestNewsCollection.InsertSpName = "spInsertLatestNews";
         LatestNewsCollection.UpdateSpName = "spUpdateLatestNews";
         LatestNewsCollection.DeleteSpName = "spDeleteLatestNews";
         return LatestNewsCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
コード例 #4
0
ファイル: LatestNews.cs プロジェクト: samnuriu13/APIXERP
 public static CustomList<LatestNews> GetAllLatestNewsForDisplay()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<LatestNews> LatestNewsCollection = new CustomList<LatestNews>();
     IDataReader reader = null;
     String sql = "Exec GetLatestNews";
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             LatestNews newLatestNews = new LatestNews();
             newLatestNews.NewsDetails = reader.GetString("NewsDetails");
             LatestNewsCollection.Add(newLatestNews);
         }
         return LatestNewsCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }