JetDataAnalysisContext.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using DataAnalysisControl.Core;
  6. using Aitex.Core.RT.Log;
  7. namespace Triton160.UI.ViewModel
  8. {
  9. public class JetDataAnalysisContext : IDataAnalysisControlContext
  10. {
  11. public Dictionary<string, string> GetChamberList()
  12. {
  13. Dictionary<string, string> lst = new Dictionary<string, string>();
  14. lst["System"] = "System";
  15. return lst;
  16. }
  17. public Dictionary<string, string> GetRecipeChamberList()
  18. {
  19. Dictionary<string, string> lst = new Dictionary<string, string>();
  20. lst["System"] = "System";
  21. return lst;
  22. }
  23. public void Write(string info)
  24. {
  25. LOG.Write(info);
  26. }
  27. public void Write(Exception ex, string error)
  28. {
  29. LOG.Write(ex, error);
  30. }
  31. public string GetDBConnString()
  32. {
  33. string connString = string.Empty;
  34. try
  35. {
  36. connString = System.Configuration.ConfigurationManager.ConnectionStrings["DataAnalysisPostgreSQL"].ConnectionString;
  37. }
  38. catch (Exception ex)
  39. {
  40. LOG.Write(ex);
  41. }
  42. if (string.IsNullOrEmpty(connString))
  43. connString = "Server=localhost;Port=5432;User Id=postgres;Password=123456;Database=triton160db;Enlist=true;";
  44. return connString;
  45. }
  46. public void WriteLog(Exception ex, string error)
  47. {
  48. LOG.Write(ex);
  49. }
  50. }
  51. }