/// <summary> /// 增加一条数据 /// </summary> public int Add(JiaJiao.Model.RegInfo model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into RegInfo("); strSql.Append("TeacherId,DayId,StuId,CreateTime,UpdateTime)"); strSql.Append(" values ("); strSql.Append("@TeacherId,@DayId,@StuId,@CreateTime,@UpdateTime)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@TeacherId", SqlDbType.Int,4), new SqlParameter("@DayId", SqlDbType.Int,4), new SqlParameter("@StuId", SqlDbType.NChar,10), new SqlParameter("@CreateTime", SqlDbType.DateTime), new SqlParameter("@UpdateTime", SqlDbType.DateTime)}; parameters[0].Value = model.TeacherId; parameters[1].Value = model.DayId; parameters[2].Value = model.StuId; parameters[3].Value = model.CreateTime; parameters[4].Value = model.UpdateTime; object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters); if (obj == null) { return 0; } else { return Convert.ToInt32(obj); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(JiaJiao.Model.Student model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into Student("); strSql.Append("StuName,StuEmail,StuTel,StuAddress,RoleId,CreateTime,UpdteTime)"); strSql.Append(" values ("); strSql.Append("@StuName,@StuEmail,@StuTel,@StuAddress,@RoleId,@CreateTime,@UpdteTime)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@StuName", SqlDbType.NVarChar,50), new SqlParameter("@StuEmail", SqlDbType.NVarChar,50), new SqlParameter("@StuTel", SqlDbType.NVarChar,50), new SqlParameter("@StuAddress", SqlDbType.NVarChar,50), new SqlParameter("@RoleId", SqlDbType.Int,4), new SqlParameter("@CreateTime", SqlDbType.DateTime), new SqlParameter("@UpdteTime", SqlDbType.DateTime)}; parameters[0].Value = model.StuName; parameters[1].Value = model.StuEmail; parameters[2].Value = model.StuTel; parameters[3].Value = model.StuAddress; parameters[4].Value = model.RoleId; parameters[5].Value = model.CreateTime; parameters[6].Value = model.UpdteTime; object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters); if (obj == null) { return 0; } else { return Convert.ToInt32(obj); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(JiaJiao.Model.Teacher model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into Teacher("); strSql.Append("TeacherName,TeacherTel,TeacherEmail,TeacherAddress,TeacherDescribe,RoleId,CreateTime,UpdateTime,Image)"); strSql.Append(" values ("); strSql.Append("@TeacherName,@TeacherTel,@TeacherEmail,@TeacherAddress,@TeacherDescribe,@RoleId,@CreateTime,@UpdateTime,@Image)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@TeacherName", SqlDbType.NVarChar,50), new SqlParameter("@TeacherTel", SqlDbType.NVarChar,50), new SqlParameter("@TeacherEmail", SqlDbType.NVarChar,50), new SqlParameter("@TeacherAddress", SqlDbType.NVarChar,50), new SqlParameter("@TeacherDescribe", SqlDbType.NVarChar,50), new SqlParameter("@RoleId", SqlDbType.Int,4), new SqlParameter("@CreateTime", SqlDbType.DateTime), new SqlParameter("@UpdateTime", SqlDbType.DateTime), new SqlParameter("@Image", SqlDbType.NVarChar,50)}; parameters[0].Value = model.TeacherName; parameters[1].Value = model.TeacherTel; parameters[2].Value = model.TeacherEmail; parameters[3].Value = model.TeacherAddress; parameters[4].Value = model.TeacherDescribe; parameters[5].Value = model.RoleId; parameters[6].Value = model.CreateTime; parameters[7].Value = model.UpdateTime; parameters[8].Value = model.Image; object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters); if (obj == null) { return 0; } else { return Convert.ToInt32(obj); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(JiaJiao.Model.ErrorLog model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into ErrorLog("); strSql.Append("ErrorTime,ErrorMessage)"); strSql.Append(" values ("); strSql.Append("@ErrorTime,@ErrorMessage)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@ErrorTime", SqlDbType.DateTime), new SqlParameter("@ErrorMessage", SqlDbType.NVarChar,500)}; parameters[0].Value = model.ErrorTime; parameters[1].Value = model.ErrorMessage; object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters); if (obj == null) { return 0; } else { return Convert.ToInt32(obj); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(JiaJiao.Model.Class model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into Class("); strSql.Append("Day,Time)"); strSql.Append(" values ("); strSql.Append("@Day,@Time)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@Day", SqlDbType.NVarChar,50), new SqlParameter("@Time", SqlDbType.NVarChar,50)}; parameters[0].Value = model.Day; parameters[1].Value = model.Time; object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters); if (obj == null) { return 0; } else { return Convert.ToInt32(obj); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(JiaJiao.Model.ErrorLog model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update ErrorLog set "); strSql.Append("ErrorTime=@ErrorTime,"); strSql.Append("ErrorMessage=@ErrorMessage"); strSql.Append(" where ID=@ID"); SqlParameter[] parameters = { new SqlParameter("@ErrorTime", SqlDbType.DateTime), new SqlParameter("@ErrorMessage", SqlDbType.NVarChar,500), new SqlParameter("@ID", SqlDbType.Int,4)}; parameters[0].Value = model.ErrorTime; parameters[1].Value = model.ErrorMessage; parameters[2].Value = model.ID; int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(JiaJiao.Model.RegInfo model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update RegInfo set "); strSql.Append("TeacherId=@TeacherId,"); strSql.Append("DayId=@DayId,"); strSql.Append("StuId=@StuId,"); strSql.Append("CreateTime=@CreateTime,"); strSql.Append("UpdateTime=@UpdateTime"); strSql.Append(" where ID=@ID"); SqlParameter[] parameters = { new SqlParameter("@TeacherId", SqlDbType.Int,4), new SqlParameter("@DayId", SqlDbType.Int,4), new SqlParameter("@StuId", SqlDbType.NChar,10), new SqlParameter("@CreateTime", SqlDbType.DateTime), new SqlParameter("@UpdateTime", SqlDbType.DateTime), new SqlParameter("@ID", SqlDbType.Int,4)}; parameters[0].Value = model.TeacherId; parameters[1].Value = model.DayId; parameters[2].Value = model.StuId; parameters[3].Value = model.CreateTime; parameters[4].Value = model.UpdateTime; parameters[5].Value = model.ID; int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(JiaJiao.Model.Teacher model) { return dal.Add(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(JiaJiao.Model.Student model) { return dal.Add(model); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(JiaJiao.Model.Class model) { return dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(JiaJiao.Model.ErrorLog model) { return dal.Add(model); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(JiaJiao.Model.ErrorLog model) { return dal.Update(model); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(JiaJiao.Model.ClassSetting model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update ClassSetting set "); strSql.Append("TeacherId=@TeacherId,"); strSql.Append("DayId=@DayId,"); strSql.Append("Total=@Total,"); strSql.Append("Count=@Count,"); strSql.Append("CreateTime=@CreateTime,"); strSql.Append("UpdateTime=@UpdateTime"); strSql.Append(" where ID=@ID"); SqlParameter[] parameters = { new SqlParameter("@TeacherId", SqlDbType.Int,4), new SqlParameter("@DayId", SqlDbType.Int,4), new SqlParameter("@Total", SqlDbType.Int,4), new SqlParameter("@Count", SqlDbType.Int,4), new SqlParameter("@CreateTime", SqlDbType.DateTime), new SqlParameter("@UpdateTime", SqlDbType.DateTime), new SqlParameter("@ID", SqlDbType.Int,4)}; parameters[0].Value = model.TeacherId; parameters[1].Value = model.DayId; parameters[2].Value = model.Total; parameters[3].Value = model.Count; parameters[4].Value = model.CreateTime; parameters[5].Value = model.UpdateTime; parameters[6].Value = model.ID; int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(JiaJiao.Model.Class model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update Class set "); strSql.Append("Day=@Day,"); strSql.Append("Time=@Time"); strSql.Append(" where ID=@ID"); SqlParameter[] parameters = { new SqlParameter("@Day", SqlDbType.NVarChar,50), new SqlParameter("@Time", SqlDbType.NVarChar,50), new SqlParameter("@ID", SqlDbType.Int,4)}; parameters[0].Value = model.Day; parameters[1].Value = model.Time; parameters[2].Value = model.ID; int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(JiaJiao.Model.RegInfo model) { return dal.Add(model); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(JiaJiao.Model.RegInfo model) { return dal.Update(model); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(JiaJiao.Model.Teacher model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update Teacher set "); strSql.Append("TeacherName=@TeacherName,"); strSql.Append("TeacherTel=@TeacherTel,"); strSql.Append("TeacherEmail=@TeacherEmail,"); strSql.Append("TeacherAddress=@TeacherAddress,"); strSql.Append("TeacherDescribe=@TeacherDescribe,"); strSql.Append("RoleId=@RoleId,"); strSql.Append("CreateTime=@CreateTime,"); strSql.Append("UpdateTime=@UpdateTime,"); strSql.Append("Image=@Image"); strSql.Append(" where ID=@ID"); SqlParameter[] parameters = { new SqlParameter("@TeacherName", SqlDbType.NVarChar,50), new SqlParameter("@TeacherTel", SqlDbType.NVarChar,50), new SqlParameter("@TeacherEmail", SqlDbType.NVarChar,50), new SqlParameter("@TeacherAddress", SqlDbType.NVarChar,50), new SqlParameter("@TeacherDescribe", SqlDbType.NVarChar,50), new SqlParameter("@RoleId", SqlDbType.Int,4), new SqlParameter("@CreateTime", SqlDbType.DateTime), new SqlParameter("@UpdateTime", SqlDbType.DateTime), new SqlParameter("@Image", SqlDbType.NVarChar,50), new SqlParameter("@ID", SqlDbType.Int,4)}; parameters[0].Value = model.TeacherName; parameters[1].Value = model.TeacherTel; parameters[2].Value = model.TeacherEmail; parameters[3].Value = model.TeacherAddress; parameters[4].Value = model.TeacherDescribe; parameters[5].Value = model.RoleId; parameters[6].Value = model.CreateTime; parameters[7].Value = model.UpdateTime; parameters[8].Value = model.Image; parameters[9].Value = model.ID; int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(JiaJiao.Model.Teacher model) { return dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(JiaJiao.Model.Class model) { return dal.Add(model); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(JiaJiao.Model.Student model) { return dal.Update(model); }