Example #1
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            base.NeedLogin = true;
            base.ReturnUrl = base.Request.RawUrl;
            int queryInt = WebUtils.GetQueryInt("id");

            if (this.Action.Equals("cancel"))
            {
                FavoritesInfo dataById = Favorites.GetDataById(queryInt);
                if (dataById != null)
                {
                    Favorites.Delete(queryInt);
                }
                base.Response.Redirect(UrlRewrite.Get("myfavorite_url"));
            }
            this.PageSize   = 12;
            this.Condition  = "1=1 AND UserID=" + base.UserID.ToString();
            this.UrlPattern = UrlRewrite.Get("myfavorite_url") + "?page=$page";
            DataSet   pagerDataExt = Favorites.GetPagerDataExt(" * ", this.Condition, this.Sort, this.PageSize, this.PageIndex, ref this.TotalCount, ref this.TotalPage);
            DataTable dataTable    = (pagerDataExt != null && pagerDataExt.Tables.Count > 0) ? pagerDataExt.Tables[0] : new DataTable();
            CMSPager  pager        = this.contents.GetPager(this.TotalCount, this.PageIndex, this.PageSize, this.UrlPattern);

            base.Put("pager", pager);
            base.Put("jcdatas", dataTable.Rows);
            base.Put("condition", this.Condition);
            base.UsingClient("user/我的收藏.html");
        }
Example #2
0
        protected void AutoPageing <T>(T model) where T : IEntity
        {
            IList <T> lst   = PageBase.dbo.GetPager2005 <T>(model.DBTableName, this.Condition, this.Sort, this.PageSize, this.PageIndex, ref this.TotalCount, ref this.TotalPage);
            CMSPager  pager = this.contents.GetPager(this.TotalCount, this.PageIndex, this.PageSize, this.UrlPattern);

            base.Put("pager", pager);
            base.Put("jcdatas", lst);
            base.Put("condition", this.Condition);
        }
Example #3
0
        private void GetEvaPagerFun()
        {
            int      queryInt  = WebUtils.GetQueryInt("pageindex", 1);
            int      queryInt2 = WebUtils.GetQueryInt("pagesize", 20);
            int      count     = Evaluation.GetCount(" ProID=" + WebUtils.GetQueryInt("pid", 0) + " AND IsAudit=1 ");
            CMSPager cMSPager  = new CMSPager(count, queryInt2);

            cMSPager.UrlPattern = "geteva($page)";
            cMSPager.PageIndex  = queryInt;
            cMSPager.Calculate();
            base.Put("evapager", cMSPager);
            base.UsingClient("inc/_evapagerfun.html");
        }
Example #4
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            base.NeedLogin  = true;
            base.ReturnUrl  = base.Request.RawUrl;
            this.PageSize   = 12;
            this.Condition  = " 1=1 AND UserName='******' AND IsUsed=0 AND GETDATE()<EndTime ";
            this.UrlPattern = UrlRewrite.Get("coupons_url") + "?page=$page";
            DataSet   pagerData = SinGooCMS.BLL.Coupons.GetPagerData("*,(case when DATEDIFF(HOUR,GETDATE(),EndTime) between 0 and 24 then 1 else 0 end) as willexpire", this.Condition, this.Sort, this.PageSize, this.PageIndex, ref this.TotalCount, ref this.TotalPage);
            DataTable dataTable = (pagerData != null && pagerData.Tables.Count > 0) ? pagerData.Tables[0] : new DataTable();
            CMSPager  pager     = this.contents.GetPager(this.TotalCount, this.PageIndex, this.PageSize, this.UrlPattern);

            base.Put("pager", pager);
            base.Put("jcdatas", dataTable.Rows);
            base.Put("condition", this.Condition);
            base.UsingClient("user/优惠券.html");
        }
Example #5
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string   queryString   = WebUtils.GetQueryString("key");
            NodeInfo cacheNodeById = SinGooCMS.BLL.Node.GetCacheNodeById(WebUtils.GetQueryInt("nid"));
            int      appSetting    = ConfigUtils.GetAppSetting <int>("SearchPageSize", 10);

            this.strUrlPattern = this.strUrlPattern + "?key=" + queryString;
            this.strCondition  = this.strCondition + " AND Title LIKE '%" + StringUtils.ChkSQL(queryString) + "%' ";
            if (cacheNodeById != null)
            {
                this.strUrlPattern = this.strUrlPattern + "&nid=" + cacheNodeById.AutoID;
                this.strCondition  = this.strCondition + " AND NodeID in (" + cacheNodeById.ChildList + ") ";
            }
            this.strUrlPattern += "&page=$page";
            CMSPager pager = this.contents.GetPager(this.contents.GetCount(this.strCondition), this.intCurrentPage, appSetting, this.strUrlPattern);

            base.Put("searchconts", this.contents.GetContents(0, this.strCondition, "Sort asc,AutoID desc", this.intCurrentPage, appSetting));
            base.Put("pager", pager);
            base.UsingClient("搜索.html");
        }
Example #6
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string queryString  = WebUtils.GetQueryString("key");
            string queryString2 = WebUtils.GetQueryString("lang");

            this.strUrlPattern = this.strUrlPattern + "?key=" + HttpUtility.UrlEncode(queryString);
            if (!string.IsNullOrEmpty(queryString2))
            {
                this.strUrlPattern = this.strUrlPattern + "&lang=" + queryString2;
            }
            this.strUrlPattern += "&page=$page";
            if (!string.IsNullOrEmpty(queryString))
            {
                this.strCondition = this.strCondition + " AND charindex('," + StringUtils.ChkSQL(queryString) + ",',','+TagKey+',')>0 ";
            }
            CMSPager pager = this.contents.GetPager(this.contents.GetCount(this.strCondition), this.intCurrentPage, 10, this.strUrlPattern);

            base.Put("contlist", this.contents.GetContents(0, this.strCondition, "Sort asc,AutoID desc", this.intCurrentPage, 10));
            base.Put("pager", pager);
            base.UsingClient("标签.html");
        }
Example #7
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            base.NeedLogin = true;
            base.ReturnUrl = Request.RawUrl;
            if (base.IsPost && base.UserID != -1)
            {
                string text    = WebUtils.GetFormString("_action", "add").ToLower();
                int    formInt = WebUtils.GetFormInt("_idcom");

                CustomerInfo com = new CustomerInfo();
                if (text.Equals("modify"))
                {
                    com = Customer.GetDataById(formInt);
                }
                com.PortName        = WebUtils.GetFormString("name");
                com.Address         = WebUtils.GetFormString("address");
                com.CargoThroughput = WebUtils.GetFormString("country");
                if (text == "del")
                {
                    if (Customer.Delete(formInt))
                    {
                        base.WriteJsonTip(true, base.GetCaption("Comp_Success"));
                    }
                    else
                    {
                        base.WriteJsonTip(base.GetCaption("Comp_DeleteFail"));
                    }
                }
                else if (string.IsNullOrEmpty(com.PortName))
                {
                    base.WriteJsonTip(base.GetCaption("Comp_NameNotEmpty"));
                }
                else if (string.IsNullOrEmpty(com.Address))
                {
                    base.WriteJsonTip(base.GetCaption("Comp_AddressNotEmpty"));
                }
                else if (string.IsNullOrEmpty(com.CargoThroughput))
                {
                    base.WriteJsonTip(base.GetCaption("Comp_PhoneNotEmpty"));
                }
                else if (text == "modify")
                {
                    if (Customer.Update(com))
                    {
                        base.WriteJsonTip(true, base.GetCaption("Comp_Success"));
                    }
                    else
                    {
                        base.WriteJsonTip(base.GetCaption("Comp_UpdateFail"));
                    }
                }
                else
                {
                    com.AutoTimeStamp = System.DateTime.Now;
                    int num = Customer.Add(com);
                    if (num > 0)
                    {
                        base.WriteJsonTip(true, base.GetCaption("Comp_Success"));
                    }
                    else
                    {
                        base.WriteJsonTip(base.GetCaption("Comp_AddFail"));
                    }
                }
            }


            else
            {
                int pageSize = 15;

                StringBuilder builderCondition = new StringBuilder(" 1=1 ");

                string strSort = " AutoID desc ";

                StringBuilder builderUrlPattern = new StringBuilder(base.ResolveUrl("~/List_Customer.aspx"));
                builderUrlPattern.Append("?");
                builderUrlPattern.Append("&page=$page");

                CMSPager pager = contents.GetPager(BLL.Customer.GetCount(builderCondition.ToString()), intCurrentPage, pageSize, builderUrlPattern.ToString());
                base.Put("pager", pager);
                IList <CustomerInfo> Customer = BLL.Customer.GetPagerList(builderCondition.ToString(), strSort, pager.PageIndex, pager.PageSize, ref intTotalCount, ref intTotalPage);
                base.Put("cus", Customer);
                base.UsingClient("add/add_Customer.html");
            }
        }