private bool DeleteDataFromDataTable(string sn, string tableName) { string strSql; if (sn != string.Empty) { strSql = "delete from " + tableName + " where sn=" + "'" + sn + "'"; } else { strSql = "delete from " + tableName; } strSql += ";"; List <string> strSqlList = new List <string>(); strSqlList.Add(strSql); return(_idbRead.ExecuteNonQueryTrans(strSqlList)); }
/// <summary> /// 插入操作日志 /// </summary> /// <param name="opLog"></param> /// <returns></returns> public bool InsertOprLog(OprLog opLog) { List <string> strSqlList = new List <string>(); string strSql = string.Format("insert into oprlog values('{0}',{1},{2},datetime('now'),'{3}','{4}');", opLog.Sn, opLog.Type, opLog.Source, opLog.Content, opLog.Condition); strSqlList.Add(strSql); return(_idbWrite.ExecuteNonQueryTrans(strSqlList)); }