/// <summary> /// 增加一条数据 /// </summary> public int Add(GameDrawList model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into usta_GameDrawList("); strSql.Append("teacherNo,gameCategoryId,gameTypeId,groupNum,groupIndex,updateTime)"); strSql.Append(" values ("); strSql.Append("@teacherNo,@gameCategoryId,@gameTypeId,@groupNum,@groupIndex,@updateTime)"); SqlParameter[] parameters = { new SqlParameter("@teacherNo", SqlDbType.NVarChar,50), new SqlParameter("@gameCategoryId", SqlDbType.Int,4), new SqlParameter("@gameTypeId", SqlDbType.Int,4), new SqlParameter("@groupNum", SqlDbType.NChar,10), new SqlParameter("@groupIndex", SqlDbType.TinyInt,1), new SqlParameter("@updateTime", SqlDbType.DateTime)}; parameters[0].Value = model.teacherNo; parameters[1].Value = model.gameCategoryId; parameters[2].Value = model.gameTypeId; parameters[3].Value = model.groupNum; parameters[4].Value = model.groupIndex; parameters[5].Value = model.updateTime; return SqlHelper.ExecuteNonQuery(conn, CommandType.Text, strSql.ToString(), parameters); }
/// <summary> /// 更新一条数据 /// </summary> public int Update(GameDrawList model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update usta_GameDrawList set "); strSql.Append("teacherNo=@teacherNo,"); strSql.Append("gameCategoryId=@gameCategoryId,"); strSql.Append("gameTypeId=@gameTypeId,"); strSql.Append("groupNum=@groupNum,"); strSql.Append("groupIndex=@groupIndex"); strSql.Append(" where gameDrawListId=@gameDrawListId"); SqlParameter[] parameters = { new SqlParameter("@teacherNo", SqlDbType.NVarChar,50), new SqlParameter("@gameCategoryId", SqlDbType.Int,4), new SqlParameter("@gameTypeId", SqlDbType.Int,4), new SqlParameter("@groupNum", SqlDbType.NChar,10), new SqlParameter("@groupIndex", SqlDbType.TinyInt,1), new SqlParameter("@gameDrawListId", SqlDbType.Int,4)}; parameters[0].Value = model.teacherNo; parameters[1].Value = model.gameCategoryId; parameters[2].Value = model.gameTypeId; parameters[3].Value = model.groupNum; parameters[4].Value = model.groupIndex; parameters[5].Value = model.gameDrawListId; return SqlHelper.ExecuteNonQuery(conn, CommandType.Text, strSql.ToString(), parameters); }