图书管理系统毕业论文 下载本文

青岛理工大学毕业设计(论文)

SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet();

da.Fill(ds, AspNetPager1.PageSize * (AspNetPager1.CurrentPageIndex - 1), AspNetPager1.PageSize, \

DataView dv = ds.Tables[\ this.Repeater1.DataSource = dv; this.Repeater1.DataBind(); }

protected void CheckBox1_CheckedChanged(object sender, EventArgs e) {

if (CheckBox1.Checked) {

for (int i = 0; i < Repeater1.Items.Count; i++) {

CheckBox

chk

(CheckBox)Repeater1.Items[i].FindControl(\ if (chk != null) {

chk.Checked = true; } } } else {

for (int i = 0; i < Repeater1.Items.Count; i++) {

CheckBox

chk

38

=

=

青岛理工大学毕业设计(论文)

(CheckBox)Repeater1.Items[i].FindControl(\ if (chk != null) {

chk.Checked = false; } } } } protected

void

Repeater1_ItemCommand(object

source,

RepeaterCommandEventArgs e) {

if (e.CommandName == \ {

if (DB.ExecuteSql(\ X_Manager_ID=\+ e.CommandArgument.ToString()) >= 0) {

Get_Pager_Data();

Common.ShowMessage(Page, \删除成功!\ } else {

Common.ShowMessage(Page, \删除失败!\ } } }

#region 批量删除

protected void Button2_Click(object sender, EventArgs e)

39

青岛理工大学毕业设计(论文)

{

for (int i = 0; i < Repeater1.Items.Count; i++) {

CheckBox

chk

(CheckBox)Repeater1.Items[i].FindControl(\

Label lb5 = (Label)Repeater1.Items[i].FindControl(\ if (chk != null) {

if (chk.Checked) {

DB.ExecuteSql(\from

[X_Manager]

X_Manager_ID=\ } } }

Get_Pager_Data(); }

#endregion

protected void Button1_Click(object sender, EventArgs e) {

Response.Redirect(\

}

3. 编辑页代码

protected void Page_Load(object sender, EventArgs e) {

if (!IsPostBack) {

40

=

where

青岛理工大学毕业设计(论文)

Get_Data(); } }

protected void Button1_Click(object sender, EventArgs e) { string

sql

=

\

X_Read_Card

set where

X_Read_Card_Pwd='7C4A8D09CA3762AF61E59520943DC26494F8941B' X_Read_Card_ID=\ if (DB.ExecuteSql(sql) >= 0) {

Common.ShowMessage(Page, \恭喜您,密码重置成功\ } else {

Common.ShowMessage(Page, \服务器繁忙,请您稍后再试……\\ } }

void Get_Data() {

string userName = \

if (Request.Cookies[\ {

Response.Redirect(\ } else {

41

青岛理工大学毕业设计(论文)

if (Request.Cookies[\ {

SqlConnection cn = DB.OpenConnection(); string

sql

=

\

*

from

[X_Manager]

where

X_Manager_ID=\

SqlDataReader dr = DB.getDataReader(sql,cn); if (dr.Read()) {

txt_name.Text = dr[\ if

(DropDownList_Sex.Items.FindByValue(dr[\!= { DropDownList_Sex.SelectedValue = dr[\ txt_pho.Text = dr[\ lb_id.Text = dr[\ dr.Close(); dr.Dispose();

DB.DisposeConnection(cn); } else {

dr.Close(); dr.Dispose();

DB.DisposeConnection(cn); this.Button1.Enabled = false; this.Button2.Enabled = false; } }

42

null)