Ejemplo n.º 1
0
        //--------------------------------------------------------------
        public static List <MediaGroups> Static_GetListAllOrderBy(string ConStr, string OrderBy, string TextOptionAll = "...")
        {
            List <MediaGroups> RetVal        = new List <MediaGroups>();
            MediaGroups        m_MediaGroups = new MediaGroups(ConStr);

            try
            {
                OrderBy = StringUtil.InjectionString(OrderBy).Trim();
                if (OrderBy.Length > 0)
                {
                    RetVal = m_MediaGroups.GetListOrderBy(OrderBy);
                }
                TextOptionAll = (TextOptionAll == null) ? "" : TextOptionAll.Trim();
                if (TextOptionAll.Length > 0)
                {
                    m_MediaGroups.MediaGroupName = TextOptionAll;
                    m_MediaGroups.MediaGroupDesc = TextOptionAll;
                    RetVal.Insert(0, m_MediaGroups);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(RetVal);
        }
Ejemplo n.º 2
0
        //--------------------------------------------------------------
        public static List <MediaGroups> Static_GetListAll(string ConStr, string TextOptionAll = "...")
        {
            MediaGroups        m_MediaGroups = new MediaGroups(ConStr);
            List <MediaGroups> RetVal        = m_MediaGroups.GetList();

            TextOptionAll = (TextOptionAll == null) ? "" : TextOptionAll.Trim();
            if (TextOptionAll.Length > 0)
            {
                m_MediaGroups.MediaGroupName = TextOptionAll;
                m_MediaGroups.MediaGroupDesc = TextOptionAll;
                RetVal.Insert(0, m_MediaGroups);
            }
            return(RetVal);
        }
Ejemplo n.º 3
0
        //--------------------------------------------------------------
        public static List <MediaGroups> Static_GetList(string ConStr)
        {
            List <MediaGroups> RetVal = new List <MediaGroups>();

            try
            {
                MediaGroups m_MediaGroups = new MediaGroups(ConStr);
                RetVal = m_MediaGroups.GetList();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(RetVal);
        }
Ejemplo n.º 4
0
        //--------------------------------------------------------------
        public MediaGroups Get(short MediaGroupId)
        {
            MediaGroups RetVal = new MediaGroups(db.ConnectionString);

            try
            {
                List <MediaGroups> list = GetListByMediaGroupId(MediaGroupId);
                if (list.Count > 0)
                {
                    RetVal = (MediaGroups)list[0];
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(RetVal);
        }
Ejemplo n.º 5
0
        //-----------------------------------------------------------------

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

            cmd.Connection = con;
            List <MediaGroups> l_MediaGroups = new List <MediaGroups>();

            try
            {
                con.Open();
                SqlDataReader   reader      = cmd.ExecuteReader();
                SmartDataReader smartReader = new SmartDataReader(reader);
                while (smartReader.Read())
                {
                    MediaGroups m_MediaGroups = new MediaGroups(db.ConnectionString);
                    m_MediaGroups.MediaGroupId   = smartReader.GetInt16("MediaGroupId");
                    m_MediaGroups.MediaGroupName = smartReader.GetString("MediaGroupName");
                    m_MediaGroups.MediaGroupDesc = smartReader.GetString("MediaGroupDesc");
                    m_MediaGroups.CrUserId       = smartReader.GetInt32("CrUserId");
                    m_MediaGroups.CrDateTime     = smartReader.GetDateTime("CrDateTime");
                    m_MediaGroups.SiteId         = smartReader.GetInt16("SiteId");
                    m_MediaGroups.ParentGroupId  = smartReader.GetInt16("ParentGroupId");

                    l_MediaGroups.Add(m_MediaGroups);
                }
                reader.Close();
                return(l_MediaGroups);
            }
            catch (SqlException err)
            {
                throw new ApplicationException("Data error: " + err.Message);
            }
            finally
            {
                db.closeConnection(con);
            }
        }
Ejemplo n.º 6
0
        //--------------------------------------------------------------
        public static List <MediaGroups> Static_GetListOrderBy(string ConStr, string OrderBy)
        {
            MediaGroups m_MediaGroups = new MediaGroups(ConStr);

            return(m_MediaGroups.GetListOrderBy(OrderBy));
        }