家教信息管理系统毕业论文设计(ASP.NET)(3)
资料介绍:
{
teacherSex = male.Text.Trim();
}
else
{
teacherSex = female.Text.Trim();
}
string teacherAge = txtAge.Text.Trim();
string teacherSchool = txtSchool.Text.Trim();
string teacherCourse = txtCourse.Text.Trim();
string teacherPhone = txtPhone.Text.Trim(); [资料来源:http://doc163.com]
string teacherEmail = txtEmail.Text.Trim();
string teacherAddress = txtAddress.Text.Trim();
string teacherInfo = txtInfo.Text.Trim();
string price = txtPrice.Text.Trim();
Teacher tch = new Teacher(teacherName, teacherSex, teacherAge, teacherSchool, teacherCourse, teacherPhone, teacherEmail, teacherAddress, teacherInfo, price,userId);
bool res = TeacherManager.TeacherInsert(tch);
if (res)
{
Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('注册成功!');</script>");
[来源:http://Doc163.com]
return;
}
}
}
}
5.2.2教员信息修改的代码
#region 修改教员信息
/// <summary>
/// 修改教员信息
/// </summary>
/// <param name="tch">教员实体类</param>
/// <returns></returns>
public bool UpdateTeacher(Teacher tch)
{
bool flag = false;
string cmdText = "teacher_Update"; [资料来源:http://doc163.com]
SqlParameter[] paras = new SqlParameter[] {
new SqlParameter("@teacherId",tch.TeacherId),
new SqlParameter("@teacherName",tch.TeacherName),
new SqlParameter("@teacherSex",tch.TeacherSex),
new SqlParameter("@teacherAge",tch.TeacherAge),
new SqlParameter("@teacherSchool",tch.TeacherSchool),
new SqlParameter("@teacherCourse",tch.TeacherCourse),
[资料来源:http://Doc163.com]
new SqlParameter("@price",tch.Price),
new SqlParameter("@teacherPhone",tch.TeacherPhone),
new SqlParameter("@teacherEmail",tch.TeacherEmail),
new SqlParameter("@teacherAddress",tch.TeacherAddress),