LogManager.cs 819 B

123456789101112131415161718192021
  1. using System;
  2. using System.IO;
  3. using UAS_LabelMachine.Entity;
  4. namespace UAS_LabelMachine.PublicMethod
  5. {
  6. class LogManager
  7. {
  8. public static void DoLog(string Message)
  9. {
  10. StreamWriter sw = File.AppendText("Log/" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt");
  11. sw.WriteLine("\n" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " " + Message + "\n");
  12. sw.Close();
  13. }
  14. public static void DoCommandLog(string iInoutNO, string iUserCode, string iOperater, string iResult)
  15. {
  16. SystemInf.dh.ExecuteSql("insert into CS$PRODOUTLOG (cp_id,cp_inoutno,cp_man,cp_operate,cp_result,cp_date) values(CS$PRODOUTLOG_SEQ.nextval,'" + iInoutNO + "','" + iUserCode + "','" + iOperater + "','" + iResult + "',sysdate)", "insert");
  17. }
  18. }
  19. }