Exemple #1
0
    private string CreateList()
    {
        StringBuilder sb = new StringBuilder();

        string where = "Issue=1 and Language='" + strLanguage + "'";

        if (ViewState["pk_Category"] != null)
        {
            where += " and (CategoryID1=" + ViewState["pk_Category"].ToString() + " or CategoryID2=" + ViewState["pk_Category"].ToString() + ")";
        }

        MojoCube.Api.UI.WebPager pager = new MojoCube.Api.UI.WebPager(ListPager);
        pager.Language               = strLanguage;
        pager.ConnStr                = MojoCube.Web.Connection.ConnString();
        pager.PageSize               = MojoCube.Web.String.PageSize("album");
        pager.TableName              = "Album_List";
        pager.strGetFields           = "*";
        pager.where                  = where;
        pager.fldName                = "CreateDate";
        pager.OrderType              = true;
        ListPager.NumericButtonCount = MojoCube.Web.String.GetNumericButtonCount();
        ListPager.EnableUrlRewriting = true;

        if (Request.QueryString["pageName"] != null)
        {
            ListPager.UrlRewritePattern = MojoCube.Web.Site.Cache.GetUrlExtension("AC-%pageName%", strLanguage) + "?page={0}";
        }
        else
        {
            ListPager.UrlRewritePattern = MojoCube.Web.Site.Cache.GetUrlExtension("Album", strLanguage) + "?page={0}";
        }

        DataTable dt = new DataTable();

        dt = pager.GetTable();

        if (dt.Rows.Count > 0)
        {
            string url   = string.Empty;
            string title = string.Empty;
            string img   = string.Empty;

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                url   = MojoCube.Web.Site.Cache.GetUrlExtension("A-" + dt.Rows[i]["PageName"].ToString(), strLanguage);
                title = dt.Rows[i]["Title"].ToString();
                img   = "Files.aspx?image=" + MojoCube.Api.Text.Security.EncryptString(dt.Rows[i]["ImagePath"].ToString()) + "&w=500&h=500";

                sb.Append("<li class=\"col-sm-4 col-md-3 col-mm-6\">");
                sb.Append("<div class=\"albumImg\" data-responsive='' data-src='" + img + "' data-sub-html=''>");
                sb.Append("<img class=\"viewBig\" src=\"" + img + "\" alt=\"" + title + "\" />");
                sb.Append("</div>");
                sb.Append("<a class=\"albumTitle\" href=\"" + url + "\" title=\"" + title + "\">" + title + "</a>");
                sb.Append("</li>");
            }
        }

        return(sb.ToString());
    }
Exemple #2
0
    private string CreateList()
    {
        StringBuilder sb = new StringBuilder();

        MojoCube.Api.UI.WebPager pager = new MojoCube.Api.UI.WebPager(ListPager);
        pager.Language               = strLanguage;
        pager.ConnStr                = MojoCube.Web.Connection.ConnString();
        pager.PageSize               = MojoCube.Web.String.PageSize("product");
        pager.TableName              = "View_Member_Favorite";
        pager.strGetFields           = "*";
        pager.where                  = "fk_Member=" + Session["Member_UserID"].ToString();
        pager.fldName                = "CreateDate";
        pager.OrderType              = true;
        ListPager.NumericButtonCount = MojoCube.Web.String.GetNumericButtonCount();
        ListPager.EnableUrlRewriting = true;

        ListPager.UrlRewritePattern = MojoCube.Web.Site.Cache.GetUrlExtension("Favorite", strLanguage) + "?page={0}";

        DataTable dt = new DataTable();

        dt = pager.GetTable();

        if (dt.Rows.Count > 0)
        {
            string url   = string.Empty;
            string del   = string.Empty;
            string title = string.Empty;

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                url   = MojoCube.Web.Site.Cache.GetUrlExtension("P-" + dt.Rows[i]["PageName"].ToString(), strLanguage);
                del   = MojoCube.Web.Site.Cache.GetUrlExtension("FavoriteAdd", strLanguage) + "?del=" + MojoCube.Api.Text.Security.EncryptString(dt.Rows[i]["pk_Favorite"].ToString());
                title = dt.Rows[i]["ProductName"].ToString();

                sb.Append("<li class=\"col-sm-4 col-md-3 col-mm-6\">");
                sb.Append("<div class=\"productImg\">");
                sb.Append("<img src=\"Files.aspx?image=" + MojoCube.Api.Text.Security.EncryptString(dt.Rows[i]["ImagePath"].ToString()) + "&w=500&h=500\" alt=\"" + title + "\" />");
                sb.Append("<span>" + title + "</span>");
                sb.Append("<a class=\"productTitle\" href=\"" + url + "\" title=\"" + title + "\">查看详情</a>&nbsp;&nbsp;");
                sb.Append("<a class=\"productTitle\" href=\"" + del + "\" title=\"" + title + "\" style=\"background:#C10404\">删除收藏</a>");
                sb.Append("<div class=\"price_item\">" + MojoCube.Web.String.GetCurrency(decimal.Parse(dt.Rows[i]["Price"].ToString())) + "</div>");
                sb.Append("</div>");
                sb.Append("</li>");
            }
        }

        return(sb.ToString());
    }
Exemple #3
0
    private void GridBind()
    {
        MojoCube.Api.UI.WebPager pager = new MojoCube.Api.UI.WebPager(ListPager);
        pager.Language               = strLanguage;
        pager.ConnStr                = MojoCube.Web.Connection.ConnString();
        pager.PageSize               = MojoCube.Web.String.PageSize("message");
        pager.TableName              = "Member_Message";
        pager.strGetFields           = "*";
        pager.where                  = "ReceiveUserID=" + Session["Member_UserID"].ToString() + " and IsDeleted=0";
        pager.fldName                = "CreateDate";
        pager.OrderType              = true;
        ListPager.NumericButtonCount = MojoCube.Web.String.GetNumericButtonCount();
        ListPager.EnableUrlRewriting = true;

        ListPager.UrlRewritePattern = MojoCube.Web.Site.Cache.GetUrlExtension("Message", strLanguage) + "?page={0}";

        GridView1.DataSource = pager.GetTable();
        GridView1.DataBind();
    }
Exemple #4
0
    private void GridBind()
    {
        MojoCube.Api.UI.WebPager pager = new MojoCube.Api.UI.WebPager(ListPager);
        pager.Language     = strLanguage;
        pager.ConnStr      = MojoCube.Web.Connection.ConnString();
        pager.PageSize     = MojoCube.Web.String.PageSize("order");
        pager.TableName    = "Order_List";
        pager.strGetFields = "*";

        string where = string.Empty;

        if (ViewState["StatusID"] != null)
        {
            where = "fk_Member=" + Session["Member_UserID"].ToString() + " and IsDeleted=0 and IsComment=0 and StatusID=" + ViewState["StatusID"].ToString();
        }
        else
        {
            where = "fk_Member=" + Session["Member_UserID"].ToString() + " and IsDeleted=0";
        }

        if (txtKeyword.Text.Trim() != null)
        {
            where += " and (OrderNumber like '%" + txtKeyword.Text.Trim() + "%' or Description like '%" + txtKeyword.Text.Trim() + "%')";
        }

        pager.where     = where;
        pager.fldName   = "CreateDate";
        pager.OrderType = true;
        ListPager.NumericButtonCount = MojoCube.Web.String.GetNumericButtonCount();
        ListPager.EnableUrlRewriting = true;

        ListPager.UrlRewritePattern = MojoCube.Web.Site.Cache.GetUrlExtension("Order", strLanguage) + "?status=%status%&page={0}";

        GridView1.DataSource = pager.GetTable();
        GridView1.DataBind();

        if (GridView1.Rows.Count == 0)
        {
            Panel1.Visible = false;
            Panel2.Visible = true;
        }
    }
    private string CreateList()
    {
        StringBuilder sb = new StringBuilder();

        string where = "Issue=1 and Language='" + strLanguage + "'";

        if (ViewState["pk_Category"] != null)
        {
            where += " and (CategoryID1=" + ViewState["pk_Category"].ToString() + " or CategoryID2=" + ViewState["pk_Category"].ToString() + ")";
        }

        if (Request.QueryString["q"] != null)
        {
            string keyword = MojoCube.Api.Text.CheckSql.Filter(Request.QueryString["q"]);
            hlTitle.Text = keyword;
            where       += " and (Title like '%" + keyword + "%' or Description like '%" + keyword + "%')";

            //加入搜索记录
            MojoCube.Web.Site.Search.InsertData(keyword, 1);
        }

        MojoCube.Api.UI.WebPager pager = new MojoCube.Api.UI.WebPager(ListPager);
        pager.Language               = strLanguage;
        pager.ConnStr                = MojoCube.Web.Connection.ConnString();
        pager.PageSize               = MojoCube.Web.String.PageSize("article");
        pager.TableName              = "Article_List";
        pager.strGetFields           = "*";
        pager.where                  = where;
        pager.fldName                = "CreateDate desc,pk_Article";
        pager.OrderType              = true;
        ListPager.NumericButtonCount = MojoCube.Web.String.GetNumericButtonCount();
        ListPager.EnableUrlRewriting = true;

        if (Request.QueryString["pageName"] != null)
        {
            ListPager.UrlRewritePattern = MojoCube.Web.Site.Cache.GetUrlExtension("NC-%pageName%", strLanguage) + "?page={0}";
        }
        else if (Request.QueryString["q"] != null)
        {
            ListPager.UrlRewritePattern = MojoCube.Web.Site.Cache.GetUrlExtension("News", strLanguage) + "?q=%q%&page={0}";
        }
        else
        {
            ListPager.UrlRewritePattern = MojoCube.Web.Site.Cache.GetUrlExtension("News", strLanguage) + "?page={0}";
        }

        DataTable dt = new DataTable();

        dt = pager.GetTable();

        if (dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DateTime time = DateTime.Parse(dt.Rows[i]["CreateDate"].ToString());

                sb.Append("<li>");
                sb.Append("<a class=\"wrapper\" href=\"" + MojoCube.Web.Site.Cache.GetUrlExtension("N-" + dt.Rows[i]["PageName"].ToString(), strLanguage) + "\">");
                sb.Append("<div class=\"time\">");
                sb.Append("<div class=\"day\">" + time.ToString("dd") + "</div>");
                sb.Append("<div class=\"date\">" + time.ToString("yyyy/MM") + "</div>");
                sb.Append("</div>");
                if (dt.Rows[i]["ImagePath"].ToString() != "")
                {
                    string img = "Files.aspx?image=" + MojoCube.Api.Text.Security.EncryptString(dt.Rows[i]["ImagePath"].ToString()) + "&w=500&h=500";
                    sb.Append("<img src=\"" + img + "\" />");
                }
                else
                {
                    sb.Append("<img src=\"Images/no_image.jpg\" />");
                }
                sb.Append("<span>" + dt.Rows[i]["Title"].ToString() + "</span>");
                sb.Append("<p>" + MojoCube.Api.Text.Content.GetContentSummary(dt.Rows[i]["Description"].ToString(), 150, true) + "</p>");
                sb.Append("</a>");
                sb.Append("</li>");
            }
        }

        return(sb.ToString());
    }
Exemple #6
0
    private string CreateList()
    {
        StringBuilder sb = new StringBuilder();

        string where = "Issue=1 and Language='" + strLanguage + "'";

        if (ViewState["pk_Category"] != null)
        {
            where += " and (CategoryID1=" + ViewState["pk_Category"].ToString() + " or CategoryID2=" + ViewState["pk_Category"].ToString() + ")";
        }

        if (Request.QueryString["q"] != null)
        {
            string keyword = MojoCube.Api.Text.CheckSql.Filter(Request.QueryString["q"]);
            hlTitle.Text = keyword;
            where       += " and (ProductName like '%" + keyword + "%' or Number like '%" + keyword + "%')";

            //加入搜索记录
            MojoCube.Web.Site.Search.InsertData(keyword, 0);
        }

        MojoCube.Api.UI.WebPager pager = new MojoCube.Api.UI.WebPager(ListPager);
        pager.Language               = strLanguage;
        pager.ConnStr                = MojoCube.Web.Connection.ConnString();
        pager.PageSize               = MojoCube.Web.String.PageSize("product");
        pager.TableName              = "Product_List";
        pager.strGetFields           = "*";
        pager.where                  = where;
        pager.fldName                = "CreateDate desc,pk_Product";
        pager.OrderType              = true;
        ListPager.NumericButtonCount = MojoCube.Web.String.GetNumericButtonCount();
        ListPager.EnableUrlRewriting = true;

        if (Request.QueryString["pageName"] != null)
        {
            ListPager.UrlRewritePattern = MojoCube.Web.Site.Cache.GetUrlExtension("PC-%pageName%", strLanguage) + "?page={0}";
        }
        else if (Request.QueryString["q"] != null)
        {
            ListPager.UrlRewritePattern = MojoCube.Web.Site.Cache.GetUrlExtension("Product", strLanguage) + "?q=%q%&page={0}";
        }
        else
        {
            ListPager.UrlRewritePattern = MojoCube.Web.Site.Cache.GetUrlExtension("Product", strLanguage) + "?page={0}";
        }

        DataTable dt = new DataTable();

        dt = pager.GetTable();

        if (dt.Rows.Count > 0)
        {
            string url   = string.Empty;
            string title = string.Empty;

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                url   = MojoCube.Web.Site.Cache.GetUrlExtension("P-" + dt.Rows[i]["PageName"].ToString(), strLanguage);
                title = dt.Rows[i]["ProductName"].ToString();

                sb.Append("<li class=\"col-sm-4 col-md-3 col-mm-6\">");
                sb.Append("<div class=\"productImg\">");
                sb.Append("<img src=\"Files.aspx?image=" + MojoCube.Api.Text.Security.EncryptString(dt.Rows[i]["ImagePath"].ToString()) + "&w=500&h=500\" alt=\"" + title + "\" />");
                sb.Append("<span>" + title + "</span>");
                sb.Append("<a class=\"productTitle\" href=\"" + url + "\" title=\"" + title + "\">查看详情</a>");
                sb.Append("<div class=\"price_item\">" + MojoCube.Web.String.GetCurrency(decimal.Parse(dt.Rows[i]["Price"].ToString())) + "</div>");
                sb.Append("</div>");
                sb.Append("</li>");
            }
        }

        return(sb.ToString());
    }