日期:2014-05-17 浏览次数:20685 次
string sql = string.Format("select decode( max(p_num),null,0,max(p_num))+1 p_num from T_PAIHAO where P_DATA = '{2}' and to_char(createdtime,'yyyymmdd')=to_char(sysdate,'yyyymmdd') and P_QYID= '{0}' and P_YWLX= '{1}'", qyID, ywlxID, sj);
string maxNum = crjService.GetDataByTable(sql).Tables[0].Rows[0][0].ToString();
string sqlInsert = string.Format("insert into t_paihao (P_NUM,P_QYID,P_SFZ,P_YWLX,P_PHRQ,P_DNIP,P_DATA)values('{0}','{1}','{2}','{3}','{4}','{5}','{6}')",maxNum,qyID,sfzhm,ywlxID,timeNow,ipAdd,sj);
int result = crjService.ExecuteNonQuery(sqlInsert);