计算机毕业设计介绍:
读者档案部分代码:
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
string readerBarCode = this.GridView1.DataKeys[e.RowIndex].Value.ToString();
string strSql = "select count(*) from tb_bookBorrow where readerBarCode='"+readerBarCode+"'";
if (dataOperate.seleSQL(strSql) > 0)
{
RegisterStartupScript("", "");
}
else
{
string strDel = "delete tb_readerInfo where readerBarCode='" + readerBarCode + "'";
if (dataOperate.execSQL(strSql))
{
Response.Write("");
bindReaderInfo();
}
else
{
Response.Write("");
}
}
图书类型设置代码:
public void bindBookType()
{
string strSql = "select * from tb_bookType";
this.GridView1.DataSource = dataOperate.getDataset(strSql);
this.GridView1.DataKeyNames = new string[] { "typeID" };
this.GridView1.DataBind();
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
string typeID = this.GridView1.DataKeys[e.RowIndex].Value.ToString();
string strSql = "select count(*) from tb_bookInfo where bookType='" + typeID + "'";
if (dataOperate.seleSQL(strSql) <= 0)
{
string strDel = "delete tb_bookType where typeID='"+typeID+"'";
if (dataOperate.execSQL(strDel))
{
Response.Write("");
bindBookType();
}
else
{
RegisterStartupScript("", "");
}
}
else
{
RegisterStartupScript("", "");
}
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
this.GridView1.PageIndex = e.NewPageIndex;
bindBookType();
}
〖资料来源:计算机毕业论文 www.xiaoniu168.com〗
第11页为计算机毕业论文部分......