年龄大了,写程序总记不住、记录一下格式:
private const string SQL_INSTERT = @"INSERT INTO QS_ROOM_QUEUE (QUEUEID,ROOMID,PRIORITY)
VALUES(?,?,?)";
private const string SQL_UPDATE = "update QS_ROOM_QUEUE set PRIORITY=? where QUEUEID= ? and ROOMID=?";
//SQL public int UpdateSql(QS_ROOM_QUEUE obj) { try { string sql = "update QS_ROOM_QUEUE set PRIORITY=@PRIORITY where QUEUEID= @QUEUEID and ROOMID=@QUEUEID"; SqlParameter[] paramers ={ new SqlParameter("@PRIORITY",SqlDbType.Int), new SqlParameter("@QUEUEID",SqlDbType.Int), new SqlParameter("@ROOMID",SqlDbType.Int) }; paramers[0].Value = obj.Priority; paramers[1].Value = obj.QUEUEID; paramers[2].Value = obj.RoomID; //paramers[7].Value = obj.OFDEPART; return SqlHelper.ExecuteNonQuery(SqlHelper.SqlConnStr, CommandType.Text, sql, paramers); } catch (Exception ex) { throw new Exception(ex.Message); } } public int InsertSql(QS_ROOM_QUEUE obj) { try { string sql = "INSERT INTO QS_ROOM_QUEUE (QUEUEID,ROOMID,PRIORITY) VALUES(@QUEUEID,@ROOMID,@PRIORITY)"; SqlParameter[] paramers ={ new SqlParameter("@QUEUEID",SqlDbType.Int), new SqlParameter("@ROOMID",SqlDbType.Int), new SqlParameter("@PRIORITY",SqlDbType.Int) }; paramers[0].Value = obj.QUEUEID; paramers[1].Value = obj.RoomID; paramers[2].Value = obj.Priority; //paramers[7].Value = obj.OFDEPART; return SqlHelper.ExecuteNonQuery(SqlHelper.SqlConnStr, CommandType.Text, sql, paramers); } catch (Exception ex) { throw new Exception(ex.Message); } } //oracle public int InsertOrcl(QS_ROOM_QUEUE obj) { try { string sql = SQL_INSTERT; OleDbParameter[] paramers ={ new OleDbParameter("QUEUEID",OleDbType.Integer), new OleDbParameter("ROOMID",OleDbType.Integer), new OleDbParameter("PRIORITY",OleDbType.Integer) }; paramers[0].Value = obj.QUEUEID; paramers[1].Value = obj.RoomID; paramers[2].Value = obj.Priority; //paramers[7].Value = obj.OFDEPART; return OracleHelper.ExecuteNonQuery(OracleHelper.OracleConnStr, CommandType.Text, sql, paramers); } catch (Exception ex) { throw new Exception(ex.Message); } } public int UpdateOrcl(QS_ROOM_QUEUE obj) { try { string sql = SQL_UPDATE; OleDbParameter[] paramers ={ new OleDbParameter("PRIORITY",OleDbType.Integer), new OleDbParameter("QUEUEID",OleDbType.Integer), new OleDbParameter("ROOMID",OleDbType.Integer) }; paramers[0].Value = obj.Priority; paramers[1].Value = obj.QUEUEID; paramers[2].Value = obj.RoomID; //paramers[7].Value = obj.OFDEPART; return OracleHelper.ExecuteNonQuery(OracleHelper.OracleConnStr, CommandType.Text, sql, paramers); } catch (Exception ex) { throw new Exception(ex.Message); } }
博客内容主要用于日常学习记录,内容比较随意,如有问题,还需谅解!!!