CNAS取数仪器端升级
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

82 строки
2.8KB

  1. using CnasSynchronousCommon;
  2. using CnasSynchronusDAL;
  3. using CnasSynchronusIDAL;
  4. using CnasSynchrousModel;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Data;
  8. using System.Linq;
  9. using System.Text;
  10. namespace CnasSynchronusClient
  11. {
  12. public class SQLiteInstrumentData : InstrumentData
  13. {
  14. public string StrLocalPath { get; set; }
  15. public string StrUser { get; set; }
  16. public string StrPwd { get; set; }
  17. public string strTableName { get; set; }
  18. public string strDateColumn { get; set; }
  19. public string strDate { get; set; }
  20. public ISqliteService sqliteDataBaseService { get { return new SqliteDBService(); } }
  21. public SqliteFormatConfig SqliteFormat { get; set; }
  22. public SQLiteInstrumentData(InstrumentDataSourceInfo dataSourceInfo, object[] vs)
  23. {
  24. SqliteFormat = FileOperation.GetFormatConfigData<SqliteFormatConfig>("SqliteFormatConfig.xml");
  25. RemoteFileCopy remoteFileCopy = new RemoteFileCopy(dataSourceInfo);
  26. remoteFileCopy.CopyFileFromRemote(".db");
  27. this.StrLocalPath = FileHelper.getBasePath() + "\\Cache\\" + System.Text.RegularExpressions.Regex.Replace(dataSourceInfo.Path, "[ \\[ \\] \\^ \\-_*×――(^)|'$%~!@#$…&%¥—+=<>《》!!???::•`·、。,;,.;\"‘’“”-]", "").Replace(@"\", "") + ".db";
  28. this.StrUser = dataSourceInfo.UserId;
  29. this.StrPwd = dataSourceInfo.UserPwd;
  30. this.strTableName = vs[0].ToString();
  31. this.strDateColumn = vs[1].ToString();
  32. this.strDate = vs[2].ToString();
  33. }
  34. public override Dictionary<string, DataTable> GetInstrumentData()
  35. {
  36. return sqliteDataBaseService.GetInstrumentData(new SqliteOpenParams { StrPath = StrLocalPath, StrPwd = StrPwd });
  37. }
  38. public override DataTable GetInstrumentDataByDate()
  39. {
  40. return sqliteDataBaseService.GetInstrumentDataByDate(
  41. new SqliteOpenParams
  42. {
  43. StrPath = StrLocalPath,
  44. StrPwd = StrPwd,
  45. autoSql = SqliteFormat.AutoSql
  46. },
  47. new ConditionParams
  48. {
  49. TableName = strTableName,
  50. DateColumn = strDateColumn,
  51. DateValue = strDate
  52. });
  53. }
  54. public override DataTable GetInstrumentDataStruct()
  55. {
  56. return sqliteDataBaseService.GetInstrumentDataStruct(
  57. new SqliteOpenParams
  58. {
  59. StrPath = StrLocalPath,
  60. StrPwd = StrPwd,
  61. autoSql = SqliteFormat.AutoSql
  62. },
  63. new ConditionParams
  64. {
  65. TableName = strTableName
  66. });
  67. }
  68. }
  69. }