Example #1
0
        private void bindLogType()
        {
            DataTable dt = new Logs().GetLogType();
            this.ddlLogType.DataSource = dt;
            this.ddlLogType.DataValueField = "ID";
            this.ddlLogType.DataTextField = "CnName";
            this.ddlLogType.DataBind();

            ListItem all = new ListItem("所有", "-1");
            this.ddlLogType.Items.Insert(0,all);
            this.ddlLogType.SelectedValue = "-1";
        }
Example #2
0
        private void bind()
        {
            string userName = this.txtLoginName.Text.Replace("'", "''").Trim();
            DateTime startDate = Convert.ToDateTime(this.t_Date.Text);
            DateTime endDate = Convert.ToDateTime(this.e_Date.Text).AddDays(1);
            string logType = this.ddlLogType.SelectedValue;

            Logs obj = new Logs();
            DataSet ds = obj.GetLogs(userName,logType, startDate, endDate, this.AspNetPager1.PageSize, pageIndex);
            this.GridView1.DataSource = ds.Tables[1];
            this.GridView1.DataBind();

            this.AspNetPager1.RecordCount = Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString());
        }