Repeater 分页实例

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
using System.Text;
using System.IO;

public partial class JCD : System.Web.UI.Page
{
  

    protected void Page_Load(object sender, EventArgs e)
    {
      
            labpage.Text = "1";
       
    }

    protected void select_Click(object sender, EventArgs e)
    {
        PageRepeater();
    }

 

    private void PageRepeater()
    {
        string querysql = "";
        string sqlInfoCount = "";
        string timeone = Request.Form["optionDate"].ToString();
        string timetwo = Request.Form["ToDate"].ToString();

        if (timeone != "" && timetwo == "")
        {
            string onetime = timeone + " 00:00:00";
            string twotime = timeone + " 23:59:59";
            querysql = @"select * from JCD_VIEW where sSignDateTime>='" + onetime + "' and sSignDateTime<='" + twotime + "'";
            sqlInfoCount = @"select count(*) from JCD_VIEW where sSignDateTime>='" + onetime + "' and sSignDateTime<='" + twotime + "'";
        }
        if (timeone == "" && timetwo != "")
        {
            string onetime = timetwo + " 00:00:00";
            string twotime = timetwo + " 23:59:59";
            querysql = @"select * from JCD_VIEW where sSignDateTime>='" + onetime + "' and sSignDateTime<='" + twotime + "'";
            sqlInfoCount = @"select count(*) from JCD_VIEW where sSignDateTime>='" + onetime + "' and sSignDateTime<='" + twotime + "'";
        }
        if (timeone != "" && timetwo != "")
        {
            string onetime = timeone + " 00:00:00";
            string twotime = timetwo + " 23:59:59";
            querysql = @"select * from JCD_VIEW where sSignDateTime>='" + onetime + "' and sSignDateTime<='" + twotime + "'";
            sqlInfoCount = @"select count(*) from JCD_VIEW where sSignDateTime>='" + onetime + "' and sSignDateTime<='" + twotime + "'";
        }
        if (timeone == "" && timetwo == "")
        {
            querysql = @"select * from JCD_VIEW where 1=1";
            sqlInfoCount = @"select count(*) from JCD_VIEW where 1=1";
        }
        if (sequenceid.Text != "")
        {
            querysql += @"and sequenceid like '%" + sequenceid.Text.Trim() + "%'";
            sqlInfoCount += @"and sequenceid like '%" + sequenceid.Text.Trim() + "%'";
        }
        if (sname.Text != "")
        {
            querysql += @"and sname like '%" + sname.Text.Trim() + "%'";
            sqlInfoCount += @"and sname like '%" + sname.Text.Trim() + "%'";
        }
        if (gonghao.Text != "")
        {
            querysql += @"and gonghao like '%" + gonghao.Text.Trim() + "%'";
            sqlInfoCount += @"and gonghao like '%" + gonghao.Text.Trim() + "%'";
        }

//sqlHelper自定义的数据库连接类
        sqlHelper help = new sqlHelper();
        DataSet myset = help.ExecuteDataSetSql(querysql);
        Repeater1.DataSource = myset;
        Repeater1.DataBind();

        DataSet ds = help.ExecuteDataSetSql(sqlInfoCount);
        zhong.Text = ds.Tables[0].Rows[0][0].ToString();

        PagedDataSource pds = new PagedDataSource();
        pds.DataSource = myset.Tables[0].DefaultView;
        pds.AllowPaging = true;
        pds.PageSize = 10;
        pds.CurrentPageIndex = Convert.ToInt32(this.labpage.Text) - 1;
        Repeater2.DataSource = pds;
        countpage.Text = pds.PageCount.ToString();
        labpage.Text = (pds.CurrentPageIndex + 1).ToString();
        this.firstpage.Enabled = true;
        this.pritpage.Enabled = true;
        this.nextpage.Enabled = true;
        this.lastpage.Enabled = true;

        if (pds.CurrentPageIndex < 1)
        {
            this.firstpage.Enabled = false;
            this.pritpage.Enabled = false;
        }

        if (pds.CurrentPageIndex == pds.PageCount - 1)
        {
            this.nextpage.Enabled = false;
            this.lastpage.Enabled = false;
        }

        Repeater2.DataBind();
    }

    protected void firstpage_Click(object sender, EventArgs e)
    {
        this.labpage.Text = "1";
        this.PageRepeater();
    }
    protected void pritpage_Click(object sender, EventArgs e)
    {
        this.labpage.Text = Convert.ToString(Convert.ToInt32(labpage.Text) - 1);
        this.PageRepeater();
    }
    protected void nextpage_Click(object sender, EventArgs e)
    {
        this.labpage.Text = Convert.ToString(Convert.ToInt32(labpage.Text) + 1);
        this.PageRepeater();
    }
    protected void lastpage_Click(object sender, EventArgs e)
    {
        this.labpage.Text = this.countpage.Text;
        this.PageRepeater();
    }
       
}

 

 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="JCD.aspx.cs" Inherits="JCD" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>獎懲單查詢頁</title>
   
    <link href="css/birthday.css" rel="stylesheet" type="text/css" />

    <script src="js/birthday.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
   
        <asp:Label ID="Label1" runat="server" Text="流水號:"></asp:Label>
        <asp:TextBox ID="sequenceid" runat="server"></asp:TextBox>
        <br />
        <asp:Label ID="Label2" runat="server" Text="姓 名:"></asp:Label>
        <asp:TextBox ID="sname" runat="server"></asp:TextBox>
        <br />
        <asp:Label ID="Label3" runat="server" Text="工 號:"></asp:Label>
        <asp:TextBox ID="gonghao" runat="server"></asp:TextBox>
        <br />
        <asp:Label ID="Label4" runat="server" Text="簽核日期:"></asp:Label>
        <input name="optionDate" οnfοcus="show_cele_date(optionDate,'','',optionDate)" class="input" /> <asp:Label ID="Label5" runat="server" Text="至"></asp:Label>
        <input name="ToDate" οnfοcus="show_cele_date(ToDate,'','',ToDate)" class="input" /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="select" runat="server" Text="查詢" οnclick="select_Click" />
            
        <asp:Repeater ID="Repeater1" runat="server">
        <HeaderTemplate>
        <table border="1" cellpadding="1" cellspacing="1" style="background-color: #99CCFF;  font-size:12px; width:1000px;">
        <tr>
        <td align="center" style=" width:6.00%;">流水號
        </td>
        <td align="center" style=" width:6.00%;">姓名
        </td>
        <td align="center" style=" width:6.00%;">工號
        </td>
        <td align="center" style=" width:7.00%;">課別
        </td>
        <td align="center" style=" width:5.00%;">職務
        </td>
        <td align="center" style=" width:15.00%;">獎懲內容
        </td>
        <td align="center" style=" width:10.00%;">獎懲類型
        </td>
        <td align="center" style=" width:5.00%;">金額
        </td>
        <td align="center" style=" width:10.00%;">描述
        </td>
        <td align="center" style=" width:2.00%;">章
        </td>
        <td align="center" style=" width:2.00%;">節
        </td>
        <td align="center" style=" width:2.00%;">條
        </td>
        <td align="center" style=" width:5.00%;">簽核人
        </td>
         </td>
        <td align="center" style=" width:10.00%;">簽核時間
        </td>
         </td>
        <td align="center" style=" width:9.00%;">簽核內容
        </td>
        </tr>
        </table>
        </HeaderTemplate>
       
        </asp:Repeater>
       
   
        <asp:Repeater ID="Repeater2" runat="server">
        <ItemTemplate>
        <table border="1" cellpadding="1" cellspacing="1" style=" font-size:12px; width:1000px;">
        <tr>
        <td align="center" style="width:6.00%;word-wrap:break-word;word-break:break-all;">&nbsp;<%# Eval("SequenceID")%>
        </td>
        <td align="center" style="width:6.00%;word-wrap:break-word;word-break:break-all;">&nbsp;<%# Eval("Sname")%>
        </td>
        <td align="center" style=" width:6.00%;word-wrap:break-word;word-break:break-all;">&nbsp;<%# Eval("Gonghao")%>
        </td>
        <td align="center" style="width:7.00%;word-wrap:break-word;word-break:break-all;">&nbsp;<%# Eval("Kebie")%>
        </td>
        <td align="center" style="width:5.00%;word-wrap:break-word;word-break:break-all;">&nbsp;<%# Eval("Zhiwu")%>
        </td>
        <td align="center" style="width:15.00%;word-wrap:break-word;word-break:break-all;">&nbsp;<%# Eval("Contents")%>
        </td>
        <td align="center" style="width:10.00%;word-wrap:break-word;word-break:break-all;">&nbsp;<%# Eval("type2")%>
        </td>
        <td align="center" style="width:5.00%;word-wrap:break-word;word-break:break-all;">&nbsp;<%# Eval("Jiner")%>
        </td>
        <td align="center" style="width:10.00%;word-wrap:break-word;word-break:break-all;">&nbsp;<%# Eval("Mx")%>
        </td>
        <td align="center" style="width:2.00%;word-wrap:break-word;word-break:break-all;">&nbsp;<%# Eval("Zhang")%>
        </td>
        <td align="center" style="width:2.00%;word-wrap:break-word;word-break:break-all;">&nbsp;<%# Eval("Jie")%>
        </td>
        <td align="center" style="width:2.00%;word-wrap:break-word;word-break:break-all;">&nbsp;<%# Eval("Tiao")%>
        </td>
        <td align="center" style="width:5.00%;word-wrap:break-word;word-break:break-all;">&nbsp;<%# Eval("sSignerName")%>
        </td>
         </td>
        <td align="center" style="width:10.00%;word-wrap:break-word;word-break:break-all;">&nbsp;<%# Eval("sSignDateTime")%>
        </td>
         </td>
        <td align="center" style="width:9.00%;word-wrap:break-word;word-break:break-all;">&nbsp;<%# Eval("sComment")%>
        </td>
        </tr>
        </table>
        </ItemTemplate>
        </asp:Repeater>
        <table border="1" style="font-size:12px; width:1000px; text-align:center">
        <tr>
        <td>
          <asp:LinkButton ID="firstpage" runat="server" οnclick="firstpage_Click">首頁</asp:LinkButton>
&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:LinkButton ID="pritpage" runat="server" οnclick="pritpage_Click">上一頁</asp:LinkButton>
&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:LinkButton ID="nextpage" runat="server" οnclick="nextpage_Click">下一頁</asp:LinkButton>
&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:LinkButton ID="lastpage" runat="server" οnclick="lastpage_Click">尾頁</asp:LinkButton>
&nbsp;&nbsp;&nbsp;&nbsp;
            第<asp:Label ID="labpage" runat="server" Text="Label"></asp:Label>
            頁/共<asp:Label ID="countpage" runat="server" Text="Label"></asp:Label>
            頁&nbsp;&nbsp;&nbsp;&nbsp;  共<asp:Label ID="zhong" runat="server" Text="Label"></asp:Label>条记录</td></tr>
        </table>

        </div>
    </form>
</body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
VR(Virtual Reality)即虚拟现实,是一种可以创建和体验虚拟世界的计算机技术。它利用计算机生成一种模拟环境,是一种多源信息融合的、交互式的三维动态视景和实体行为的系统仿真,使用户沉浸到该环境中。VR技术通过模拟人的视觉、听觉、触觉等感觉器官功能,使人能够沉浸在计算机生成的虚拟境界中,并能够通过语言、手势等自然的方式与之进行实时交互,创建了一种适人化的多维信息空间。 VR技术具有以下主要特点: 沉浸感:用户感到作为主角存在于模拟环境中的真实程度。理想的模拟环境应该使用户难以分辨真假,使用户全身心地投入到计算机创建的三维虚拟环境中,该环境中的一切看上去是真的,听上去是真的,动起来是真的,甚至闻起来、尝起来等一切感觉都是真的,如同在现实世界中的感觉一样。 交互性:用户对模拟环境内物体的可操作程度和从环境得到反馈的自然程度(包括实时性)。例如,用户可以用手去直接抓取模拟环境中虚拟的物体,这时手有握着东西的感觉,并可以感觉物体的重量,视野中被抓的物体也能立刻随着手的移动而移动。 构想性:也称想象性,指用户沉浸在多维信息空间中,依靠自己的感知和认知能力获取知识,发挥主观能动性,寻求解答,形成新的概念。此概念不仅是指观念上或语言上的创意,而且可以是指对某些客观存在事物的创造性设想和安排。 VR技术可以应用于各个领域,如游戏、娱乐、教育、医疗、军事、房地产、工业仿真等。随着VR技术的不断发展,它正在改变人们的生活和工作方式,为人们带来全新的体验。
VR(Virtual Reality)即虚拟现实,是一种可以创建和体验虚拟世界的计算机技术。它利用计算机生成一种模拟环境,是一种多源信息融合的、交互式的三维动态视景和实体行为的系统仿真,使用户沉浸到该环境中。VR技术通过模拟人的视觉、听觉、触觉等感觉器官功能,使人能够沉浸在计算机生成的虚拟境界中,并能够通过语言、手势等自然的方式与之进行实时交互,创建了一种适人化的多维信息空间。 VR技术具有以下主要特点: 沉浸感:用户感到作为主角存在于模拟环境中的真实程度。理想的模拟环境应该使用户难以分辨真假,使用户全身心地投入到计算机创建的三维虚拟环境中,该环境中的一切看上去是真的,听上去是真的,动起来是真的,甚至闻起来、尝起来等一切感觉都是真的,如同在现实世界中的感觉一样。 交互性:用户对模拟环境内物体的可操作程度和从环境得到反馈的自然程度(包括实时性)。例如,用户可以用手去直接抓取模拟环境中虚拟的物体,这时手有握着东西的感觉,并可以感觉物体的重量,视野中被抓的物体也能立刻随着手的移动而移动。 构想性:也称想象性,指用户沉浸在多维信息空间中,依靠自己的感知和认知能力获取知识,发挥主观能动性,寻求解答,形成新的概念。此概念不仅是指观念上或语言上的创意,而且可以是指对某些客观存在事物的创造性设想和安排。 VR技术可以应用于各个领域,如游戏、娱乐、教育、医疗、军事、房地产、工业仿真等。随着VR技术的不断发展,它正在改变人们的生活和工作方式,为人们带来全新的体验。
基于GPT-SoVITS的视频剪辑快捷配音工具 GPT, 通常指的是“Generative Pre-trained Transformer”(生成式预训练转换器),是一个在自然语言处理(NLP)领域非常流行的深度学习模型架构。GPT模型由OpenAI公司开发,并在多个NLP任务上取得了显著的性能提升。 GPT模型的核心是一个多层Transformer解码器结构,它通过在海量的文本数据上进行预训练来学习语言的规律。这种预训练方式使得GPT模型能够捕捉到丰富的上下文信息,并生成流畅、自然的文本。 GPT模型的训练过程可以分为两个阶段: 预训练阶段:在这个阶段,模型会接触到大量的文本数据,并通过无监督学习的方式学习语言的结构和规律。具体来说,模型会尝试预测文本序列中的下一个词或短语,从而学习到语言的语法、语义和上下文信息。 微调阶段(也称为下游任务训练):在预训练完成后,模型会被应用到具体的NLP任务中,如文本分类、机器翻译、问答系统等。在这个阶段,模型会使用有标签的数据进行微调,以适应特定任务的需求。通过微调,模型能够学习到与任务相关的特定知识,并进一步提高在该任务上的性能。 GPT模型的优势在于其强大的生成能力和对上下文信息的捕捉能力。这使得GPT模型在自然语言生成、文本摘要、对话系统等领域具有广泛的应用前景。同时,GPT模型也面临一些挑战,如计算资源消耗大、训练时间长等问题。为了解决这些问题,研究人员不断提出新的优化方法和扩展模型架构,如GPT-2、GPT-3等,以进一步提高模型的性能和效率。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值