Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LyricDetails Lyric = new LyricDetails();

            int RecipeID = (int)Util.Val(Request.QueryString["id"]);
            Lyric.Approved = constant.UnApprovedRecipe;
            Lyric.FillUp(RecipeID);

            UserID = Lyric.UID;

            strRecipeImage = GetLyricImage.GetImage(RecipeID);

            if (Lyric.HitDate.ToString() == "1/1/0001 12:00:00 AM")
            {
                lblastviewed.Text = "This Lyric Has not been view by a user lately.";
            }
            else
            {
                lblastviewed.Text = Lyric.HitDate.ToString();
            }

            lblname.Text = Lyric.LyricName;
            lblauthor.Text = Lyric.Author;
            lbldate.Text = Lyric.Date.ToShortDateString();
            lblCatName.Text = Lyric.Category;
            Ingredients.Text = Lyric.Ingredients;
            Instructions.Text = Lyric.Instructions;

            if (Lyric.Approved == 1)
            {
                approvebutton.Visible = false;
                lblapprovalstatus.Text = "Viewing Lyric";
            }
            else
            {
                lblapprovalstatus.Text = "Unapprove - This recipe is waiting for approval";
            }

            if (Lyric.Hits == 0)
            {
                lblhits.Text = "0";
            }
            else
            {
                lblhits.Text = string.Format("{0:#,###}", Lyric.Hits);
            }

            strRecipename = Lyric.LyricName;

            Util = null;
            Lyric = null;
        }
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Utility Util = new Utility();

        LyricDetails Lyric = new LyricDetails();

        int RecipeID = (int)Util.Val(Request.QueryString["id"]);
        Lyric.Approved = constant.ApprovedLyric;
        Lyric.FillUp(RecipeID);

        lblingredientsdis.Text = "Hợp âm:";
        lblinstructionsdis.Text = "Hướng dẫn:";
        lblname.Text = Lyric.LyricName;
        lblIngredients.Text = Util.FormatText(Lyric.Ingredients);
        lblInstructions.Text = Util.FormatText(Lyric.Instructions);

        strRName = "In hợp âm " + Lyric.LyricName + "";

        Util = null;
        Lyric = null;
    }
Ejemplo n.º 3
0
 private void ShowEditLink(LyricDetails lyric)
 {
     if (Authentication.IsUserAuthenticated && lyric.UID == UserIdentity.UserID)
     {
         editLyriclink.Visible = true;
         editLyriclink.Text = "<img src='images/icon_pencil.gif' alt='Sửa' border='0'> Sửa";
         editLyriclink.NavigateUrl = "editlyric.aspx?id=" + lyric.ID;
         editLyriclink.Attributes.Add("onmouseover", "Tip('Sửa thông tin của bài hát <b>" + lyric.LyricName + "</b>.', BGCOLOR, '#FFFBE1', BORDERCOLOR, '#acc6db')");
         editLyriclink.Attributes.Add("onmouseout", "UnTip()");
     }
 }
Ejemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        LyricDetails lyric = new LyricDetails();

        int LyricID = (int)Util.Val(Request.QueryString["id"]);
        lyric.Approved = constant.ApprovedLyric;
        lyric.FillUp(LyricID);

        RecCatId = lyric.CatID;
        strRName = lyric.LyricName;
        strCName = lyric.Category;
        LyricSection = constant.intLyric;
        dateposted = lyric.Date;
        strCreateBy = lyric.CreateBy;
        iUserID = lyric.UID;

        CommentLink.Text = "Lời bình (" + lyric.CountComments + ")";
        CommentLink.Attributes.Add("onmouseover", "Tip('Đọc và viết lời bình cho bài hát này.', BGCOLOR, '#FFFBE1', BORDERCOLOR, '#acc6db')");
        CommentLink.Attributes.Add("onmouseout", "UnTip()");
        lbcountcomment.Text = lyric.CountComments.ToString();
        lblname.Text = lyric.LyricName;
        //lblauthor.Text = "<a href=" + "userprofile.aspx?uid=" + lyric.UID + ">" + lyric.Author + "</a>";
        lblhits.Text = string.Format("{0:#,###}", lyric.Hits);
        lblrating.Text = lyric.Rating;
        lblvotescount.Text = lyric.NoRates;
        lblcategorytop.Text = lyric.Category;
        lbldate.Text = Utility.FormatDate(lyric.Date);
        lblIngredients.Text = lyric.Ingredients;
        lblInstructions.Text = lyric.Instructions;
        starimage.ImageUrl = Utility.GetStarImage(lyric.Rating);
        lblMediaPlayer.Text = GetAllMediaPlayer(lyric.UrlMusic,lyric.UrlChacha,lyric.UrlZing,lyric.UrlYoutube);

        //lblauthor.Attributes.Add("onmouseover", "Tip('Xem tất cả bài hát đăng bởi <b>" + lyric.Author + "</b>.', BGCOLOR, '#FFFBE1', BORDERCOLOR, '#acc6db')");
        //lblauthor.Attributes.Add("onmouseout", "UnTip()");
        //lblauthor.Attributes.Add("onclick", "Popup('AjaxRequest/popUpAjax.aspx?uid=" + lyric.UID + "&author=" + lyric.Author + "',this);return false");

        strBookmarkURL = Bookmark.URL;

        GetMetaKeywords(DynamicKeywords.Keywords(constant.intLyricDynamicKeywordDetails, "Bài hát " + lyric.LyricName.ToString() + " thể loại " + lyric.Category.ToString()));

        ShowLyricImage(LyricID);
        AddToCookBookLinkButton(lyric.LyricName);
        ShowEditLink(lyric);
        ShowNewPopularImage(LyricID);
        GetRelatedLyrics(lyric.CatID);
        GetUserLyricCookieRating(LyricID);
        GetComments(LyricID);
        ShowCommentFormIfLogin();

        lyric = null;
    }
Ejemplo n.º 5
0
    protected void Page_Load(Object sender, EventArgs e)
    {
        if (Authentication.IsUserAuthenticated)
        {
            lblusername.Text = UserIdentity.UserName;

            LoadDropDownListCategory.LoadDropDownCategory("Lyric Category", CategoryID, "Select a Category");

            try
            {
                LyricDetails lyric = new LyricDetails();

                int RecipeID = (int)Util.Val(Request.QueryString["id"]);

                strRecipeImage = GetLyricImage.GetLyricImageUserEdit(RecipeID);
                lyric.Approved = constant.ApprovedLyric;
                lyric.FillUp(RecipeID);

                Name.Value = lyric.LyricName;
                Hits.Value = lyric.Hits.ToString();
                Ingredients.Value = lyric.Ingredients;
                Instructions.Value = lyric.Instructions;
                UrlMusic.Value = lyric.UrlMusic;
                UrlZing.Value = lyric.UrlZing;
                UrlYoutube.Value = lyric.UrlYoutube;
                UrlChacha.Value = lyric.UrlChacha;

                if (lyric.UID == UserIdentity.UserID)
                {
                    HideContentIfNotLogin.Visible = true;
                }
                else
                {
                    lblyouarenotlogin.Visible = true;
                    lblyouarenotlogin.Text = "<div style='margin-top: 12px; margin-bottom: 7px;'><img src='images/lock.gif' align='absmiddle'> You are not authorize to edit this recipe.</div>";
                }

                lyric = null;
            }
            catch
            {

            }
        }
        else
        {
            lblyouarenotlogin.Visible = true;
            lblyouarenotlogin.Text = "<div style='margin-top: 12px; margin-bottom: 7px;'><img src='images/lock.gif' align='absmiddle'> You are not authorize to edit a recipe. Please login to edit your recipe.</div>";
        }
    }
Ejemplo n.º 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadDropDownListCategory.LoadDropDownCategory("Lyric Category", CategoryID, "Select a Category");

            lblusername.Text = "Welcome Admin:&nbsp;" + UserIdentity.AdminUsername;

            LyricDetails Lyric = new LyricDetails();

            int RecipeID = (int)Util.Val(Request.QueryString["id"]);

            strRecipeImage = GetLyricImage.GetImage(RecipeID);
            Lyric.Approved = constant.UnApprovedRecipe;
            Lyric.FillUp(RecipeID);

            lblauthorname.Text = Lyric.Author;
            Userid.Value = Lyric.UID.ToString();
            Name.Text = Lyric.LyricName;
            Author.Value = Lyric.Author;
            Hits.Text = Lyric.Hits.ToString();
            Ingredients.Text = Lyric.Ingredients;
            Instructions.Text = Lyric.Instructions;

            Lyric = null;
        }
    }