/// <summary>
        /// Return Lyric Category Data
        /// </summary>
        public static ExtendedCollection<Lyric> GetCategories()
        {
            ExtendedCollection<Lyric> list = new ExtendedCollection<Lyric>();

            IDataReader dr = Blogic.ActionProcedureDataProvider.AdminGetLyricCategoryManager;

            while (dr.Read())
            {
                Lyric item = new Lyric();

                item.CatID = (int)dr["CAT_ID"];

                if (dr["CAT_TYPE"] != DBNull.Value)
                {
                    item.Category = (string)dr["CAT_TYPE"];
                }
                if (dr["GROUPCAT"] != DBNull.Value)
                {
                    item.Group = (string)dr["GROUPCAT"];
                }
                if (dr["REC_COUNT"] != DBNull.Value)
                {
                    item.RecordCount = (int)(dr["REC_COUNT"]);
                }

                list.Add(item);
            }

            dr.Close();

            return list;
        }
        public ExtendedCollection<Lyric> GetAllRecipeCommentedByAuthorResult()
        {
            ExtendedCollection<Lyric> list = new ExtendedCollection<Lyric>();

            IDataReader dr = GetData;

            while (dr.Read())
            {
                Lyric item = new Lyric();

                item.ID = (int)dr["ID"];

                item.CatID = (int)dr["CAT_ID"];

                if (dr["Name"] != DBNull.Value)
                {
                    item.LyricName = (string)dr["Name"];
                }
                if (dr["Category"] != DBNull.Value)
                {
                    item.Category = (string)dr["Category"];
                }
                if (dr["Author"] != DBNull.Value)
                {
                    item.Author = (string)dr["Author"];
                }
                if (dr["Rates"] != DBNull.Value)
                {
                    item.Rating = dr["Rates"].ToString();
                }
                if (dr["NO_RATES"] != DBNull.Value)
                {
                    item.NoRates = dr["NO_RATES"].ToString();
                }
                if (dr["Date"] != DBNull.Value)
                {
                    item.Date = (DateTime)(dr["Date"]);
                }
                if (dr["HITS"] != DBNull.Value)
                {
                    item.Hits = (int)dr["HITS"];
                }
                if (dr["LyricImage"] != DBNull.Value)
                {
                    item.LyricImage = (string)dr["LyricImage"];
                }
                if (dr["UID"] != DBNull.Value)
                {
                    item.UID = (int)dr["UID"];
                }

                list.Add(item);
            }

            dr.Close();

            return list;
        }
        public ExtendedCollection<Lyric> GetNewestLyric()
        {
            string Key = "Newest_LyricsSideMenu_" + CatID.ToString();

            ExtendedCollection<Lyric> list = new ExtendedCollection<Lyric>();

            if (Caching.Cache[Key] != null)
            {
                list = (ExtendedCollection<Lyric>)Caching.Cache[Key];
            }
            else
            {
                IDataReader dr = GetData;

                while (dr.Read())
                {
                    Lyric item = new Lyric();

                    item.ID = (int)dr["ID"];

                    if (dr["Name"] != DBNull.Value)
                    {
                        item.LyricName = (string)dr["Name"];
                    }
                    if (dr["Category"] != DBNull.Value)
                    {
                        item.Category = (string)dr["Category"];
                    }
                    if (dr["Date"] != DBNull.Value)
                    {
                        item.Date = (DateTime)(dr["Date"]);
                    }
                    if (dr["HITS"] != DBNull.Value)
                    {
                        item.Hits = (int)dr["HITS"];
                    }
                    if (dr["LyricImage"] != DBNull.Value)
                    {
                        item.LyricImage = (string)dr["LyricImage"];
                    }

                    list.Add(item);

                    Caching.CahceData(Key, list);
                }

                dr.Close();
            }

            return list;
        }
        public ExtendedCollection<Lyric> GetRecipe()
        {
            ExtendedCollection<Lyric> list = new ExtendedCollection<Lyric>();

               string Key = "Last5_LyricPublishedByUser_" + UID;

               if (Caching.Cache[Key] != null)
               {
               list = (ExtendedCollection<Lyric>)Caching.Cache[Key];
               }
               else
               {

               IDataReader dr = GetData;

               while (dr.Read())
               {
                   Lyric item = new Lyric();

                   item.ID = (int)dr["ID"];

                   if (dr["Name"] != DBNull.Value)
                   {
                       item.LyricName = (string)dr["Name"];
                   }
                   if (dr["Category"] != DBNull.Value)
                   {
                       item.Category = (string)dr["Category"];
                   }
                   if (dr["HITS"] != DBNull.Value)
                   {
                       item.Hits = (int)dr["HITS"];
                   }
                   if (dr["LyricImage"] != DBNull.Value)
                   {
                       item.LyricImage = (string)dr["LyricImage"];
                   }

                   list.Add(item);

                   Caching.CahceData(Key, list);
               }

               dr.Close();
               }

            return list;
        }
        /// <summary>
        /// Returns Most Popular Lyrics Side Menu
        /// </summary>
        public ExtendedCollection<Lyric> GetPopularLyric()
        {
            ExtendedCollection<Lyric> list = new ExtendedCollection<Lyric>();

            string Key = "MostPopular_LyricsSideMenu_" + CatID.ToString();

            if (Caching.Cache[Key] != null)
            {
                list = (ExtendedCollection<Lyric>)Caching.Cache[Key];
            }
            else
            {
                IDataReader dr = Blogic.ActionProcedureDataProvider.GetMostpopularLyricsSideMenu(CatID, Top);

                while (dr.Read())
                {
                    Lyric item = new Lyric();

                    item.ID = (int)dr["ID"];

                    if (dr["Name"] != DBNull.Value)
                    {
                        item.LyricName = (string)dr["Name"];
                    }
                    if (dr["Category"] != DBNull.Value)
                    {
                        item.Category = (string)dr["Category"];
                    }
                    if (dr["HITS"] != DBNull.Value)
                    {
                        item.Hits = (int)dr["HITS"];
                    }
                    if (dr["LyricImage"] != DBNull.Value)
                    {
                        item.LyricImage = (string)dr["LyricImage"];
                    }

                    list.Add(item);

                    Caching.CahceData(Key, list);
                }

                dr.Close();
            }

            return list;
        }
        public static ExtendedCollection<Lyric> GetLastViewedLyric()
        {
            ExtendedCollection<Lyric> list = new ExtendedCollection<Lyric>();

                IDataReader dr = GetData;

                while (dr.Read())
                {
                    Lyric item = new Lyric();

                    item.ID = (int)dr["ID"];

                    if (dr["Name"] != DBNull.Value)
                    {
                        item.LyricName = (string)dr["Name"];
                    }
                    if (dr["Category"] != DBNull.Value)
                    {
                        item.Category = (string)dr["Category"];
                    }
                    if (dr["Hits"] != DBNull.Value)
                    {
                        item.Hits = (int)(dr["Hits"]);
                    }
                    if (dr["Hours"] != DBNull.Value)
                    {
                        item.Hours = (int)(dr["Hours"]);
                    }
                    if (dr["Minutes"] != DBNull.Value)
                    {
                        item.Minutes = (int)(dr["Minutes"]);
                    }
                    if (dr["LyricImage"] != DBNull.Value)
                    {
                        item.LyricImage = (string)dr["LyricImage"];
                    }

                    list.Add(item);
                }

                dr.Close();

            return list;
        }
        /// <summary>
        /// Return Lyric Main Course Category
        /// </summary>
        /// <returns></returns>
        public static ExtendedCollection<Lyric> GetMainCourseCategory()
        {
            ExtendedCollection<Lyric> list = new ExtendedCollection<Lyric>();

            string Key = "MainCourse_LyricCategory";

            if (Caching.Cache[Key] != null)
            {
                list = (ExtendedCollection<Lyric>)Caching.Cache[Key];
            }

            else
            {
                IDataReader dr = Blogic.ActionProcedureDataProvider.GetHomepageMainCourseCategory;

                while (dr.Read())
                {
                    Lyric item = new Lyric();

                    item.CatID = (int)dr["CAT_ID"];

                    if (dr["CAT_TYPE"] != DBNull.Value)
                    {
                        item.Category = (string)dr["CAT_TYPE"];
                    }

                    if (dr["REC_COUNT"] != DBNull.Value)
                    {
                        item.RecordCount = (int)(dr["REC_COUNT"]);
                    }

                    list.Add(item);

                    Caching.CahceData(Key, list);
                }

                dr.Close();
            }

            return list;
        }
        /// <summary>
        /// Returns related Lyric
        /// </summary>
        public static ExtendedCollection<Lyric> GetRelatedLyrics(int CatId)
        {
            ExtendedCollection<Lyric> list = new ExtendedCollection<Lyric>();

            IDataReader dr = Blogic.ActionProcedureDataProvider.GetRelatedLyric(CatId);

            while (dr.Read())
            {
                Lyric item = new Lyric();

                item.ID = (int)dr["ID"];

                if (dr["Name"] != DBNull.Value)
                {
                    item.LyricName = (string)dr["Name"];
                }
                if (dr["Category"] != DBNull.Value)
                {
                    item.Category = (string)dr["Category"];
                }
                if (dr["Hits"] != DBNull.Value)
                {
                    item.Hits = (int)(dr["Hits"]);
                }
                if (dr["LyricImage"] != DBNull.Value)
                {
                    item.LyricImage = (string)dr["LyricImage"];
                }

                list.Add(item);
            }

            dr.Close();

            return list;
        }
示例#9
0
 /// <summary>
 /// Perform Update
 /// </summary>
 /// <returns></returns>
 public override int UpdateCategory(Lyric category)
 {
     return Blogic.ActionProcedureDataProvider.UpdateLyricCategory(category);
 }
示例#10
0
 public virtual int Delete(Lyric lyric)
 {
     return 0;
 }
示例#11
0
 /// <summary>
 /// Perform Delete
 /// </summary>
 /// <returns></returns>
 public override int Delete(Lyric lyric)
 {
     return Blogic.ActionProcedureDataProvider.AdminLyricManagerDelete(lyric);
 }
示例#12
0
 /// <summary>
 /// Perform Update
 /// </summary>
 /// <returns></returns>
 public override int Update(Lyric lyric)
 {
     return Blogic.ActionProcedureDataProvider.UpdateLyric(lyric);
 }
示例#13
0
 /// <summary>
 /// Perform Insert to Database
 /// </summary>
 /// <returns></returns>
 public override int Add(Lyric lyric)
 {
     return Blogic.ActionProcedureDataProvider.AddLyric(lyric);
 }
示例#14
0
 /// <summary>
 /// Perform Insert to Database
 /// </summary>
 /// <returns></returns>
 public override int AddCategory(Lyric category)
 {
     return Blogic.ActionProcedureDataProvider.AdminAddNewLyricCategory(category);
 }
示例#15
0
 public virtual int Add(Lyric lyric)
 {
     return 0;
 }
        /// <summary>
        /// Update Lyric
        /// </summary>
        /// <returns></returns>
        public int UpdateLyric(Lyric lyric)
        {
            SqlParameter prmUserID = new SqlParameter("@UserID", SqlDbType.Int, 4);
            prmUserID.Value = lyric.UID;

            SqlParameter prmID = new SqlParameter("@ID", SqlDbType.Int, 4);
            prmID.Value = lyric.ID;

            SqlParameter prmName = new SqlParameter("@Name", SqlDbType.NVarChar, 200);
            prmName.Value = lyric.LyricName;

            SqlParameter prmCatId = new SqlParameter("@Cat_Id", SqlDbType.Int, 4);
            prmCatId.Value = lyric.CatID;

            SqlParameter prmIngred = new SqlParameter("@Ingredients", SqlDbType.NText);
            prmIngred.Value = lyric.Ingredients;

            SqlParameter prmInstruc = new SqlParameter("@Instructions", SqlDbType.NText);
            prmInstruc.Value = lyric.Instructions;

            SqlParameter prmHits = new SqlParameter("@Hits", SqlDbType.Int, 4);
            prmHits.Value = lyric.Hits;

            SqlParameter prmLyricImage = new SqlParameter("@LyricImage", SqlDbType.NVarChar, 50);
            prmLyricImage.Value = lyric.LyricImage;

            SqlParameter prmUrlMusic = new SqlParameter("@UrlMusic", SqlDbType.NVarChar, 50);
            prmUrlMusic.Value = lyric.UrlMusic;

            SqlParameter prmUrlChacha = new SqlParameter("@UrlChacha", SqlDbType.NVarChar, 50);
            prmUrlChacha.Value = lyric.UrlChacha;

            SqlParameter prmUrlZing = new SqlParameter("@UrlZing", SqlDbType.NVarChar, 50);
            prmUrlZing.Value = lyric.UrlZing;

            SqlParameter prmUrlYoutube = new SqlParameter("@UrlYoutube", SqlDbType.NVarChar, 50);
            prmUrlYoutube.Value = lyric.UrlYoutube;

            return DataAccess.Execute("spUpdateLyric", prmUserID, prmID, prmName, prmCatId, prmIngred, prmInstruc, prmHits, prmLyricImage,prmUrlMusic,prmUrlChacha,prmUrlZing,prmUrlYoutube);
        }
        /// <summary>
        /// Delete Lyric Category
        /// </summary>
        /// <returns></returns>
        public int AdminDeleteLyricCategory(Lyric category)
        {
            SqlParameter prmCatId = new SqlParameter("@Catid", SqlDbType.Int, 4);
            prmCatId.Value = category.CatID;

            return DataAccess.Execute("AdminDeleteLyricCategory", prmCatId);
        }
        /// <summary>
        /// Insert Lyric
        /// </summary>
        /// <returns></returns>
        public int AddLyric(Lyric lyric)
        {
            SqlParameter prmName = new SqlParameter("@Name", SqlDbType.NVarChar, 50);
            prmName.Value = lyric.LyricName;

            SqlParameter prmAuthor = new SqlParameter("@Author", SqlDbType.NVarChar, 50);
            prmAuthor.Value = lyric.Author;

            SqlParameter prmCatID = new SqlParameter("@Cat_Id", SqlDbType.Int, 4);
            prmCatID.Value = lyric.CatID;

            SqlParameter prmIngred = new SqlParameter("@Ingredients", SqlDbType.NText);
            prmIngred.Value = lyric.Ingredients;

            SqlParameter prmInstruct = new SqlParameter("@Instructions", SqlDbType.NText);
            prmInstruct.Value = lyric.Instructions;

            SqlParameter prmLyricImage = new SqlParameter("@LyricImage", SqlDbType.NVarChar, 50);
            prmLyricImage.Value = lyric.LyricImage;

            SqlParameter prmUserID = new SqlParameter("@UserID", SqlDbType.Int, 4);
            prmUserID.Value = lyric.UID;

            return DataAccess.Execute("spAddLyric", prmName, prmAuthor, prmCatID, prmIngred, prmInstruct, prmLyricImage, prmUserID);
        }
示例#19
0
 public virtual int AddCategory(Lyric category)
 {
     return 0;
 }
        /// <summary>
        /// Add New Lyric Category
        /// </summary>
        /// <returns></returns>
        public int AdminAddNewLyricCategory(Lyric category)
        {
            SqlParameter prmCategoryName = new SqlParameter("@CatName", SqlDbType.VarChar, 100);
            prmCategoryName.Value = category.Category;

            SqlParameter prmGroupID = new SqlParameter("@Group", SqlDbType.Int, 4);
            prmGroupID.Value = category.CatGroupID;

            return DataAccess.Execute("AdminAddNewLyricCategory", prmCategoryName, prmGroupID);
        }
示例#21
0
 public virtual int DeleteCategory(Lyric category)
 {
     return 0;
 }
        /// <summary>
        /// Admin Lyric Manager Delete Lyric
        /// </summary>
        /// <returns></returns>
        public int AdminLyricManagerDelete(Lyric lyric)
        {
            SqlParameter prmID = new SqlParameter("@ID", SqlDbType.Int, 4);
            prmID.Value = lyric.ID;

            return DataAccess.Execute("AdminManagerDeleteLyric", prmID);
        }
示例#23
0
 public virtual int Update(Lyric lyric)
 {
     return 0;
 }
        /// <summary>
        /// Update Lyric Category
        /// </summary>
        /// <returns></returns>
        public int UpdateLyricCategory(Lyric category)
        {
            SqlParameter prmCatId = new SqlParameter("@Catid", SqlDbType.Int, 4);
            prmCatId.Value = category.CatID;

            SqlParameter prmCatName = new SqlParameter("@CatName", SqlDbType.NVarChar, 100);
            prmCatName.Value = category.Category;

            return DataAccess.Execute("UpdateLyricCategory", prmCatId, prmCatName);
        }
示例#25
0
 public virtual int UpdateCategory(Lyric category)
 {
     return 0;
 }