计算机毕业设计介绍:
5.2 写记录部分代码
string title = this.tbTitle.Text.Trim();
string neirong = this.ftbinfo.Text.Trim();
string type = this.dropType.SelectedItem.Text;
sqlstr = "select 类型编号 from 记录类型表 where 类型名称='" + type + "'";
ds = db.getdatadysql(sqlstr);
int typeid = int.Parse(ds.Tables[0].Rows[0][0].ToString());
sqlstr = "insert into 记录详细表(记录人,记录类型,记录主题,记录内容,记录时间) values('" + Session["username"] + "'," + typeid + ",'" + title + "','" + neirong + "',getdate())";
bool result = db.updatabysql(sqlstr);
if (result == true)
{
sqlstr = "select max(记录序号) from 记录详细表";
ds = db.getdatadysql(sqlstr);
string maxid = ds.Tables[0].Rows[0][1].ToString();
sqlstr = "select * from 部门人员表 where 用户编号='" + Session["username"] + "'";
ds = db.getdatadysql(sqlstr);
string dep = ds.Tables[0].Rows[0][6].ToString();
sqlstr = "select * from vwRole where 部门编号='" + dep.Substring(0, dep.Length - 3) + "'and roleName='部门审核人'";
ds = db.getdatadysql(sqlstr);
if (ds.Tables[0].Rows.Count != 0)
{
string depuser = ds.Tables[0].Rows[0][3].ToString();
sqlstr = "select * from vwRole where 部门编号='" + dep.Substring(0, 3) + "'and roleName='公司审核人'";
ds = db.getdatadysql(sqlstr);
if (ds.Tables[0].Rows.Count != 0)
{
string companyuser = ds.Tables[0].Rows[0][3].ToString();
sqlstr = "insert into 提示表(提示人,提示内容,记录编号) values('" + depuser + "','您有记录没审核!','"+ maxid +"')";
result = db.updatabysql(sqlstr);
if (result == true)
{
sqlstr = "insert into 提示表(提示人,提示内容,记录编号) values('" + companyuser + "','您有记录没审核!','" + maxid + "')";
result = db.updatabysql(sqlstr);
if (result == true)
{
this.labmsg.Text = "";
clear();
}
}
}
}
〖资料来源:计算机毕业论文 www.xiaoniu168.com〗
第7页为计算机毕业论文部分......