Пример #1
0
        //--------------------------------------------------------------
        public static List <OrderByClauses> Static_GetList(string ConStr, string TableName)
        {
            List <OrderByClauses> RetVal = new List <OrderByClauses>();

            try
            {
                OrderByClauses m_OrderByClauses = new OrderByClauses(ConStr);
                RetVal = m_OrderByClauses.GetList(TableName);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(RetVal);
        }
Пример #2
0
        //-----------------------------------------------------------------

        private List <OrderByClauses> Init(SqlCommand cmd)
        {
            SqlConnection con = db.GetConnection();

            cmd.Connection = con;
            List <OrderByClauses> l_OrderByClauses = new List <OrderByClauses>();

            try
            {
                con.Open();
                SqlDataReader   reader      = cmd.ExecuteReader();
                SmartDataReader smartReader = new SmartDataReader(reader);
                while (smartReader.Read())
                {
                    OrderByClauses m_OrderByClauses = new OrderByClauses(db.ConnectionString);
                    m_OrderByClauses.OrderByClauseId = smartReader.GetInt32("OrderByClauseId");
                    m_OrderByClauses.TableName       = smartReader.GetString("TableName");
                    m_OrderByClauses.OrderByName     = smartReader.GetString("OrderByName");
                    m_OrderByClauses.OrderByDesc     = smartReader.GetString("OrderByDesc");
                    m_OrderByClauses.OrderBy         = smartReader.GetString("OrderBy");
                    m_OrderByClauses.DisplayOrder    = smartReader.GetByte("DisplayOrder");
                    m_OrderByClauses.CrDateTime      = smartReader.GetDateTime("CrDateTime");

                    l_OrderByClauses.Add(m_OrderByClauses);
                }
                reader.Close();
                return(l_OrderByClauses);
            }
            catch (SqlException err)
            {
                throw new ApplicationException("Data error: " + err.Message);
            }
            finally
            {
                db.closeConnection(con);
            }
        }