예제 #1
0
    private void ViewBrand()
    {
        if (AspNetCache.CheckCache("BlockAdv_isFlash_2Col_" + hddValue.Value + "_" + Language.language.Replace("-", "_")) == false)
        {
            MenuLinksBSO _menulink = new MenuLinksBSO();
            DataTable    table     = _menulink.GetHotMenuLinks(hddValue.Value, Language.language);

            string strAdv = "";

            if (table.Rows.Count > 0)
            {
                for (int i = 0; i < table.Rows.Count; i++)
                {
                    DataRow row = table.Rows[i];

                    strAdv += "<div style='margin-bottom:10px;'>";

                    if (Convert.ToBoolean(row["isFlash"].ToString()))
                    {
                        //is Flash
                        strAdv += "<object width='" + row["width"] + "' height='" + row["height"] + "'>";
                        strAdv += "<param name='Movie' value='" + row["FileName"] + "'>";
                        strAdv += "<param name='play' value='true'>";
                        strAdv += "<param name='quality' value='high'>";
                        strAdv += "<param name='wmode' value='transparent'>";
                        strAdv += "<param name='loop' value='true'>";
                        strAdv += "<param name='menu' value='false'><embed src='" + row["FileName"] + "' width='" + row["width"] + "' height='" + row["height"] + "' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' quality='high' wmode='transparent' loop='true' menu='false'></object>";
                    }
                    else
                    {
                        strAdv += "<a href='" + row["MenuLinksUrl"] + "' target='" + row["Target"] + " title='" + row["MenuLinksName"] + "'>";
                        strAdv += "<img src='" + row["MenuLinksIcon"] + " width='" + row["Width"] + " height='" + row["Height"] + "' alt='" + row["MenuLinksName"] + "' />";
                        strAdv += "</a>";
                    }

                    strAdv += "<div class='clear'>";
                    strAdv += "</div>";
                    strAdv += "</div>";
                }
            }

            AspNetCache.SetCacheWithTime("BlockAdv_isFlash_2Col_" + hddValue.Value + "_" + Language.language.Replace("-", "_"), strAdv, 150);
            ltlAdv.Text = strAdv;
        }
        else
        {
            ltlAdv.Text = (string)AspNetCache.GetCache("BlockAdv_isFlash_2Col_" + hddValue.Value + "_" + Language.language.Replace("-", "_"));
        }
    }
예제 #2
0
    protected void Edit()
    {
        MenuLinksBSO menuLinksBSO = new MenuLinksBSO();
        MenuLinks    menuLinks    = ReceiveHtml();

        try
        {
            menuLinksBSO.EditMenuLinks(menuLinks);
            clientview.Text = "<div class='alert alert-sm alert-danger bg-gradient'>Cập nhật thành công !</div>";
            initControl(menuLinks.MenuLinksID);
        }
        catch (Exception ex)
        {
            clientview.Text = ex.Message.ToString();
        }
    }
예제 #3
0
    protected void Add()
    {
        MenuLinksBSO menuLinksBSO = new MenuLinksBSO();
        MenuLinks    menuLinks    = ReceiveHtml();

        try
        {
            int id = menuLinksBSO.AddMenuLinks(menuLinks);
            clientview.Text = "<div class='alert alert-sm alert-danger bg-gradient'>Thêm mới thành công !</div>";
            initControl(id);
        }
        catch (Exception ex)
        {
            clientview.Text = ex.Message.ToString();
        }
    }
예제 #4
0
    private void ViewWeblink()
    {
        DataTable table = new DataTable();

        if (AspNetCache.CheckCache("tbl_Link_notext_hover_col2_" + hddValue.Value) == false)
        {
            MenuLinksBSO menulinksBSO = new MenuLinksBSO();
            table = menulinksBSO.GetHotMenuLinks(hddValue.Value, Convert.ToInt32(hddRecord.Value), Language.language);
            AspNetCache.SetCache("tbl_Link_notext_hover_col2_" + hddValue.Value, table);
        }
        else
        {
            table = (DataTable)AspNetCache.GetCache("tbl_Link_notext_hover_col2_" + hddValue.Value);
        }
        rptWeblink.DataSource = table;
        rptWeblink.DataBind();
    }
예제 #5
0
    protected void btn_add_Click_more(object sender, EventArgs e)
    {
        MenuLinksBSO menuLinksBSO = new MenuLinksBSO();
        MenuLinks    menuLinks    = ReceiveHtml();

        try
        {
            int id = menuLinksBSO.AddMenuLinks(menuLinks);
            clientview.Text = "<div class='alert alert-sm alert-danger bg-gradient'>Thêm mới thành công !</div>";
            BindDropDownList();
            AspNetCache.Reset();
        }
        catch (Exception ex)
        {
            clientview.Text = ex.Message.ToString();
        }
    }
예제 #6
0
    private DataTable ViewMenuTop(string value)
    {
        DataTable table = new DataTable();

        if (AspNetCache.CheckCache("Menutop_" + value + "_" + Language.language.Replace("-", "_")) == false)
        {
            MenuLinksBSO _menulink = new MenuLinksBSO();
            table = _menulink.GetHotMenuLinks(value, Language.language);
            AspNetCache.SetCacheWithTime("Menutop_" + value + "_" + Language.language.Replace("-", "_"), table, 150);
        }
        else
        {
            table = (DataTable)AspNetCache.GetCache("Menutop_" + value + "_" + Language.language.Replace("-", "_"));
        }

        return(table);
    }
예제 #7
0
    private void ViewMenuTop()
    {
        DataTable table = new DataTable();

        if (AspNetCache.CheckCache("Bannertop_" + hddValue3.Value + "_" + Language.language.Replace("-", "_")) == false)
        {
            MenuLinksBSO _menulink = new MenuLinksBSO();
            table = _menulink.GetHotMenuLinks(hddValue3.Value, 1, Language.language);
            AspNetCache.SetCacheWithTime("Bannertop_" + hddValue3.Value + "_" + Language.language.Replace("-", "_"), table, 150);
        }
        else
        {
            table = (DataTable)AspNetCache.GetCache("Bannertop_" + hddValue3.Value + "_" + Language.language.Replace("-", "_"));
        }

        rptAdv.DataSource = table;
        rptAdv.DataBind();
    }
    private void ViewWeblink()
    {
        DataTable table = new DataTable();

        if (AspNetCache.CheckCache("Link_textImage" + hddValue.Value + "_" + Language.language.Replace("-", "_")) == false)
        {
            MenuLinksBSO menulinksBSO = new MenuLinksBSO();
            table = menulinksBSO.GetHotMenuLinks(hddValue.Value, Convert.ToInt32(hddRecord.Value), Language.language);

            AspNetCache.SetCache("Link_textImage" + hddValue.Value + "_" + Language.language.Replace("-", "_"), table);
        }
        else
        {
            table = (DataTable)AspNetCache.GetCache("Link_textImage" + hddValue.Value + "_" + Language.language.Replace("-", "_"));
        }
        rptWebLink.DataSource = table;
        rptWebLink.DataBind();
    }
예제 #9
0
    private void ViewWeblink()
    {
        DataTable table = new DataTable();

        if (AspNetCache.CheckCache("HTML_ltlAdvPartner_Main_" + hddValue.Value) == false)
        {
            MenuLinksBSO menulinksBSO = new MenuLinksBSO();
            table = menulinksBSO.GetHotMenuLinks(hddValue.Value, Language.language);

            AspNetCache.SetCacheWithTime("HTML_ltlAdvPartner_Main_" + hddValue.Value, table, 150);
        }
        else
        {
            table = (DataTable)AspNetCache.GetCache("HTML_ltlAdvPartner_Main_" + hddValue.Value);
        }
        rptWebLink.DataSource = table;
        rptWebLink.DataBind();
    }
예제 #10
0
    private void ViewBrand()
    {
        MenuLinksBSO _menulink = new MenuLinksBSO();
        DataTable    table     = new DataTable();

        if (AspNetCache.CheckCache("LinkList_" + hddValue.Value + "_" + Language.language.Replace("-", "_")) == false)
        {
            table = _menulink.GetHotMenuLinks(hddValue.Value, Convert.ToInt32(hddRecord.Value), Language.language);
            AspNetCache.SetCacheWithTime("LinkList_" + hddValue.Value + "_" + Language.language.Replace("-", "_"), table, 150);
        }
        else
        {
            table = (DataTable)AspNetCache.GetCache("LinkList_" + hddValue.Value + "_" + Language.language.Replace("-", "_"));
        }

        rptAdv.DataSource = table;
        rptAdv.DataBind();
    }
예제 #11
0
    protected void grvMenuLink_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        int    mID   = Convert.ToInt32(e.CommandArgument.ToString().Trim());
        string cName = e.CommandName.ToLower().Trim();

        switch (cName)
        {
        case "_edit":
            Response.Redirect("~/Admin/editmenulinks/" + mID + "/Default.aspx");
            break;

        case "_delete":
            MenuLinksBSO menuLinksBSO = new MenuLinksBSO();
            menuLinksBSO.DeleteMenuLinks(mID);
            ViewMenuLinks();
            AspNetCache.Reset();
            break;
        }
    }
    private void ViewWeblink()
    {
        //lblTitle.Text = "";
        DataTable table = new DataTable();

        if (AspNetCache.CheckCache("tbl_Link_Image_Text_Scroll" + hddValue.Value) == false)
        {
            MenuLinksBSO menulinksBSO = new MenuLinksBSO();
            table = menulinksBSO.GetHotMenuLinks(hddValue.Value, Convert.ToInt32(hddRecord.Value), Language.language);

            AspNetCache.SetCache("tbl_Link_Image_Text_Scroll" + hddValue.Value, table);
        }
        else
        {
            table = (DataTable)AspNetCache.GetCache("tbl_Link_Image_Text_Scroll" + hddValue.Value);
        }
        rptWebLink.DataSource = table;
        rptWebLink.DataBind();
    }
예제 #13
0
    private void ViewWeblink()
    {
        DataTable table = new DataTable();

        if (AspNetCache.CheckCache("HTML_WebLink_" + hddValue.Value) == false)
        {
            MenuLinksBSO menulinksBSO = new MenuLinksBSO();
            table = menulinksBSO.GetHotMenuLinks(hddValue.Value, Convert.ToInt32(hddRecord.Value), Language.language);

            AspNetCache.SetCache("HTML_WebLink_" + hddValue.Value, table);
        }
        else
        {
            table = (DataTable)AspNetCache.GetCache("HTML_WebLink_" + hddValue.Value);
        }
        ddlWeblink.DataSource     = table;
        ddlWeblink.DataTextField  = "MenuLinksName";
        ddlWeblink.DataValueField = "MenuLinksUrl";
        ddlWeblink.DataBind();
    }
예제 #14
0
    //private void GetHeight()
    //{
    //    DataTable table = new DataTable();

    //    if (AspNetCache.CheckCache("tbl_BannerSlider_Root_" + hddValue.Value) == false)
    //    {
    //        MenuLinksBSO menulinksBSO = new MenuLinksBSO();
    //        table = menulinksBSO.GetRootMenuLinks(hddValue.Value, Language.language);
    //        AspNetCache.SetCache("tbl_BannerSlider_Root_" + hddValue.Value, table);

    //    }
    //    else
    //    {
    //        table = (DataTable)AspNetCache.GetCache("tbl_BannerSlider_Root_" + hddValue.Value);
    //    }

    //    if (table.Rows.Count > 0)
    //    {
    //        DataRow row = table.Rows[0];
    //        _height = Convert.ToInt32(row["Height"].ToString());
    //    }
    //}
    private void ViewBanner()
    {
        DataTable table = new DataTable();

        if (AspNetCache.CheckCache("tbl_BannerSlider_Main_" + hddValue.Value) == false)
        {
            MenuLinksBSO menulinksBSO = new MenuLinksBSO();
            table = menulinksBSO.GetHotMenuLinks(hddValue.Value, Language.language);
            AspNetCache.SetCache("tbl_BannerSlider_Main_" + hddValue.Value, table);
        }
        else
        {
            table = (DataTable)AspNetCache.GetCache("tbl_BannerSlider_Main_" + hddValue.Value);
        }

        //string strBannerLarger = "";
        //string strBannerThumb = "";
        if (table.Rows.Count > 0)
        {
            rptSlider.DataSource = table;
            rptSlider.DataBind();
            //for (int i = 0; i < table.Rows.Count; i++)
            //{
            //    DataRow row = table.Rows[i];

            //    strBannerLarger += "<div class='item " + ((i == 0) ? "active" : "") + "'>";

            //    strBannerLarger += "<img src='" + Utils.getURLThumbImage(row["MenuLinksIcon"].ToString(), Convert.ToInt32(row["Width"])) + "' alt='" + row["MenuLinksName"] + "' > ";
            //    if (row["MenuLinksHelp"].ToString() != "")
            //    {

            //        strBannerLarger += "<div class='container'>";
            //          strBannerLarger += "<div class='carousel-caption'>";

            //        strBannerLarger += "<a href='" + row["MenuLinksUrl"] + "' target='" + row["Target"] + "'>";
            //         strBannerLarger += "<h1>" + row["MenuLinksName"] + "</h1>";
            //         strBannerLarger += "</a>";
            //         strBannerLarger += "<p class='blurb whitealpha hidden-xs'>";
            //        strBannerLarger += row["MenuLinksHelp"] + "";
            //        strBannerLarger += "</p>";

            //        //if (row["MenuLinksUrl"].ToString() != "" & row["MenuLinksUrl"].ToString() != "#")
            //        //{
            //        //    strBannerLarger += "<p>";
            //        //    strBannerLarger += "<a class='btn btn-lg btn-primary'  role='button' href='" + row["MenuLinksUrl"] + "' target='" + row["Target"] + "'>Chi tiết... </a>";
            //        //    strBannerLarger += "</p>";
            //        //}

            //        strBannerLarger += "</div>";
            //        strBannerLarger += "</div>";

            //    }
            //    strBannerLarger += "</div>";
            //    // strBannerThumb += "<li><img src='" + Utils.getURLThumbImage(ResolveUrl("~/") + "Upload/MenuLinks/" + row["MenuLinksIcon"] , 70) + "' /></li>";
            //    //strBannerThumb += "<li><img src='" + ResolveUrl("~/") + "img.ashx?url=" + ResolveUrl("~/") + "Upload/MenuLinks/" + row["MenuLinksIcon"] + "&w=70' /></li>";
            //    strBannerThumb += "<li data-target='#sliderBanner' data-slide-to='" + i + "' " + ((i == 0) ? "class='active'" : "") + " ></li>";
            //}
        }
        //ltlBannerLarger.Text = strBannerLarger;
        //ltlBannerThumb.Text = strBannerThumb;
    }
예제 #15
0
    protected void initControl(int ID)
    {
        if (ID > 0)
        {
            txtMenuLinksID.Value = Convert.ToString(ID);
            btn_add.Visible      = false;
            btn_edit.Visible     = true;

            btn_add1.Visible  = false;
            btn_add2.Visible  = false;
            btn_edit1.Visible = true;
            try
            {
                MenuLinksBSO menuLinksBSO = new MenuLinksBSO();

                MenuLinks menuLinksRows = menuLinksBSO.GetMenuLinksById(ID);
                ddlMenuLinks.SelectedValue = menuLinksRows.MenuLinksParent.ToString();
                txtMenuLinksName.Text      = menuLinksRows.MenuLinksName;
                txtMenuLinksUrl.Text       = menuLinksRows.MenuLinksUrl;
                txtRadHelp.Text            = menuLinksRows.MenuLinksHelp;
                hddIcon.Value    = menuLinksRows.MenuLinksIcon;
                hddFile.Value    = menuLinksRows.FileName;
                txtimage4_3.Text = menuLinksRows.MenuLinksIcon;
                txtFileName.Text = menuLinksRows.FileName;

                rdbStatus.Checked       = menuLinksRows.Status;
                rdbIsView.Checked       = menuLinksRows.IsView;
                chkFlash.Checked        = menuLinksRows.IsFlash;
                txtPosition.Text        = menuLinksRows.Position;
                ddlTarget.SelectedValue = menuLinksRows.Target.ToString();
                txtWidth.Text           = menuLinksRows.Width.ToString();
                txtHeight.Text          = menuLinksRows.Height.ToString();
                hddHit.Value            = menuLinksRows.Hit.ToString();

                if (menuLinksRows.IsFlash)
                {
                    txtFileName.Visible   = true;
                    panelFilename.Visible = true;
                }
                else
                {
                    txtFileName.Visible   = false;
                    panelFilename.Visible = false;
                }

                if (menuLinksRows.MenuLinksIcon != "")
                {
                    img_thumb.Text = "<img src='" + menuLinksRows.MenuLinksIcon + "' width='48px'>";
                }
                if (menuLinksRows.IsFlash && menuLinksRows.FileName != "")
                {
                    ltlFileName.Text = "<a href='" + menuLinksRows.FileName + "' target = '_blank'>File Flash</a>";
                }
            }
            catch (Exception ex)
            {
                clientview.Text = ex.Message.ToString();
            }
        }
        else
        {
            ddlMenuLinks.SelectedIndex = 0;
            btn_add.Visible            = true;
            btn_edit.Visible           = false;

            btn_add1.Visible  = true;
            btn_add2.Visible  = true;
            btn_edit1.Visible = false;

            chkFlash.Checked      = false;
            txtFileName.Visible   = false;
            panelFilename.Visible = false;
        }
    }