Ejemplo n.º 1
0
 /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Method[@name="OnInit"]/*'/>
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     if (null != CloneFrom && string.Empty != CloneFrom.Trim())
     {
         AspNetPager ctrl = Parent.FindControl(CloneFrom) as AspNetPager;
         if (null == ctrl)
         {
             string errStr = SR.GetString("clonefromexeption") ??
                             "The control \" %controlID% \" does not exist or is not of type Wuqi.Webdiyer.AspNetPager!";
             throw new ArgumentException(errStr.Replace("%controlID%", CloneFrom), "CloneFrom");
         }
         if (null != ctrl.cloneFrom && this == ctrl.cloneFrom)
         {
             string errStr = SR.GetString("recusiveclonefrom") ??
                             "Invalid value for the CloneFrom property, AspNetPager controls can not to be cloned recursively!";
             throw new ArgumentException(errStr, "CloneFrom");
         }
         cloneFrom       = ctrl;
         CssClass        = cloneFrom.CssClass;
         Width           = cloneFrom.Width;
         Height          = cloneFrom.Height;
         HorizontalAlign = cloneFrom.HorizontalAlign;
         BackColor       = cloneFrom.BackColor;
         BackImageUrl    = cloneFrom.BackImageUrl;
         BorderColor     = cloneFrom.BorderColor;
         BorderStyle     = cloneFrom.BorderStyle;
         BorderWidth     = cloneFrom.BorderWidth;
         Font.CopyFrom(cloneFrom.Font);
         ForeColor       = cloneFrom.ForeColor;
         EnableViewState = cloneFrom.EnableViewState;
         Enabled         = cloneFrom.Enabled;
     }
 }
Ejemplo n.º 2
0
 /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Method[@name="OnInit"]/*'/>
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     if (null != CloneFrom && string.Empty != CloneFrom.Trim())
     {
         AspNetPager ctrl = Parent.FindControl(CloneFrom) as AspNetPager;
         if (null == ctrl)
         {
             string errStr = SR.GetString("def_CloneFromTypeError");
             throw new ArgumentException(errStr.Replace("%controlID%", CloneFrom), "CloneFrom");
         }
         if (null != ctrl.cloneFrom && this == ctrl.cloneFrom)
         {
             string errStr = SR.GetString("def_RecursiveCloneFrom");
             throw new ArgumentException(errStr, "CloneFrom");
         }
         cloneFrom       = ctrl;
         CssClass        = cloneFrom.CssClass;
         Width           = cloneFrom.Width;
         Height          = cloneFrom.Height;
         HorizontalAlign = cloneFrom.HorizontalAlign;
         BackColor       = cloneFrom.BackColor;
         BackImageUrl    = cloneFrom.BackImageUrl;
         BorderColor     = cloneFrom.BorderColor;
         BorderStyle     = cloneFrom.BorderStyle;
         BorderWidth     = cloneFrom.BorderWidth;
         Font.CopyFrom(cloneFrom.Font);
         ForeColor       = cloneFrom.ForeColor;
         EnableViewState = cloneFrom.EnableViewState;
         Enabled         = cloneFrom.Enabled;
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 获取全部的日志文件
 /// </summary>
 /// <param name="flag"></param>
 /// <param name="AspNetPager1"></param>
 /// <returns></returns>
 public static DataTable GetLog(int flag, AspNetPager AspNetPager1)
 {
     string tab = "systemlog,Users";
     string fild = "id,ip,date,url,TrueName";
     string ord = "date";
     string where = "systemlog.username=Users.UserName";
     return SystemlogOpera1.GetAllSystemLog(flag, tab, fild, ord, AspNetPager1, true, where);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 获取某个时间短的日志
 /// </summary>
 /// <param name="flag"></param>
 /// <param name="AspNetPager1"></param>
 /// <param name="starttime"></param>
 /// <param name="endtime"></param>
 /// <returns></returns>
 public static DataTable GetSysLogsBetweenTimes(int flag, AspNetPager AspNetPager1, DateTime starttime, DateTime endtime)
 {
     string tab = "systemlog,Users";
     string fild = "id,ip,date,url,TrueName";
     string ord = "date";
     string where = "systemlog.username=Users.UserName and systemlog.date between '"+starttime+"' and '"+endtime+"'";
     return SystemlogOpera1.GetAllSystemLog(flag, tab, fild, ord, AspNetPager1, true, where);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 初始化分页
 /// </summary>
 public void InitPager(Wuqi.Webdiyer.AspNetPager pager)
 {
     CommonClass.Control.Pagination.AspNetPager.AspNetPagerClass pageClass = new CommonClass.Control.Pagination.AspNetPager.AspNetPagerClass(pager);
     pageClass.PageIndex   = this.PageIndex;
     pageClass.PageSize    = this.PageSize;
     pageClass.RecordCount = this.RecordCount;
     pageClass.InitPager();
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 分页数据绑定(列表控件和数据控件)
 /// </summary>
 /// <param name="ctrl">绑定控件</param>
 /// <param name="source">数据源</param>
 /// <param name="pager">分页控件</param>
 public static void BindControl(DataBoundControl ctrl, DataSet source, AspNetPager pager)
 {
     if (source.Tables.Count < 1)
         return;
     ctrl.DataSource = source.Tables[0];
     ctrl.DataBind();
     pager.RecordCount = Convert.ToInt32(source.Tables[1].Rows[0][0]);
     pager.SetRewriteUrl();
 }
Ejemplo n.º 7
0
        public DataTable GetAllPrintByqueueid(int flag, AspNetPager AspNetPager1, int queueid)
        {
            string tab = "dbo.GuZhangSecond,dbo.FaultQueue";
            string filed = "dbo.FaultQueue.faultid,dbo.GuZhangSecond.name,dbo.GuZhangSecond.GuZhangContent,dbo.GuZhangSecond.Address,dbo.GuZhangSecond.phone,dbo.GuZhangSecond.ReceivedDate";
            string where = "dbo.FaultQueue.queueid=" + queueid + " and dbo.FaultQueue.faultid=dbo.GuZhangSecond.GuZhangSecondID";
            string fld = "dbo.FaultQueue.Priority";

            return fqo.GetprintQueue(flag,tab,filed,fld,AspNetPager1,false,where);
        }
Ejemplo n.º 8
0
        /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Method[@name="GetDesignTimeHtml"]/*'/>
        public override string GetDesignTimeHtml()
        {
            wb             = (AspNetPager)Component;
            wb.RecordCount = 225;
            StringWriter   sw     = new StringWriter();
            HtmlTextWriter writer = new HtmlTextWriter(sw);

            wb.RenderControl(writer);
            return(sw.ToString());
        }
Ejemplo n.º 9
0
        /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Method[@name="GetDesignTimeHtml"]/*'/>
        public override string GetDesignTimeHtml()
        {

            wb = (AspNetPager)Component;
            wb.RecordCount = 225;
            StringWriter sw = new StringWriter();
            HtmlTextWriter writer = new HtmlTextWriter(sw);
            wb.RenderControl(writer);
            return sw.ToString();
        }
Ejemplo n.º 10
0
    public static PagedDataSource GetPageDataSource(Wuqi.Webdiyer.AspNetPager AspNetPager1, int currentIndex, DataTable dt)
    {
        PagedDataSource source = new PagedDataSource();

        AspNetPager1.RecordCount = dt.Rows.Count;
        source.DataSource        = dt.DefaultView;
        source.AllowPaging       = true;
        source.CurrentPageIndex  = currentIndex;
        source.PageSize          = AspNetPager1.PageSize;
        return(source);
    }
Ejemplo n.º 11
0
 /// <summary>
 /// 删除时,调用方法,更新当前数据页索引
 /// </summary>
 /// <param name="rptItemCount">数据列表个数</param>
 /// <param name="iDelCount">删除数据个数</param>
 /// <param name="aspNetPager">分页控件</param>
 public void UpdatePgaeIndex(int rptItemCount, int iDelCount, AspNetPager aspNetPager)
 {
     //删除记录数与当前列表数,并且为最后一页,不为第一页
     if (rptItemCount == iDelCount &&
         aspNetPager.CurrentPageIndex == aspNetPager.PageCount &&
         aspNetPager.CurrentPageIndex != 1
        )
     {
         aspNetPager.CurrentPageIndex = aspNetPager.CurrentPageIndex - 1;
     }
 }
Ejemplo n.º 12
0
    protected void Pager(GridView dl, Wuqi.Webdiyer.AspNetPager anp, System.Data.DataSet dst)
    {
        PagedDataSource pds = new PagedDataSource();

        pds.DataSource       = dst.Tables[0].DefaultView;
        pds.AllowPaging      = true;
        anp.RecordCount      = dst.Tables[0].DefaultView.Count;
        pds.CurrentPageIndex = anp.CurrentPageIndex - 1;
        pds.PageSize         = anp.PageSize;
        dl.DataSource        = pds;
        dl.DataBind();
    }
        public void GridViewPagerBind(AspNetPager anpager, string strWhere, string strOrder, GridView grvControl)
        {
            int iRowCount = 0;
            int row1 = (anpager.CurrentPageIndex - 1) * anpager.PageSize + 1;
            int row2 = anpager.CurrentPageIndex * anpager.PageSize;
            grvControl.DataSource = dal.GridViewData(strWhere, strOrder, row1, row2, ref iRowCount);
            grvControl.DataBind();
            anpager.RecordCount = iRowCount;

            anpager.CustomInfoHTML = "共<font color=\"blue\"><b>" + anpager.RecordCount.ToString() + "</b></font>条记录";
            anpager.CustomInfoHTML += " 共<font color=\"blue\"><b>" + anpager.PageCount.ToString() + "</b></font>页";
            anpager.CustomInfoHTML += " 当前第<font color=\"red\"><b>" + anpager.CurrentPageIndex.ToString() + "</b></font>页";
        }
Ejemplo n.º 14
0
        /// <summary>
        /// 全部数据用AspNetPager分页绑定,Repeater,GridView,DataList
        /// </summary>
        /// <param name="ie">实现IEnumerable的数据源</param>
        /// <param name="ctl_Listctl">列表控件</param>
        /// <param name="AspNetPager1"></param>
        public static void BindCtrl(IEnumerable ie, Control ctl_Listctl, AspNetPager AspNetPager1)
        {
            PagedDataSource PDS = new PagedDataSource();

            PDS.DataSource = ie;

            if (ie is DataTable)

                AspNetPager1.RecordCount = ((DataTable)ie).Rows.Count;

            if (ie is IList)

                AspNetPager1.RecordCount = ((IList)ie).Count;

            int cPageIndex = AspNetPager1.CurrentPageIndex;

            if (cPageIndex > 1)

                PDS.CurrentPageIndex = cPageIndex - 1;

            PDS.AllowPaging = true;

            PDS.PageSize = AspNetPager1.PageSize;

            if (ctl_Listctl is Repeater)
            {

                ((Repeater)ctl_Listctl).DataSource = PDS;

                ((Repeater)ctl_Listctl).DataBind();

            }

            if (ctl_Listctl is DataList)
            {

                ((DataList)ctl_Listctl).DataSource = PDS;

                ((DataList)ctl_Listctl).DataBind();

            }

            if (ctl_Listctl is GridView)
            {

                ((GridView)ctl_Listctl).DataSource = PDS;

                ((GridView)ctl_Listctl).DataBind();

            }
        }
        protected void GridViewPagerBind(AspNetPager anpager, GridView gv, string queryWhere, string queryOrder)
        {
            int rowCount = 0;
            int startRowNo = (anpager.CurrentPageIndex - 1) * anpager.PageSize + 1;
            int endRowNo = anpager.CurrentPageIndex * anpager.PageSize;

            gv.DataSource = noteReciver.GridViewAndPager(queryWhere, queryOrder, startRowNo, endRowNo, out rowCount);
            gv.DataBind();

            anpager.RecordCount = rowCount;

            anpager.CustomInfoHTML = "共<font color=\"blue\"><b>" + anpager.RecordCount.ToString() + "</b></font>条记录";
            anpager.CustomInfoHTML += " 共<font color=\"blue\"><b>" + anpager.PageCount.ToString() + "</b></font>页";
            anpager.CustomInfoHTML += " 当前第<font color=\"red\"><b>" + anpager.CurrentPageIndex.ToString() + "</b></font>页";
        }
Ejemplo n.º 16
0
        private void AddPager(Panel p)
        {
            this.pager = new AspNetPager();
            this.pager.ID = "Pager";
            this.pager.CssClass = "pager";
            this.pager.UrlPaging = true;
            this.pager.PagingButtonType = PagingButtonType.Text;
            this.pager.NumericButtonType = PagingButtonType.Text;
            this.pager.NavigationButtonType = PagingButtonType.Text;
            this.pager.ShowNavigationToolTip = true;
            this.pager.ShowPageIndexBox = ShowPageIndexBox.Never;
            this.pager.ShowPageIndex = true;
            this.pager.AlwaysShowFirstLastPageNumber = true;
            this.pager.AlwaysShow = false;
            this.pager.UrlPageIndexName = "page";

            p.Controls.Add(this.pager);
        }
Ejemplo n.º 17
0
    /// <summary>
    /// 將IList做分頁顯示
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <param name="AspNetPager1"></param>
    /// <param name="result"></param>
    /// <returns></returns>
    public static IList <T> SetProducePage <T>(Wuqi.Webdiyer.AspNetPager AspNetPager1, IList <T> list)
    {
        AspNetPager1.RecordCount = list.Count;
        int       maxRecord  = AspNetPager1.PageSize;
        int       startIndex = AspNetPager1.PageSize * (AspNetPager1.CurrentPageIndex - 1);
        IList <T> result     = new List <T>();

        if (list.Count - startIndex < maxRecord)
        {
            maxRecord = list.Count - startIndex;
        }

        for (int i = startIndex; i < (startIndex + maxRecord); i++)
        {
            result.Add(list[i]);
        }
        return(result);
    }
Ejemplo n.º 18
0
 public DataTable GetBuild(int flag, AspNetPager AspNetPager1)
 {
     return bop.GetAllBuild(flag, "Dong", "*", "DongID", AspNetPager1, false, "DongID is not null");
 }
Ejemplo n.º 19
0
 public DataTable GetAllSecondFaultByTel(int flag, AspNetPager AspNetPager1,string username,string meth)
 {
     return sf.GetAllSecondFaultByProcrsure(flag, "GuZhangSecond", "GuZhangSecondID,name,GuZhangContent,Address,phone,ReceivedDate", "ReceivedDate", AspNetPager1, true, " GuZhangSecond.isdel=0 and recevier='" + username + "' and menth='"+meth+"'");
 }
Ejemplo n.º 20
0
 public DataTable GetAllSecondFaultHavedone(int flag, AspNetPager AspNetPager1,string username)
 {
     return sf.GetAllSecondFaultByProcrsure(flag, "GuZhangSecond", "GuZhangSecondID,DoDate,menth,name,GuZhangContent,Address,phone,ReceivedDate", "ReceivedDate", AspNetPager1, true, " GuZhangSecond.isdel=0 and FuZeRen='" + username + "' and IsDo=1");
 }
Ejemplo n.º 21
0
 public DataTable GetAllSecondFaultInRecycle_Bin(int flag, AspNetPager AspNetPager1, string username)
 {
     return sf.GetAllSecondFaultByProcrsure(flag, "GuZhangSecond", "GuZhangSecondID,menth,name,GuZhangContent,Address,phone,ReceivedDate", "ReceivedDate", AspNetPager1, false, " GuZhangSecond.isdel=1 and delUser='******'");
 }
Ejemplo n.º 22
0
 public DataTable GetAllRoomByBuildid(int flag, AspNetPager AspNetPager1, int buildid)
 {
     return rop.GetRoomByBuild(flag, "[room],Dong", "room.*,Dong.DongName", "roomid", AspNetPager1, false, "buildname=" + buildid + " and Dong.DongID=room.buildname");
 }
Ejemplo n.º 23
0
 /// <summary>
 /// 针对GridView 控件,初始化分页控件
 /// </summary>
 /// <param name="pagesize"></param>s
 /// <param name="pageIndex"></param>
 /// <param name="tablename"></param>
 /// <param name="orderstring"></param>
 /// <param name="aspnetpage1"></param>
 /// <param name="gridview1"></param>
 //public static void InitPageData(int pagesize, int pageIndex, string tablename, string whereString, string orderstring, AspNetPager aspnetpage1, GridView gridview1)
 //{
 //    StringBuilder sql = new StringBuilder();
 //    sql.Append("select count(1) from " + tablename + "");
 //    DataTable dt = OracleHelper.GetDS(sql.ToString()).Tables[0];
 //    if (dt.Rows.Count > 0)
 //    {
 //        gridview1.DataSource = dt;
 //        gridview1.DataBind();
 //        aspnetpage1.RecordCount = dt.Rows.Count;
 //    }
 //    else
 //    {
 //        gridview1.Visible = false;
 //        aspnetpage1.RecordCount = 0;
 //    }
 //    GetPageDate(tablename, whereString, orderstring, pagesize, pageIndex, aspnetpage1, gridview1);
 //}
 /// <summary>
 /// 分布数据
 /// </summary>
 /// <param name="tableName"></param>
 /// <param name="orderString"></param>
 /// <param name="pageSize"></param>
 /// <param name="pageIndex"></param>
 /// <param name="aspnetpage1"></param>
 /// <returns></returns>
 //public static void GetPageDate(string tableName, string whereString, string orderString, int pageSize, int pageIndex, AspNetPager aspnetpage1,Repeater rpt1)
 //{
 //    DataTable dt = new DataTable();
 //    StringBuilder sql = new StringBuilder();
 //    sql.Append("select * from (select rownum rn,a.* from " + tableName + " where " + whereString + " order by " + orderString + "  )");
 //    sql.Append(" where rn>'" + aspnetpage1.CurrentPageIndex * (pageSize - 1) + "' and rn<='" + aspnetpage1.CurrentPageIndex * pageSize + "'");
 //    dt = OracleHelper.GetDS(sql.ToString()).Tables[0];
 //    rpt1.DataSource = dt;
 //    rpt1.DataBind();
 //    //return dt;
 //}
 //public static void GetPageDate(string tableName, string whereString, string orderString, int pageSize, int pageIndex, AspNetPager aspnetpage1, GridView gridview1)
 //{
 //    DataTable dt = new DataTable();
 //    StringBuilder sql = new StringBuilder();
 //    sql.Append("select * from (select rownum rn,a.* from " + tableName + " where " + whereString + " order by " + orderString + "  )");
 //    sql.Append(" where rn>'" + aspnetpage1.CurrentPageIndex * (pageSize - 1) + "' and rn<='" + aspnetpage1.CurrentPageIndex * pageSize + "'");
 //    dt = OracleHelper.GetDS(sql.ToString()).Tables[0];
 //    gridview1.DataSource = dt;
 //    gridview1.DataBind();
 //    //return dt;
 //}
 public static DataTable GetPageDate(string sql, int pageSize, int pageIndex, AspNetPager aspnetpage1)
 {
     DataTable dt = new DataTable();
     StringBuilder sql2 = new StringBuilder();
     sql2.Append("select * from (select rownum rn,a.* from ("+sql+") a)");
     sql2.Append(" where rn>'" + aspnetpage1.CurrentPageIndex * (pageSize - 1) + "' and rn<='" + aspnetpage1.CurrentPageIndex * pageSize + "'");
     dt = OracleHelper.GetDS(sql2.ToString()).Tables[0];
     return dt;
     //rpt1.DataSource = dt;
     //rpt1.DataBind();
     //return dt;
 }
 public DataTable GetdelFault(int flag, AspNetPager AspNetPager1)
 {
     return ucf.GetDelFault(flag, "GuZhangFirst,Users", "GuZhangFirstID,PhoneNumber,telephone,MessageContent,ReceivedDate,menth,TrueName", "ReceivedDate", AspNetPager1, true, "GuZhangFirst.isdel=1 and GuZhangFirst.deluser=Users.UserName");
 }
Ejemplo n.º 25
0
 public DataTable GetMyFault(int flag, AspNetPager AspNetPager1,string username)
 {
     string ziduan = "a.*,MyBit = case when b.faultid is null then 'False' else 'True' end";
     string tab = " dbo.GuZhangSecond a left join  dbo.FaultQueue b on a.GuZhangSecondID = b.faultid";
     string where = "a.FuZeRen='" + username + "' and a.isdel=0 and IsDo=0";
     //return sf.GetAllSecondFaultByProcrsure(flag, "GuZhangSecond,GuZhangFirst", "GuZhangSecondID,name,GuZhangContent,Address,phone,ReceivedDate", "ReceivedDate", AspNetPager1, false, "GuZhangSecond.GuZhangSecondID=GuZhangFirst.GuZhangFirstID and GuZhangSecond.isdel=0 and IsDo=0 and FuZeRen='" + username + "'"); ;
     return sf.GetAllSecondFaultByProcrsure(flag, tab, ziduan, "ReceivedDate", AspNetPager1, false, where);
 }
Ejemplo n.º 26
0
 public static DataTable GetWebReportLogsBetweenTimes(int flag, AspNetPager AspNetPager1,DateTime starttime, DateTime endtime)
 {
     return wro.GetAllWebReportLogs(flag, "Web_Reported_impaired_log", "*", "logintime", AspNetPager1, true, "logintime between '" + starttime + "' and '" + endtime + "'");
 }
Ejemplo n.º 27
0
 public DataTable Getalluserbyprcedure(int flag, AspNetPager AspNetPager1)
 {
     return upo.GetAlluser(flag, "Users", "UserName,TrueName,UserType,phone", "UserName", AspNetPager1, false, " UserName is not null");
 }
Ejemplo n.º 28
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="component"></param>
 public AspNetPagerActionList(IComponent component)
     : base(component)
 {
     pager = component as AspNetPager;
     svc   = GetService(typeof(DesignerActionUIService)) as DesignerActionUIService;
 }
Ejemplo n.º 29
0
 public DataTable GetAllSecondFaultInRecycle_BinByAdministration(int flag, AspNetPager AspNetPager1)
 {
     return sf.GetAllSecondFaultByProcrsure(flag, "GuZhangSecond,[Users]", "GuZhangSecondID,TrueName,menth,name,GuZhangContent,Address,GuZhangSecond.phone,ReceivedDate", "ReceivedDate", AspNetPager1, false, " GuZhangSecond.isdel=1and GuZhangSecond.delUser=Users.UserName");
 }
Ejemplo n.º 30
0
    /// <summary>
    /// 重写分页
    /// </summary>
    /// <param name="pager"></param>
    public static void SetRewriteUrl(this Wuqi.Webdiyer.AspNetPager pager)
    {
        StringBuilder sb = new StringBuilder();
        //预设子域名 专区二级域名
        string strUrl = HttpContext.Current.Request.Url.AbsolutePath;

        string[] seg = HttpContext.Current.Request.Url.Segments;

        if (seg.Length > 1)
        {
            string seg1      = seg[1].ToLower();
            string subdomain = SubDomainRewrite[seg1];
            if (!string.IsNullOrEmpty(subdomain))
            {
                sb.Append(subdomain + ".gjw.com/");
                for (int i = 2; i < seg.Length - 1; i++)
                {
                    sb.Append(seg[i]);
                }
            }
            else if (seg1 == "product/")
            {
                subdomain = HttpContext.Current.Request.QueryString["c2"];
                if (!string.IsNullOrEmpty(subdomain))
                {
                    sb.Append(subdomain + ".gjw.com/");
                    for (int i = 2; i < seg.Length - 1; i++)
                    {
                        sb.Append(seg[i]);
                    }
                }
            }
            else
            {
                subdomain = HttpContext.Current.Request.Url.Host;
                for (int i = 0; i < seg.Length - 1; i++)
                {
                    sb.Append(seg[i]);
                }
            }
            sb.Append(seg[seg.Length - 1].Replace(".aspx", ""));
        }
        string strQuery = string.Empty;

        for (int i = 0; i < HttpContext.Current.Request.QueryString.Count; i++)
        {
            string key = HttpContext.Current.Request.QueryString.Keys[i];
            if (key.ToLower() != "c2" && key.ToLower() != "page")
            {
                string keyval = HttpContext.Current.Server.UrlEncode(HttpContext.Current.Request.QueryString[i]);
                //if (keyval.Contains("%"))
                //    strQuery += "&" + key + "=" + HttpContext.Current.Request.QueryString[i];
                //else
                //    sb.Append("-" + key + "-" + HttpContext.Current.Request.QueryString[i]);
                if (keyval.Contains("%"))
                {
                    strQuery += "&" + key + "=%" + key + "%";
                }
                else
                {
                    sb.Append("-" + key + "-%" + key + "%");
                }
            }
        }

        sb.Append("-page-{0}.aspx");
        if (!string.IsNullOrEmpty(strQuery))
        {
            sb.Append("?" + strQuery.Substring(1));
        }
        pager.UrlRewritePattern = sb.ToString();
    }
Ejemplo n.º 31
0
 protected override void CreateChildControls()
 {
     masterTableView = new GridView();
     dataPager = new AspNetPager();
     base.CreateChildControls();
 }
 public DataTable getallUnclassified_FaultManagerAll(int flag,AspNetPager AspNetPager1)
 {
     return ucf.GetUnclassified_Fault(flag, "GuZhangFirst", "*", "GuZhangFirstID", AspNetPager1, true, "IsTyped=0 and isdel=0");
 }
Ejemplo n.º 33
0
 public static DataTable GetAllWebReportLogs(int flag, AspNetPager AspNetPager1)
 {
     return wro.GetAllWebReportLogs(flag, "Web_Reported_impaired_log", "*", "logintime", AspNetPager1, true, "id is not null");
 }
Ejemplo n.º 34
0
 public DataTable GetAllcommonFault(int flag, AspNetPager AspNetPager1)
 {
     return cgm.GetAllcommonFault(flag, "CommonGuzhang", "*", "id", AspNetPager1, false, "id is not null");
 }
        protected void GridViewPagerBind(AspNetPager anpager, GridView gv, string coalCode, string queryWhere, string queryOrder)
        {
            int valueCount = 0;
            int rowCount = 0;
            int startRowNo = (anpager.CurrentPageIndex - 1) * anpager.PageSize + 1;
            int endRowNo = anpager.CurrentPageIndex * anpager.PageSize;

            DataSet dst = minuteData.GridViewAndPager(coalCode, queryWhere, queryOrder, startRowNo, endRowNo, out rowCount);
            if (dst.Tables.Count>0)
            {
                DataTable dt=dst.Tables[0];

                if (dt.Rows.Count < pageCount)
                {
                    valueCount = pageCount - dt.Rows.Count;
                    for (int i = 0; i < valueCount; i++)
                    {
                        dt.Rows.Add();
                    }
                }

                gv.DataSource = dt;
                gv.DataBind();
            }

            anpager.RecordCount = rowCount;

            anpager.CustomInfoHTML = "共<font color=\"blue\"><b>" + anpager.RecordCount.ToString() + "</b></font>条记录";
            anpager.CustomInfoHTML += " 共<font color=\"blue\"><b>" + anpager.PageCount.ToString() + "</b></font>页";
            anpager.CustomInfoHTML += " 当前第<font color=\"red\"><b>" + anpager.CurrentPageIndex.ToString() + "</b></font>页";
        }
Ejemplo n.º 36
0
 /// <summary>
 /// 针对Repeater控件,初始化分页控件
 /// </summary>
 //public static void InitPageData(string sql, string tablename, string whereString, string orderString, int pageSize, int pageIndex, AspNetPager aspnetpage1, Repeater rpt1)
 //{
 //    DataTable dt = OracleHelper.GetDS(sql.ToString()).Tables[0];
 //    if (dt.Rows.Count > 0)
 //    {
 //        aspnetpage1.RecordCount = dt.Rows.Count;
 //    }
 //    else
 //    {
 //        aspnetpage1.RecordCount = 0;
 //    }
 //    GetPageDate(tablename, whereString, orderString, pageSize, pageIndex, aspnetpage1,rpt1);
 //}
 public static DataTable InitPageData(string sql, int pageSize, int pageIndex, AspNetPager aspnetpage1, Repeater rpt1)
 {
     DataTable dt = OracleHelper.GetDS(sql.ToString()).Tables[0];
     if (dt.Rows.Count > 0)
     {
         aspnetpage1.RecordCount = dt.Rows.Count;
     }
     else
     {
         aspnetpage1.RecordCount = 0;
     }
        return GetPageDate(sql, pageSize, pageIndex, aspnetpage1);
 }
        protected void GridViewPagerBind(AspNetPager anpager, GridView gv, string queryWhere, string queryOrder)
        {
            int valueCount = 0;
            int rowCount = 0;
            int startRowNo = (anpager.CurrentPageIndex - 1) * anpager.PageSize + 1;
            int endRowNo = anpager.CurrentPageIndex * anpager.PageSize;
            DataTable dt = alarmRecord.GridViewAndPager(queryWhere, queryOrder, startRowNo, endRowNo, out rowCount).Tables[0];
            dt.Columns.Add("newTime");
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                double s = Convert.ToDouble((dt.Rows[i]["Duration"].ToString()));
                int s1 = (Int32)s;
                dt.Rows[i]["newTime"] = CalculateTime(s1);

            }
            if (dt.Rows.Count < pageCount)
            {
                valueCount = pageCount - dt.Rows.Count;
                for (int i = 0; i < valueCount; i++)
                {
                    dt.Rows.Add();
                }
            }

            gv.DataSource = dt;

            gv.DataBind();
            anpager.RecordCount = rowCount;
            anpager.CustomInfoHTML = "共<font color=\"blue\"><b>" + anpager.RecordCount.ToString() + "</b></font>条记录";
            anpager.CustomInfoHTML += " 共<font color=\"blue\"><b>" + anpager.PageCount.ToString() + "</b></font>页";
            anpager.CustomInfoHTML += " 当前第<font color=\"red\"><b>" + anpager.CurrentPageIndex.ToString() + "</b></font>页";
        }
Ejemplo n.º 38
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="component"></param>
 public AspNetPagerActionList(IComponent component)
     : base(component)
 {
     pager = component as AspNetPager;
     svc = GetService(typeof(DesignerActionUIService)) as DesignerActionUIService;
 }
Ejemplo n.º 39
0
 public DataTable GetAllUnDoneSecondFault(int flag, AspNetPager AspNetPager1)
 {
     return sf.GetAllSecondFaultByProcrsure(flag, "GuZhangSecond,Users", "GuZhangSecondID,name,GuZhangContent,menth,DoDate,TrueName,Address,GuZhangSecond.phone,ReceivedDate,IsDo", "ReceivedDate", AspNetPager1, true, " GuZhangSecond.isdel=0 and GuZhangSecond.FuZeRen=Users.UserName and IsDo=0");
 }