Utils.cs 855 B

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using cuidian.Sql;
  7. using Logs;
  8. namespace OperationLog
  9. {
  10. public class Utils
  11. {
  12. public static void WriteErrorLog(string operType, string msg)
  13. {
  14. string msgSql = "insert into errmsg(opertype,msg) values('{0}','{1}')";
  15. try
  16. {
  17. DbUtils.ExecuteNonQuery(string.Format(msgSql,operType,msg), ConnectionUtils.Instance.GetConnection("TempDB"));
  18. }
  19. catch (Exception ex)
  20. {
  21. LogHelper.Debug(ex.Message);
  22. }
  23. }
  24. public static void UpdateTempRecord(string sql)
  25. {
  26. DbUtils.ExecuteNonQuery(sql, ConnectionUtils.Instance.GetConnection("TempDB"));
  27. }
  28. }
  29. }