/// <summary> /// 增加一条数据 /// </summary> public int Add(Danyl.SnnuURP.Model.AssignmentSubmit model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into AssignmentSubmit("); strSql.Append("Sid,AssignmentId,Detail,Accessory)"); strSql.Append(" values ("); strSql.Append("@Sid,@AssignmentId,@Detail,@Accessory)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@Sid", SqlDbType.Int,4), new SqlParameter("@AssignmentId", SqlDbType.Int,4), new SqlParameter("@Detail", SqlDbType.VarChar,45), new SqlParameter("@Accessory", SqlDbType.Int,4)}; parameters[0].Value = model.Sid; parameters[1].Value = model.AssignmentId; parameters[2].Value = model.Detail; parameters[3].Value = model.Accessory; object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters); if (obj == null) { return 0; } else { return Convert.ToInt32(obj); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Danyl.SnnuURP.Model.Class model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update Class set "); strSql.Append("ClassName=@ClassName,"); strSql.Append("Grade=@Grade,"); strSql.Append("StuCount=@StuCount"); strSql.Append(" where ClassId=@ClassId and MajorId=@MajorId and DistrictId=@DistrictId "); SqlParameter[] parameters = { new SqlParameter("@ClassName", SqlDbType.NVarChar,45), new SqlParameter("@Grade", SqlDbType.VarChar,45), new SqlParameter("@StuCount", SqlDbType.Int,4), new SqlParameter("@ClassId", SqlDbType.Int,4), new SqlParameter("@MajorId", SqlDbType.Int,4), new SqlParameter("@DistrictId", SqlDbType.Int,4)}; parameters[0].Value = model.ClassName; parameters[1].Value = model.Grade; parameters[2].Value = model.StuCount; parameters[3].Value = model.ClassId; parameters[4].Value = model.MajorId; parameters[5].Value = model.DistrictId; int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Danyl.SnnuURP.Model.Class model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into Class("); strSql.Append("ClassId,ClassName,MajorId,Grade,StuCount,DistrictId)"); strSql.Append(" values ("); strSql.Append("@ClassId,@ClassName,@MajorId,@Grade,@StuCount,@DistrictId)"); SqlParameter[] parameters = { new SqlParameter("@ClassId", SqlDbType.Int,4), new SqlParameter("@ClassName", SqlDbType.NVarChar,45), new SqlParameter("@MajorId", SqlDbType.Int,4), new SqlParameter("@Grade", SqlDbType.VarChar,45), new SqlParameter("@StuCount", SqlDbType.Int,4), new SqlParameter("@DistrictId", SqlDbType.Int,4)}; parameters[0].Value = model.ClassId; parameters[1].Value = model.ClassName; parameters[2].Value = model.MajorId; parameters[3].Value = model.Grade; parameters[4].Value = model.StuCount; parameters[5].Value = model.DistrictId; int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Danyl.SnnuURP.Model.Assignment model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update Assignment set "); strSql.Append("Cid=@Cid,"); strSql.Append("ReleaseTime=@ReleaseTime,"); strSql.Append("Deadline=@Deadline,"); strSql.Append("AssignDetail=@AssignDetail"); strSql.Append(" where AssignId=@AssignId"); SqlParameter[] parameters = { new SqlParameter("@Cid", SqlDbType.Int,4), new SqlParameter("@ReleaseTime", SqlDbType.DateTime), new SqlParameter("@Deadline", SqlDbType.DateTime), new SqlParameter("@AssignDetail", SqlDbType.Text), new SqlParameter("@AssignId", SqlDbType.Int,4), new SqlParameter("@Tid", SqlDbType.Int,4), new SqlParameter("@Accessory", SqlDbType.Int,4)}; parameters[0].Value = model.Cid; parameters[1].Value = model.ReleaseTime; parameters[2].Value = model.Deadline; parameters[3].Value = model.AssignDetail; parameters[4].Value = model.AssignId; parameters[5].Value = model.Tid; parameters[6].Value = model.Accessory; int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Danyl.SnnuURP.Model.AssignmentSubmit model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update AssignmentSubmit set "); strSql.Append("Sid=@Sid,"); strSql.Append("Detail=@Detail"); strSql.Append(" where Id=@Id"); SqlParameter[] parameters = { new SqlParameter("@Sid", SqlDbType.Int,4), new SqlParameter("@Detail", SqlDbType.VarChar,45), new SqlParameter("@Id", SqlDbType.Int,4), new SqlParameter("@AssignmentId", SqlDbType.Int,4), new SqlParameter("@Accessory", SqlDbType.Int,4)}; parameters[0].Value = model.Sid; parameters[1].Value = model.Detail; parameters[2].Value = model.Id; parameters[3].Value = model.AssignmentId; parameters[4].Value = model.Accessory; int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Danyl.SnnuURP.Model.Major model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into Major("); strSql.Append("MajorId,MajorName,DeptId)"); strSql.Append(" values ("); strSql.Append("@MajorId,@MajorName,@DeptId)"); SqlParameter[] parameters = { new SqlParameter("@MajorId", SqlDbType.Int,4), new SqlParameter("@MajorName", SqlDbType.NVarChar,30), new SqlParameter("@DeptId", SqlDbType.Int,4)}; parameters[0].Value = model.MajorId; parameters[1].Value = model.MajorName; parameters[2].Value = model.DeptId; int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Danyl.SnnuURP.Model.UserInfo model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update UserInfo set "); strSql.Append("Uname=@Uname,"); strSql.Append("Pwd=@Pwd,"); strSql.Append("UserType=@UserType,"); strSql.Append("UserPhone=@UserPhone,"); strSql.Append("UserEmail=@UserEmail"); strSql.Append(" where Uid=@Uid "); SqlParameter[] parameters = { new SqlParameter("@Uname", SqlDbType.NVarChar,45), new SqlParameter("@Pwd", SqlDbType.VarChar,45), new SqlParameter("@UserType", SqlDbType.Int,4), new SqlParameter("@UserPhone", SqlDbType.VarChar,45), new SqlParameter("@UserEmail", SqlDbType.VarChar,45), new SqlParameter("@Uid", SqlDbType.Int,4)}; parameters[0].Value = model.Uname; parameters[1].Value = model.Pwd; parameters[2].Value = model.UserType; parameters[3].Value = model.UserPhone; parameters[4].Value = model.UserEmail; parameters[5].Value = model.Uid; int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Danyl.SnnuURP.Model.TrainPlan model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into TrainPlan("); strSql.Append("PlanName,Grade,MajorId,CourseCount,CourseCredit,CourseHours,Remark)"); strSql.Append(" values ("); strSql.Append("@PlanName,@Grade,@MajorId,@CourseCount,@CourseCredit,@CourseHours,@Remark)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@PlanName", SqlDbType.NVarChar,45), new SqlParameter("@Grade", SqlDbType.VarChar,45), new SqlParameter("@MajorId", SqlDbType.Int,4), new SqlParameter("@CourseCount", SqlDbType.Int,4), new SqlParameter("@CourseCredit", SqlDbType.Float,8), new SqlParameter("@CourseHours", SqlDbType.Float,8), new SqlParameter("@Remark", SqlDbType.NVarChar,100)}; parameters[0].Value = model.PlanName; parameters[1].Value = model.Grade; parameters[2].Value = model.MajorId; parameters[3].Value = model.CourseCount; parameters[4].Value = model.CourseCredit; parameters[5].Value = model.CourseHours; parameters[6].Value = model.Remark; object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters); if (obj == null) { return 0; } else { return Convert.ToInt32(obj); } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Danyl.SnnuURP.Model.FileInfo model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into FileInfo("); strSql.Append("Guid,FileName,FileExtension,Uploader,DownloadCount,Comment,IsAssignmentFile)"); strSql.Append(" values ("); strSql.Append("@Guid,@FileName,@FileExtension,@Uploader,@DownloadCount,@Comment,@IsAssignmentFile)"); SqlParameter[] parameters = { new SqlParameter("@Guid", SqlDbType.Int,4), new SqlParameter("@FileName", SqlDbType.VarChar,45), new SqlParameter("@FileExtension", SqlDbType.VarChar,45), new SqlParameter("@Uploader", SqlDbType.Int,4), new SqlParameter("@DownloadCount", SqlDbType.Int,4), new SqlParameter("@Comment", SqlDbType.VarChar,45), new SqlParameter("@IsAssignmentFile", SqlDbType.Bit,1)}; parameters[0].Value = model.Guid; parameters[1].Value = model.FileName; parameters[2].Value = model.FileExtension; parameters[3].Value = model.Uploader; parameters[4].Value = model.DownloadCount; parameters[5].Value = model.Comment; parameters[6].Value = model.IsAssignmentFile; int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Danyl.SnnuURP.Model.WageAdjustment model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into WageAdjustment("); strSql.Append("Tid,NewSalary,OldSalary,Reason,AdjustDate,Remark)"); strSql.Append(" values ("); strSql.Append("@Tid,@NewSalary,@OldSalary,@Reason,@AdjustDate,@Remark)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@Tid", SqlDbType.Int,4), new SqlParameter("@NewSalary", SqlDbType.Decimal,9), new SqlParameter("@OldSalary", SqlDbType.Decimal,9), new SqlParameter("@Reason", SqlDbType.NVarChar,45), new SqlParameter("@AdjustDate", SqlDbType.Date,3), new SqlParameter("@Remark", SqlDbType.NVarChar,200)}; parameters[0].Value = model.Tid; parameters[1].Value = model.NewSalary; parameters[2].Value = model.OldSalary; parameters[3].Value = model.Reason; parameters[4].Value = model.AdjustDate; parameters[5].Value = model.Remark; object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters); if (obj == null) { return 0; } else { return Convert.ToInt32(obj); } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Danyl.SnnuURP.Model.ClassRoom model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into ClassRoom("); strSql.Append("Rid,Rname,BuildId,RoomType,Capacity)"); strSql.Append(" values ("); strSql.Append("@Rid,@Rname,@BuildId,@RoomType,@Capacity)"); SqlParameter[] parameters = { new SqlParameter("@Rid", SqlDbType.Int,4), new SqlParameter("@Rname", SqlDbType.NVarChar,20), new SqlParameter("@BuildId", SqlDbType.Int,4), new SqlParameter("@RoomType", SqlDbType.VarChar,45), new SqlParameter("@Capacity", SqlDbType.Int,4)}; parameters[0].Value = model.Rid; parameters[1].Value = model.Rname; parameters[2].Value = model.BuildId; parameters[3].Value = model.RoomType; parameters[4].Value = model.Capacity; int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Danyl.SnnuURP.Model.Teacher model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update Teacher set "); strSql.Append("Tname=@Tname,"); strSql.Append("Sex=@Sex,"); strSql.Append("IdNumber=@IdNumber,"); strSql.Append("Degree=@Degree"); strSql.Append(" where Tid=@Tid and DeptId=@DeptId and TeacherTypeId=@TeacherTypeId "); SqlParameter[] parameters = { new SqlParameter("@Tname", SqlDbType.NVarChar,30), new SqlParameter("@Sex", SqlDbType.Bit,1), new SqlParameter("@IdNumber", SqlDbType.VarChar,45), new SqlParameter("@Degree", SqlDbType.NVarChar,20), new SqlParameter("@Tid", SqlDbType.Int,4), new SqlParameter("@DeptId", SqlDbType.Int,4), new SqlParameter("@TeacherTypeId", SqlDbType.Int,4)}; parameters[0].Value = model.Tname; parameters[1].Value = model.Sex; parameters[2].Value = model.IdNumber; parameters[3].Value = model.Degree; parameters[4].Value = model.Tid; parameters[5].Value = model.DeptId; parameters[6].Value = model.TeacherTypeId; int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Danyl.SnnuURP.Model.UserPower model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into UserPower("); strSql.Append("UserType,UserPower1,UserPower2)"); strSql.Append(" values ("); strSql.Append("@UserType,@UserPower1,@UserPower2)"); SqlParameter[] parameters = { new SqlParameter("@UserType", SqlDbType.Int,4), new SqlParameter("@UserPower1", SqlDbType.NVarChar,50), new SqlParameter("@UserPower2", SqlDbType.NVarChar,50)}; parameters[0].Value = model.UserType; parameters[1].Value = model.UserPower1; parameters[2].Value = model.UserPower2; int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Danyl.SnnuURP.Model.UserPower model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update UserPower set "); strSql.Append("UserPower1=@UserPower1,"); strSql.Append("UserPower2=@UserPower2"); strSql.Append(" where UserType=@UserType "); SqlParameter[] parameters = { new SqlParameter("@UserPower1", SqlDbType.NVarChar,50), new SqlParameter("@UserPower2", SqlDbType.NVarChar,50), new SqlParameter("@UserType", SqlDbType.Int,4)}; parameters[0].Value = model.UserPower1; parameters[1].Value = model.UserPower2; parameters[2].Value = model.UserType; int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Danyl.SnnuURP.Model.ClassRoom model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update ClassRoom set "); strSql.Append("Rname=@Rname,"); strSql.Append("RoomType=@RoomType,"); strSql.Append("Capacity=@Capacity"); strSql.Append(" where Rid=@Rid and BuildId=@BuildId "); SqlParameter[] parameters = { new SqlParameter("@Rname", SqlDbType.NVarChar,20), new SqlParameter("@RoomType", SqlDbType.VarChar,45), new SqlParameter("@Capacity", SqlDbType.Int,4), new SqlParameter("@Rid", SqlDbType.Int,4), new SqlParameter("@BuildId", SqlDbType.Int,4)}; parameters[0].Value = model.Rname; parameters[1].Value = model.RoomType; parameters[2].Value = model.Capacity; parameters[3].Value = model.Rid; parameters[4].Value = model.BuildId; int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Danyl.SnnuURP.Model.Assignment model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into Assignment("); strSql.Append("Tid,Cid,ReleaseTime,Deadline,AssignDetail,Accessory)"); strSql.Append(" values ("); strSql.Append("@Tid,@Cid,@ReleaseTime,@Deadline,@AssignDetail,@Accessory)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@Tid", SqlDbType.Int,4), new SqlParameter("@Cid", SqlDbType.Int,4), new SqlParameter("@ReleaseTime", SqlDbType.DateTime), new SqlParameter("@Deadline", SqlDbType.DateTime), new SqlParameter("@AssignDetail", SqlDbType.Text), new SqlParameter("@Accessory", SqlDbType.Int,4)}; parameters[0].Value = model.Tid; parameters[1].Value = model.Cid; parameters[2].Value = model.ReleaseTime; parameters[3].Value = model.Deadline; parameters[4].Value = model.AssignDetail; parameters[5].Value = model.Accessory; object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters); if (obj == null) { return 0; } else { return Convert.ToInt32(obj); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Danyl.SnnuURP.Model.SchoolDistrict model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update SchoolDistrict set "); strSql.Append("DistrictName=@DistrictName,"); strSql.Append("Address=@Address"); strSql.Append(" where DistrictId=@DistrictId"); SqlParameter[] parameters = { new SqlParameter("@DistrictName", SqlDbType.NVarChar,30), new SqlParameter("@Address", SqlDbType.NVarChar,50), new SqlParameter("@DistrictId", SqlDbType.Int,4)}; parameters[0].Value = model.DistrictName; parameters[1].Value = model.Address; parameters[2].Value = model.DistrictId; int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Danyl.SnnuURP.Model.RoomUse model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into RoomUse("); strSql.Append("Rid,Uid,UseDate,Purpose,UseStatus,RoomUsecol)"); strSql.Append(" values ("); strSql.Append("@Rid,@Uid,@UseDate,@Purpose,@UseStatus,@RoomUsecol)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@Rid", SqlDbType.Int,4), new SqlParameter("@Uid", SqlDbType.Int,4), new SqlParameter("@UseDate", SqlDbType.DateTime), new SqlParameter("@Purpose", SqlDbType.NVarChar,50), new SqlParameter("@UseStatus", SqlDbType.VarChar,45), new SqlParameter("@RoomUsecol", SqlDbType.VarChar,45)}; parameters[0].Value = model.Rid; parameters[1].Value = model.Uid; parameters[2].Value = model.UseDate; parameters[3].Value = model.Purpose; parameters[4].Value = model.UseStatus; parameters[5].Value = model.RoomUsecol; object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters); if (obj == null) { return 0; } else { return Convert.ToInt32(obj); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Danyl.SnnuURP.Model.Depart model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update Depart set "); strSql.Append("DeptName=@DeptName,"); strSql.Append("MasterName=@MasterName"); strSql.Append(" where DeptId=@DeptId and DistrictId=@DistrictId "); SqlParameter[] parameters = { new SqlParameter("@DeptName", SqlDbType.NVarChar,30), new SqlParameter("@MasterName", SqlDbType.NVarChar,45), new SqlParameter("@DeptId", SqlDbType.Int,4), new SqlParameter("@DistrictId", SqlDbType.Int,4)}; parameters[0].Value = model.DeptName; parameters[1].Value = model.MasterName; parameters[2].Value = model.DeptId; parameters[3].Value = model.DistrictId; int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Danyl.SnnuURP.Model.UserInfo model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into UserInfo("); strSql.Append("Uid,Uname,Pwd,UserType,UserPhone,UserEmail)"); strSql.Append(" values ("); strSql.Append("@Uid,@Uname,@Pwd,@UserType,@UserPhone,@UserEmail)"); SqlParameter[] parameters = { new SqlParameter("@Uid", SqlDbType.Int,4), new SqlParameter("@Uname", SqlDbType.NVarChar,45), new SqlParameter("@Pwd", SqlDbType.VarChar,45), new SqlParameter("@UserType", SqlDbType.Int,4), new SqlParameter("@UserPhone", SqlDbType.VarChar,45), new SqlParameter("@UserEmail", SqlDbType.VarChar,45)}; parameters[0].Value = model.Uid; parameters[1].Value = model.Uname; parameters[2].Value = model.Pwd; parameters[3].Value = model.UserType; parameters[4].Value = model.UserPhone; parameters[5].Value = model.UserEmail; int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Danyl.SnnuURP.Model.TeacherType model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update TeacherType set "); strSql.Append("TeacherTypes=@TeacherTypes,"); strSql.Append("HoursSalary=@HoursSalary"); strSql.Append(" where TeaTypeId=@TeaTypeId"); SqlParameter[] parameters = { new SqlParameter("@TeacherTypes", SqlDbType.NVarChar,20), new SqlParameter("@HoursSalary", SqlDbType.Decimal,9), new SqlParameter("@TeaTypeId", SqlDbType.Int,4)}; parameters[0].Value = model.TeacherTypes; parameters[1].Value = model.HoursSalary; parameters[2].Value = model.TeaTypeId; int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Danyl.SnnuURP.Model.CourseSelect model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into CourseSelect("); strSql.Append("Sid,Cid,Cno,SelectStatus,UsualScore,MidtermScore,FinalExamScore,TotalScore)"); strSql.Append(" values ("); strSql.Append("@Sid,@Cid,@Cno,@SelectStatus,@UsualScore,@MidtermScore,@FinalExamScore,@TotalScore)"); SqlParameter[] parameters = { new SqlParameter("@Sid", SqlDbType.Int,4), new SqlParameter("@Cid", SqlDbType.Int,4), new SqlParameter("@Cno", SqlDbType.Int,4), new SqlParameter("@SelectStatus", SqlDbType.VarChar,45), new SqlParameter("@UsualScore", SqlDbType.Int,4), new SqlParameter("@MidtermScore", SqlDbType.Int,4), new SqlParameter("@FinalExamScore", SqlDbType.Int,4), new SqlParameter("@TotalScore", SqlDbType.Int,4)}; parameters[0].Value = model.Sid; parameters[1].Value = model.Cid; parameters[2].Value = model.Cno; parameters[3].Value = model.SelectStatus; parameters[4].Value = model.UsualScore; parameters[5].Value = model.MidtermScore; parameters[6].Value = model.FinalExamScore; parameters[7].Value = model.TotalScore; int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Danyl.SnnuURP.Model.Teacher model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into Teacher("); strSql.Append("Tid,Tname,Sex,IdNumber,DeptId,TeacherTypeId,Degree)"); strSql.Append(" values ("); strSql.Append("@Tid,@Tname,@Sex,@IdNumber,@DeptId,@TeacherTypeId,@Degree)"); SqlParameter[] parameters = { new SqlParameter("@Tid", SqlDbType.Int,4), new SqlParameter("@Tname", SqlDbType.NVarChar,30), new SqlParameter("@Sex", SqlDbType.Bit,1), new SqlParameter("@IdNumber", SqlDbType.VarChar,45), new SqlParameter("@DeptId", SqlDbType.Int,4), new SqlParameter("@TeacherTypeId", SqlDbType.Int,4), new SqlParameter("@Degree", SqlDbType.NVarChar,20)}; parameters[0].Value = model.Tid; parameters[1].Value = model.Tname; parameters[2].Value = model.Sex; parameters[3].Value = model.IdNumber; parameters[4].Value = model.DeptId; parameters[5].Value = model.TeacherTypeId; parameters[6].Value = model.Degree; int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Danyl.SnnuURP.Model.StuInfo model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into StuInfo("); strSql.Append("Sid,Sname,SnameSpell,SnameEnglish,SnameOld,IdNumber,Sex,StuType,StuNationality,StuProvince,StuBirthday,StuPolitical,StuDept,StuZipCode,StuEnrollDate,StuMajor,StuGrade,StuClassId,PlanId,District)"); strSql.Append(" values ("); strSql.Append("@Sid,@Sname,@SnameSpell,@SnameEnglish,@SnameOld,@IdNumber,@Sex,@StuType,@StuNationality,@StuProvince,@StuBirthday,@StuPolitical,@StuDept,@StuZipCode,@StuEnrollDate,@StuMajor,@StuGrade,@StuClassId,@PlanId,@District)"); SqlParameter[] parameters = { new SqlParameter("@Sid", SqlDbType.Int,4), new SqlParameter("@Sname", SqlDbType.NVarChar,30), new SqlParameter("@SnameSpell", SqlDbType.VarChar,45), new SqlParameter("@SnameEnglish", SqlDbType.VarChar,45), new SqlParameter("@SnameOld", SqlDbType.NVarChar,45), new SqlParameter("@IdNumber", SqlDbType.VarChar,45), new SqlParameter("@Sex", SqlDbType.Bit,1), new SqlParameter("@StuType", SqlDbType.NVarChar,45), new SqlParameter("@StuNationality", SqlDbType.NVarChar,20), new SqlParameter("@StuProvince", SqlDbType.NVarChar,45), new SqlParameter("@StuBirthday", SqlDbType.Date,3), new SqlParameter("@StuPolitical", SqlDbType.NVarChar,45), new SqlParameter("@StuDept", SqlDbType.Int,4), new SqlParameter("@StuZipCode", SqlDbType.VarChar,45), new SqlParameter("@StuEnrollDate", SqlDbType.Date,3), new SqlParameter("@StuMajor", SqlDbType.Int,4), new SqlParameter("@StuGrade", SqlDbType.Int,4), new SqlParameter("@StuClassId", SqlDbType.Int,4), new SqlParameter("@PlanId", SqlDbType.Int,4), new SqlParameter("@District", SqlDbType.NVarChar,45)}; parameters[0].Value = model.Sid; parameters[1].Value = model.Sname; parameters[2].Value = model.SnameSpell; parameters[3].Value = model.SnameEnglish; parameters[4].Value = model.SnameOld; parameters[5].Value = model.IdNumber; parameters[6].Value = model.Sex; parameters[7].Value = model.StuType; parameters[8].Value = model.StuNationality; parameters[9].Value = model.StuProvince; parameters[10].Value = model.StuBirthday; parameters[11].Value = model.StuPolitical; parameters[12].Value = model.StuDept; parameters[13].Value = model.StuZipCode; parameters[14].Value = model.StuEnrollDate; parameters[15].Value = model.StuMajor; parameters[16].Value = model.StuGrade; parameters[17].Value = model.StuClassId; parameters[18].Value = model.PlanId; parameters[19].Value = model.District; int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Danyl.SnnuURP.Model.TeacherWageAdjustmentView model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update TeacherWageAdjustmentView set "); strSql.Append("Id=@Id,"); strSql.Append("Tid=@Tid,"); strSql.Append("Tname=@Tname,"); strSql.Append("Sex=@Sex,"); strSql.Append("IdNumber=@IdNumber,"); strSql.Append("TeacherTypeId=@TeacherTypeId,"); strSql.Append("Degree=@Degree,"); strSql.Append("DeptName=@DeptName,"); strSql.Append("NewSalary=@NewSalary,"); strSql.Append("OldSalary=@OldSalary,"); strSql.Append("BasicWage=@BasicWage,"); strSql.Append("JobSubsidies=@JobSubsidies,"); strSql.Append("PersonalIncomeTax=@PersonalIncomeTax"); strSql.Append(" where Id=@Id "); SqlParameter[] parameters = { new SqlParameter("@Id", SqlDbType.Int,4), new SqlParameter("@Tid", SqlDbType.Int,4), new SqlParameter("@Tname", SqlDbType.NVarChar,30), new SqlParameter("@Sex", SqlDbType.Bit,1), new SqlParameter("@IdNumber", SqlDbType.VarChar,45), new SqlParameter("@TeacherTypeId", SqlDbType.Int,4), new SqlParameter("@Degree", SqlDbType.NVarChar,20), new SqlParameter("@DeptName", SqlDbType.NVarChar,30), new SqlParameter("@NewSalary", SqlDbType.Decimal,9), new SqlParameter("@OldSalary", SqlDbType.Decimal,9), new SqlParameter("@BasicWage", SqlDbType.Decimal,9), new SqlParameter("@JobSubsidies", SqlDbType.Decimal,9), new SqlParameter("@PersonalIncomeTax", SqlDbType.VarChar,45)}; parameters[0].Value = model.Id; parameters[1].Value = model.Tid; parameters[2].Value = model.Tname; parameters[3].Value = model.Sex; parameters[4].Value = model.IdNumber; parameters[5].Value = model.TeacherTypeId; parameters[6].Value = model.Degree; parameters[7].Value = model.DeptName; parameters[8].Value = model.NewSalary; parameters[9].Value = model.OldSalary; parameters[10].Value = model.BasicWage; parameters[11].Value = model.JobSubsidies; parameters[12].Value = model.PersonalIncomeTax; int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Danyl.SnnuURP.Model.RoomUseView model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update RoomUseView set "); strSql.Append("Id=@Id,"); strSql.Append("Uid=@Uid,"); strSql.Append("Uname=@Uname,"); strSql.Append("UserPhone=@UserPhone,"); strSql.Append("Rname=@Rname,"); strSql.Append("RoomType=@RoomType,"); strSql.Append("Capacity=@Capacity,"); strSql.Append("Purpose=@Purpose,"); strSql.Append("UseDate=@UseDate,"); strSql.Append("UseStatus=@UseStatus,"); strSql.Append("Rid=@Rid,"); strSql.Append("UserEmail=@UserEmail"); strSql.Append(" where Id=@Id "); SqlParameter[] parameters = { new SqlParameter("@Id", SqlDbType.Int,4), new SqlParameter("@Uid", SqlDbType.VarChar,45), new SqlParameter("@Uname", SqlDbType.NVarChar,45), new SqlParameter("@UserPhone", SqlDbType.VarChar,45), new SqlParameter("@Rname", SqlDbType.NVarChar,20), new SqlParameter("@RoomType", SqlDbType.VarChar,45), new SqlParameter("@Capacity", SqlDbType.Int,4), new SqlParameter("@Purpose", SqlDbType.NVarChar,50), new SqlParameter("@UseDate", SqlDbType.DateTime), new SqlParameter("@UseStatus", SqlDbType.VarChar,45), new SqlParameter("@Rid", SqlDbType.Int,4), new SqlParameter("@UserEmail", SqlDbType.VarChar,45)}; parameters[0].Value = model.Id; parameters[1].Value = model.Uid; parameters[2].Value = model.Uname; parameters[3].Value = model.UserPhone; parameters[4].Value = model.Rname; parameters[5].Value = model.RoomType; parameters[6].Value = model.Capacity; parameters[7].Value = model.Purpose; parameters[8].Value = model.UseDate; parameters[9].Value = model.UseStatus; parameters[10].Value = model.Rid; parameters[11].Value = model.UserEmail; int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Danyl.SnnuURP.Model.TeachCourseView model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into TeachCourseView("); strSql.Append("Tid,Tname,Cid,Cname,DeptId,Years,Semaster,CourseAttribute,Credit,TextBook,Hours,WeekHours,CourseRemainder,Section,Week)"); strSql.Append(" values ("); strSql.Append("@Tid,@Tname,@Cid,@Cname,@DeptId,@Years,@Semaster,@CourseAttribute,@Credit,@TextBook,@Hours,@WeekHours,@CourseRemainder,@Section,@Week)"); SqlParameter[] parameters = { new SqlParameter("@Tid", SqlDbType.Int,4), new SqlParameter("@Tname", SqlDbType.NVarChar,30), new SqlParameter("@Cid", SqlDbType.Int,4), new SqlParameter("@Cname", SqlDbType.NVarChar,30), new SqlParameter("@DeptId", SqlDbType.Int,4), new SqlParameter("@Years", SqlDbType.Date,3), new SqlParameter("@Semaster", SqlDbType.Int,4), new SqlParameter("@CourseAttribute", SqlDbType.VarChar,45), new SqlParameter("@Credit", SqlDbType.Float,8), new SqlParameter("@TextBook", SqlDbType.NVarChar,50), new SqlParameter("@Hours", SqlDbType.Int,4), new SqlParameter("@WeekHours", SqlDbType.Int,4), new SqlParameter("@CourseRemainder", SqlDbType.Int,4), new SqlParameter("@Section", SqlDbType.Int,4), new SqlParameter("@Week", SqlDbType.VarChar,45)}; parameters[0].Value = model.Tid; parameters[1].Value = model.Tname; parameters[2].Value = model.Cid; parameters[3].Value = model.Cname; parameters[4].Value = model.DeptId; parameters[5].Value = model.Years; parameters[6].Value = model.Semaster; parameters[7].Value = model.CourseAttribute; parameters[8].Value = model.Credit; parameters[9].Value = model.TextBook; parameters[10].Value = model.Hours; parameters[11].Value = model.WeekHours; parameters[12].Value = model.CourseRemainder; parameters[13].Value = model.Section; parameters[14].Value = model.Week; int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Danyl.SnnuURP.Model.TeacherWageAdjustmentView model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into TeacherWageAdjustmentView("); strSql.Append("Id,Tid,Tname,Sex,IdNumber,TeacherTypeId,Degree,DeptName,NewSalary,OldSalary,BasicWage,JobSubsidies,PersonalIncomeTax)"); strSql.Append(" values ("); strSql.Append("@Id,@Tid,@Tname,@Sex,@IdNumber,@TeacherTypeId,@Degree,@DeptName,@NewSalary,@OldSalary,@BasicWage,@JobSubsidies,@PersonalIncomeTax)"); SqlParameter[] parameters = { new SqlParameter("@Id", SqlDbType.Int,4), new SqlParameter("@Tid", SqlDbType.Int,4), new SqlParameter("@Tname", SqlDbType.NVarChar,30), new SqlParameter("@Sex", SqlDbType.Bit,1), new SqlParameter("@IdNumber", SqlDbType.VarChar,45), new SqlParameter("@TeacherTypeId", SqlDbType.Int,4), new SqlParameter("@Degree", SqlDbType.NVarChar,20), new SqlParameter("@DeptName", SqlDbType.NVarChar,30), new SqlParameter("@NewSalary", SqlDbType.Decimal,9), new SqlParameter("@OldSalary", SqlDbType.Decimal,9), new SqlParameter("@BasicWage", SqlDbType.Decimal,9), new SqlParameter("@JobSubsidies", SqlDbType.Decimal,9), new SqlParameter("@PersonalIncomeTax", SqlDbType.VarChar,45)}; parameters[0].Value = model.Id; parameters[1].Value = model.Tid; parameters[2].Value = model.Tname; parameters[3].Value = model.Sex; parameters[4].Value = model.IdNumber; parameters[5].Value = model.TeacherTypeId; parameters[6].Value = model.Degree; parameters[7].Value = model.DeptName; parameters[8].Value = model.NewSalary; parameters[9].Value = model.OldSalary; parameters[10].Value = model.BasicWage; parameters[11].Value = model.JobSubsidies; parameters[12].Value = model.PersonalIncomeTax; int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Danyl.SnnuURP.Model.RoomUseView model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into RoomUseView("); strSql.Append("Id,Uid,Uname,UserPhone,Rname,RoomType,Capacity,Purpose,UseDate,UseStatus,Rid,UserEmail)"); strSql.Append(" values ("); strSql.Append("@Id,@Uid,@Uname,@UserPhone,@Rname,@RoomType,@Capacity,@Purpose,@UseDate,@UseStatus,@Rid,@UserEmail)"); SqlParameter[] parameters = { new SqlParameter("@Id", SqlDbType.Int,4), new SqlParameter("@Uid", SqlDbType.VarChar,45), new SqlParameter("@Uname", SqlDbType.NVarChar,45), new SqlParameter("@UserPhone", SqlDbType.VarChar,45), new SqlParameter("@Rname", SqlDbType.NVarChar,20), new SqlParameter("@RoomType", SqlDbType.VarChar,45), new SqlParameter("@Capacity", SqlDbType.Int,4), new SqlParameter("@Purpose", SqlDbType.NVarChar,50), new SqlParameter("@UseDate", SqlDbType.DateTime), new SqlParameter("@UseStatus", SqlDbType.VarChar,45), new SqlParameter("@Rid", SqlDbType.Int,4), new SqlParameter("@UserEmail", SqlDbType.VarChar,45)}; parameters[0].Value = model.Id; parameters[1].Value = model.Uid; parameters[2].Value = model.Uname; parameters[3].Value = model.UserPhone; parameters[4].Value = model.Rname; parameters[5].Value = model.RoomType; parameters[6].Value = model.Capacity; parameters[7].Value = model.Purpose; parameters[8].Value = model.UseDate; parameters[9].Value = model.UseStatus; parameters[10].Value = model.Rid; parameters[11].Value = model.UserEmail; int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Danyl.SnnuURP.Model.WageInfo model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update WageInfo set "); strSql.Append("Tname=@Tname,"); strSql.Append("Month=@Month,"); strSql.Append("BasicWage=@BasicWage,"); strSql.Append("JobSubsidies=@JobSubsidies,"); strSql.Append("PersonalIncomeTax=@PersonalIncomeTax,"); strSql.Append("SocialSecurity=@SocialSecurity,"); strSql.Append("Remark=@Remark"); strSql.Append(" where Id=@Id"); SqlParameter[] parameters = { new SqlParameter("@Tname", SqlDbType.NVarChar,20), new SqlParameter("@Month", SqlDbType.VarChar,45), new SqlParameter("@BasicWage", SqlDbType.Decimal,9), new SqlParameter("@JobSubsidies", SqlDbType.Decimal,9), new SqlParameter("@PersonalIncomeTax", SqlDbType.VarChar,45), new SqlParameter("@SocialSecurity", SqlDbType.VarChar,45), new SqlParameter("@Remark", SqlDbType.NVarChar,200), new SqlParameter("@Id", SqlDbType.Int,4), new SqlParameter("@Tid", SqlDbType.Int,4)}; parameters[0].Value = model.Tname; parameters[1].Value = model.Month; parameters[2].Value = model.BasicWage; parameters[3].Value = model.JobSubsidies; parameters[4].Value = model.PersonalIncomeTax; parameters[5].Value = model.SocialSecurity; parameters[6].Value = model.Remark; parameters[7].Value = model.Id; parameters[8].Value = model.Tid; int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); if (rows > 0) { return true; } else { return false; } }