using (OracleConnection conn = new OracleConnection(OracleString))
{
conn.Open();
var trans = conn.BeginTransaction();
string strsql = "insert into MYJYYZJ_print(STORECODE,CLS,NUM,LINE,FILDATE,CONTENT,STAT,LSTUPDTIME) values(:STORECODE,:CLS,:NUM,:LINE,:FILDATE,:CONTENT,:STAT,:LSTUPDTIME);";
try
{
for (int i = 0; i < contents.Count; i++)
{
OracleCommand com = new OracleCommand();
List<OracleParameter> pars = new List<OracleParameter>()
{
new OracleParameter("STORECODE",storeCode),
new OracleParameter("CLS",title), //1
new OracleParameter("NUM", printNum), //2
new OracleParameter("LINE", i + 1), //3
new OracleParameter("FILDATE", DateTime.Now), //4
new OracleParameter("CONTENT",contents), //5
new OracleParameter("STAT",10), //6
new OracleParameter("LSTUPDTIME", DateTime.Now) //7
};
PrepareCommand(com, conn, trans, CommandType.Text, strsql, pars.ToArray());
if (com.ExecuteNonQuery() <= 0)
throw new TangJiuBusinessException("插入错误");
com.Parameters.Clear();
}
trans.Commit();
return true;