BasicData.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. 
  2. using DevExpress.Office.Drawing;
  3. using NPOI.Util;
  4. using OTSCommon.DBOperate;
  5. using OTSIncAReportApp.DataOperation.DataAccess;
  6. using OTSIncAReportApp.OTSRstMgrFunction;
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Data;
  10. using System.Linq;
  11. using System.Text;
  12. using System.Threading.Tasks;
  13. using static OTSDataType.otsdataconst;
  14. using static OTSIncAReportApp.OTSReport_Export;
  15. namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
  16. {
  17. public class BasicData
  18. {
  19. ParticleData fielddata;
  20. private string SizeChart = "";
  21. List<string> colid = new List<string>();
  22. List<string> colid_Below7 = new List<string>();
  23. List<string> GroupInformation = new List<string>();
  24. private List<DataTable> BData = new List<DataTable>();
  25. private List<DataTable> Measurements = new List<DataTable>();//测量结果数据列队
  26. private DataTable AllClass = new DataTable();
  27. private DataTable AllElement = new DataTable();
  28. private bool IsShereAClassificationGroup = false;
  29. private ResultFile resfile;
  30. private string FilePath = "";
  31. private string VDA19String = "5,15,25,50,100,150,200,400,600,1000";
  32. /// <summary>
  33. /// 获取粒级表
  34. /// </summary>
  35. public void SetParticlesizeTable(OTSReport_Export m_otsreport_export)
  36. {
  37. colid_Below7.Clear();
  38. //获取粒级表
  39. string path1 = m_otsreport_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.PartSizeFileFolder +
  40. m_otsreport_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.PartSizeFile;
  41. DataSet ds = OTSIncAReportApp.DataOperation.DataAccess.XMLoperate.GetXml(path1);
  42. SizeChart = ds.Tables[0].Rows[0]["Sizes"].ToString();
  43. for (int i = 0; i < SizeChart.Split(',').Length; i++)
  44. {
  45. if (SizeChart.Split(',')[i].Length > 0)
  46. {
  47. double d1 = Convert.ToDouble(SizeChart.Split(',')[i]);
  48. //double d2 = Convert.ToDouble(SizeChart.Split(',')[i + 1]);
  49. colid.Add("≥"+ d1.ToString() /*+ "~" + d2.ToString()*/);
  50. }
  51. }
  52. for (int i = 0; i < SizeChart.Split(',').Length - 1; i++)
  53. {
  54. if (SizeChart.Split(',')[i].Length > 0)
  55. {
  56. double d1 = Convert.ToDouble(SizeChart.Split(',')[i]);
  57. double d2 = Convert.ToDouble(SizeChart.Split(',')[i + 1]);
  58. colid_Below7.Add(d1.ToString() + "~" + d2.ToString());
  59. }
  60. }
  61. double d = Convert.ToDouble(SizeChart.Split(',')[SizeChart.Split(',').Length - 1]);
  62. colid_Below7.Add(d.ToString() + "~MAX");
  63. //double d = Convert.ToDouble(SizeChart.Split(',')[SizeChart.Split(',').Length - 1]);
  64. //colid.Add(d.ToString() + "~MAX");
  65. }
  66. /// <summary>
  67. /// 获取粒级表
  68. /// </summary>
  69. /// <returns></returns>
  70. public List<string> GetParticlesizeTable()
  71. {
  72. if(colid.Count>7)
  73. {
  74. return colid;
  75. }else
  76. {
  77. return colid_Below7;
  78. }
  79. }
  80. public void SetDBData(c_TemplateClass m_mbszclass, OTSReport_Export m_otsreport_export, string ComputeMode)
  81. {
  82. DataTable m_bt_DBData = new DataTable();
  83. ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResultId()].FilePath);
  84. List<string> colid = new List<string>() { "TypeName", "ar", "TypeId", "Largest", "Class", "GroupId", "con" };
  85. //获取粒级表
  86. string path1 = m_otsreport_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.PartSizeFileFolder +
  87. m_otsreport_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.PartSizeFile;
  88. DataSet ds = OTSIncAReportApp.DataOperation.DataAccess.XMLoperate.GetXml(path1);
  89. string sizestr = "";
  90. if (m_mbszclass.M_VDA19.IsVDA19)
  91. sizestr = VDA19String;
  92. else
  93. sizestr = ds.Tables[0].Rows[0]["Sizes"].ToString();
  94. bool blBelow7 = false;
  95. if (sizestr.Split(',').Length>7)
  96. {
  97. for (int i = 0; i < sizestr.Split(',').Length; i++)
  98. {
  99. if (sizestr.Split(',')[i].Length > 0)
  100. {
  101. double d1 = Convert.ToDouble(sizestr.Split(',')[i]);
  102. //double d2 = Convert.ToDouble(sizestr.Split(',')[i + 1]);
  103. colid.Add("≥" + d1.ToString() /*+ "~" + d2.ToString()*/);
  104. }
  105. }
  106. blBelow7 = true;
  107. }
  108. else
  109. {
  110. for (int i = 0; i < sizestr.Split(',').Length - 1; i++)
  111. {
  112. if (sizestr.Split(',')[i].Length > 0)
  113. {
  114. double d1 = Convert.ToDouble(sizestr.Split(',')[i]);
  115. double d2 = Convert.ToDouble(sizestr.Split(',')[i + 1]);
  116. colid.Add(d1.ToString() + "~" + d2.ToString());
  117. }
  118. }
  119. double d = Convert.ToDouble(sizestr.Split(',')[sizestr.Split(',').Length - 1]);
  120. colid.Add(d.ToString() + "~MAX");
  121. blBelow7 = false;
  122. }
  123. for (int i = 0; i < colid.Count; i++)
  124. {
  125. m_bt_DBData.Columns.Add(colid[i].ToString());
  126. }
  127. DataTable dt = InvalidRemoval(fielddata.GetParticleListForParticlSize("area", ""));
  128. DataTable AreaInformationOfAllElements = InvalidRemoval(fielddata.GetAreaByAllIncA(""));
  129. DataTable dtp = InvalidRemoval(fielddata.GetParticleAll(""));
  130. string po = ComputeMode;
  131. switch (po)
  132. {
  133. case "DMAX":
  134. po = "DMAX";
  135. break;
  136. case "DMIN":
  137. po = "DMIN";
  138. break;
  139. case "ECD":
  140. po = "Area";
  141. break;
  142. case "FERET":
  143. po = "DFERET";
  144. break;
  145. }
  146. for (int i = 0; i < dt.Rows.Count; i++)
  147. {
  148. DataRow dr = m_bt_DBData.NewRow();
  149. dr["TypeName"] = dt.Rows[i]["TypeName"].ToString();
  150. dr["TypeId"] = dt.Rows[i]["TypeId"].ToString();
  151. dr["con"] = dt.Rows[i]["con"].ToString();
  152. dr["GroupId"] = dt.Rows[i]["GroupId"].ToString();
  153. if (dt.Rows[i]["GroupName"].ToString() == "")
  154. dr["Class"] = "Default";
  155. else
  156. dr["Class"] = dt.Rows[i]["GroupName"].ToString();
  157. //continue;
  158. dr["Largest"] = Math.Round(Convert.ToDouble(dt.Rows[i]["max"]), 2);
  159. if(blBelow7)
  160. {
  161. for (int a = 7; a < colid.Count; a++)
  162. {
  163. string d1 = colid[a].Split('≥')[1];
  164. string d2;
  165. if (a == colid.Count - 1)
  166. {
  167. d2 = "9999999999999";
  168. }
  169. else
  170. {
  171. d2 = colid[a + 1].Split('≥')[1];
  172. }
  173. DataRow[] datas = dtp.Select(getWhere(d2, d1, po, dt.Rows[i]["TypeId"].ToString()));
  174. dr[colid[a]] = datas.Count();
  175. }
  176. }
  177. else
  178. {
  179. for (int a = 7; a < colid.Count; a++)
  180. {
  181. string d1 = colid[a].Split('~')[0];
  182. string d2 = colid[a].Split('~')[1];
  183. if (d2 == "MAX")
  184. {
  185. d2 = "999";
  186. }
  187. DataRow[] datas = dtp.Select(getWhere(d2, d1, po, dt.Rows[i]["TypeId"].ToString()));
  188. dr[colid[a]] = datas.Count();
  189. }
  190. }
  191. for (int a = 0; a < AreaInformationOfAllElements.Rows.Count; a++)
  192. {
  193. if (dt.Rows[i]["TypeId"].ToString() == AreaInformationOfAllElements.Rows[a]["TypeId"].ToString())
  194. {
  195. dr["ar"] = AreaInformationOfAllElements.Rows[a]["ar"];
  196. }
  197. }
  198. m_bt_DBData.Rows.Add(dr);
  199. }
  200. //去除物质分类(非夹杂物分类)//颗粒种类ID赛选
  201. //for (int a = 0; a < m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass_Serial.Count; a++)
  202. //{
  203. // for (int i = m_bt_DBData.Rows.Count - 1; i >= 0; i--)
  204. // {
  205. // if (m_bt_DBData.Rows[i]["TypeId"].ToString() == m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass_Serial[a].ToString())
  206. // {
  207. // m_bt_DBData.Rows.RemoveAt(i);
  208. // }
  209. // }
  210. //}
  211. //去除物质分类(非夹杂物分类)//颗粒种类名称赛选
  212. for (int a = 0; a < m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Count; a++)
  213. {
  214. for (int i = m_bt_DBData.Rows.Count - 1; i >= 0; i--)
  215. {
  216. if (m_bt_DBData.Rows[i]["TypeName"].ToString() == m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass[a].ToString())
  217. {
  218. m_bt_DBData.Rows.RemoveAt(i);
  219. }
  220. }
  221. }
  222. GroupInformation = new List<string>();
  223. for (int i = 0; i < m_bt_DBData.Rows.Count; i++)
  224. {
  225. bool bl = false;
  226. for (int a = 0; a < GroupInformation.Count; a++)
  227. {
  228. if (GroupInformation[a] == m_bt_DBData.Rows[i]["Class"].ToString())
  229. {
  230. bl = true;
  231. }
  232. }
  233. if (!bl)
  234. {
  235. GroupInformation.Add(m_bt_DBData.Rows[i]["Class"].ToString());
  236. }
  237. }
  238. if (m_otsreport_export.m_ReportApp.m_RptConfigFile.Systype == OTS_SysType_ID.IncA)
  239. {
  240. Measurements = new List<DataTable>();
  241. for (int i = 0; i < GroupInformation.Count; i++)
  242. {
  243. DataTable table = m_bt_DBData.Clone();
  244. for (int a = 0; a < m_bt_DBData.Rows.Count; a++)
  245. {
  246. if (GroupInformation[i] == m_bt_DBData.Rows[a]["Class"].ToString())
  247. {
  248. table.Rows.Add(m_bt_DBData.Rows[a].ItemArray);
  249. }
  250. }
  251. BData.Add(table);
  252. }
  253. //Measurements = BData.Copy();
  254. for (int i = 0; i < GroupInformation.Count; i++)
  255. {
  256. DataTable table = dtp.Clone();
  257. for (int a = 0; a < dtp.Rows.Count; a++)
  258. {
  259. if (GroupInformation[i] == dtp.Rows[a]["GroupName"].ToString())
  260. {
  261. table.Rows.Add(dtp.Rows[a].ItemArray);
  262. }
  263. }
  264. Measurements.Add(table);
  265. }
  266. return;
  267. }
  268. #region 判断是否使用指定选择组和规则
  269. bool bl1 = false;
  270. for (int i = 0; i < m_otsreport_export.m_mbszclass.RuleGroup.Rows.Count; i++)
  271. {
  272. if (m_otsreport_export.m_mbszclass.RuleGroup.Rows[i]["GroupId"].ToString() == "0")
  273. {
  274. bl1 = true;
  275. }
  276. }
  277. #endregion
  278. if (!bl1)
  279. {
  280. #region 筛选现有组
  281. List<string> strings = new List<string>();
  282. for (int i = 0; i < m_bt_DBData.Rows.Count; i++)
  283. {
  284. bool bl2 = false;
  285. for (int a = 0; a < strings.Count; a++)
  286. {
  287. if (m_bt_DBData.Rows[i]["GroupId"].ToString() == strings[a])
  288. {
  289. bl2 = true;
  290. }
  291. }
  292. if (!bl2)
  293. {
  294. strings.Add(m_bt_DBData.Rows[i]["GroupId"].ToString());
  295. }
  296. }
  297. #endregion
  298. List<DataTable> OutData = new List<DataTable>();
  299. for (int i = 0; i < strings.Count(); i++)
  300. {
  301. DataTable data = m_bt_DBData.Clone();
  302. for (int a = 0; a < m_bt_DBData.Rows.Count; a++)
  303. {
  304. if (strings[i] == m_bt_DBData.Rows[a]["GroupId"].ToString())
  305. {
  306. data.Rows.Add(m_bt_DBData.Rows[a].ItemArray);
  307. }
  308. }
  309. OutData.Add(data);
  310. }
  311. BData = OutData.Copy();
  312. Measurements = new List<DataTable>();
  313. for (int i = 0; i < GroupInformation.Count; i++)
  314. {
  315. DataTable table = dtp.Clone();
  316. for (int a = 0; a < dtp.Rows.Count; a++)
  317. {
  318. string strGroupId = "Default";
  319. if (dtp.Rows[a]["GroupName"].ToString() != "")
  320. {
  321. strGroupId = dtp.Rows[a]["GroupName"].ToString();
  322. }
  323. if (GroupInformation[i] == strGroupId)
  324. {
  325. table.Rows.Add(dtp.Rows[a].ItemArray);
  326. }
  327. }
  328. Measurements.Add(table);
  329. }
  330. return;
  331. }
  332. List<DataTable> SpecifyGroup = new List<DataTable>();
  333. for (int i = 0; i < m_otsreport_export.m_mbszclass.List_data.Count; i++)
  334. {
  335. DataTable data= m_bt_DBData.Clone();
  336. bool b3 = false;
  337. string str_class = "";
  338. for (int a = 0; a < m_otsreport_export.m_mbszclass.RuleGroup.Rows.Count; a++)
  339. {
  340. if (m_otsreport_export.m_mbszclass.RuleGroup.Rows[a]["GroupId"].ToString() == m_otsreport_export.m_mbszclass.List_data[i].TableName)
  341. {
  342. if (m_otsreport_export.m_mbszclass.RuleGroup.Rows[a]["display"].ToString() == "1")
  343. {
  344. str_class = m_otsreport_export.m_mbszclass.RuleGroup.Rows[a]["GroupName"].ToString();
  345. b3 = true;
  346. }
  347. }
  348. }
  349. data.TableName = m_otsreport_export.m_mbszclass.List_data[i].TableName;
  350. if (b3)
  351. {
  352. for (int a = 0; a < m_otsreport_export.m_mbszclass.List_data[i].Rows.Count; a++)
  353. {
  354. if (m_otsreport_export.m_mbszclass.List_data[i].Rows[a]["display"].ToString() == "1")
  355. {
  356. DataTable data1 = m_bt_DBData.Clone();
  357. DataRow row = data.NewRow();
  358. row["TypeName"] = m_otsreport_export.m_mbszclass.List_data[i].Rows[a]["StrName"];
  359. row["ar"] = 0;
  360. row["TypeId"] = m_otsreport_export.m_mbszclass.List_data[i].Rows[a]["STDId"];
  361. row["GroupId"] = m_otsreport_export.m_mbszclass.List_data[i].Rows[a]["GroupId"];
  362. row["con"] = 0;
  363. row["Largest"] = 0;
  364. row["Class"] = str_class;
  365. for (int j = 7; j < data.Columns.Count; j++)
  366. {
  367. row[j] = 0;
  368. }
  369. bool b2 = false;
  370. for (int j = 0; j < m_bt_DBData.Rows.Count; j++)
  371. {
  372. if (m_otsreport_export.m_mbszclass.List_data[i].Rows[a]["STDId"].ToString() == m_bt_DBData.Rows[j]["TypeId"].ToString())
  373. {
  374. data1.Rows.Add(m_bt_DBData.Rows[j].ItemArray);
  375. b2 = true;
  376. }
  377. }
  378. if (b2)
  379. {
  380. data.Rows.Add(data1.Rows[0].ItemArray);
  381. }
  382. else
  383. {
  384. data.Rows.Add(row);
  385. }
  386. }
  387. }
  388. }
  389. SpecifyGroup.Add(data);
  390. }
  391. BData = SpecifyGroup.Copy();
  392. #region 测量结果颗粒组队列
  393. List<DataTable> datas1 = new List<DataTable>();
  394. List<string> stringsa = fielddata.ObtainParticleCategory(m_otsreport_export, this);
  395. for (int i = 0; i < stringsa.Count; i++)
  396. {
  397. DataTable data = dtp.Clone();
  398. for (int a = 0; a < dtp.Rows.Count; a++)
  399. {
  400. if (Convert.ToInt64(dtp.Rows[i]["TypeId"]) > 10)
  401. {
  402. string strGroupName = "Default";
  403. if (dtp.Rows[a]["GroupName"].ToString() != "")
  404. {
  405. strGroupName = dtp.Rows[a]["GroupName"].ToString();
  406. }
  407. if (stringsa[i].ToString() == strGroupName)
  408. {
  409. data.Rows.Add(dtp.Rows[a].ItemArray);
  410. }
  411. }
  412. }
  413. datas1.Add(data);
  414. }
  415. Measurements = new List<DataTable>();
  416. for (int i = 0; i < m_otsreport_export.m_mbszclass.List_data.Count; i++)
  417. {
  418. bool b3 = false;
  419. string str_class = "";
  420. for (int a = 0; a < m_otsreport_export.m_mbszclass.RuleGroup.Rows.Count; a++)
  421. {
  422. if (m_otsreport_export.m_mbszclass.RuleGroup.Rows[a]["GroupId"].ToString() == m_otsreport_export.m_mbszclass.List_data[i].TableName)
  423. {
  424. if (m_otsreport_export.m_mbszclass.RuleGroup.Rows[a]["display"].ToString() == "1")
  425. {
  426. str_class = m_otsreport_export.m_mbszclass.RuleGroup.Rows[a]["GroupName"].ToString();
  427. b3 = true;
  428. }
  429. }
  430. }
  431. if (b3)
  432. {
  433. DataTable table = datas1[i].Clone();
  434. for (int a = 0; a < datas1[i].Rows.Count; a++)
  435. {
  436. for (int b = 0; b < m_otsreport_export.m_mbszclass.List_data[i].Rows.Count; b++)
  437. {
  438. if (m_otsreport_export.m_mbszclass.List_data[i].Rows[b]["display"].ToString() == "1")
  439. {
  440. if (datas1[i].Rows[a]["TypeId"].ToString() == m_otsreport_export.m_mbszclass.List_data[i].Rows[b]["STDId"].ToString())
  441. {
  442. table.Rows.Add(datas1[i].Rows[a].ItemArray);
  443. }
  444. }
  445. }
  446. }
  447. Measurements.Add(table);
  448. }
  449. }
  450. #endregion
  451. }
  452. /// <summary>
  453. /// 获取夹杂物组信息
  454. /// </summary>
  455. /// <returns></returns>
  456. public List<string> GetGroupInformation()
  457. {
  458. return GroupInformation;
  459. }
  460. /// <summary>
  461. /// 获取读取数据库并过滤颗粒
  462. /// </summary>
  463. /// <returns></returns>
  464. public List<DataTable> GetDBData()
  465. {
  466. return BData;
  467. }
  468. /// <summary>
  469. /// 获取读取数据库并过滤颗粒
  470. /// </summary>
  471. /// <returns></returns>
  472. public List<DataTable> etDBData()
  473. {
  474. return BData;
  475. }
  476. public void SetAllClass()
  477. {
  478. AllClass = fielddata.GetAllClass();
  479. }
  480. /// <summary>
  481. /// 获取全部大类
  482. /// </summary>
  483. /// <returns></returns>
  484. public DataTable GetAllClass()
  485. {
  486. return AllClass;
  487. }
  488. /// <summary>
  489. ///测量结果数据列队
  490. /// </summary>
  491. /// <returns></returns>
  492. public List<DataTable> GetMeasurements()
  493. {
  494. return Measurements;
  495. }
  496. /// <summary>
  497. /// 定义ParticleData类
  498. /// </summary>
  499. public void newParticleData(OTSReport_Export m_otsreport_export)
  500. {
  501. fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResultId()].FilePath);
  502. }
  503. public ParticleData getParticleData()
  504. {
  505. return fielddata;
  506. }
  507. public void SetAllElement()
  508. {
  509. AllElement = fielddata.GetAllElement();
  510. }
  511. /// <summary>
  512. /// 获取全部元素
  513. /// </summary>
  514. /// <returns></returns>
  515. public DataTable GetAllElement()
  516. {
  517. return AllElement;
  518. }
  519. /// <summary>
  520. /// 判断是否有大分类,有为true
  521. /// </summary>
  522. /// <param name="m_otsreport_export"></param>
  523. /// <returns></returns>
  524. public void IsThereAMajorClassification(BasicData basicData, OTSReport_Export m_otsreport_export)
  525. {
  526. //List<string> ClassName = ObtainParticleCategory(m_otsreport_export, basicData);
  527. List<string> ClassName = new List<string>();
  528. for (int i = 0; i < BData.Count; i++)
  529. {
  530. if (BData[i].Rows.Count != 0)
  531. {
  532. ClassName.Add(i.ToString());
  533. }
  534. }
  535. if (ClassName.Count < 2)
  536. {
  537. IsShereAClassificationGroup= false;
  538. }
  539. else
  540. {
  541. IsShereAClassificationGroup= true;
  542. }
  543. }
  544. public bool GetIsThereAMajorClassification()
  545. {
  546. return IsShereAClassificationGroup;
  547. }
  548. public void IsResultFilesList(OTSReport_Export m_otsreport_export)
  549. {
  550. resfile = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResultId()];
  551. }
  552. /// <summary>
  553. /// 获取标准库名称
  554. /// </summary>
  555. /// <returns></returns>
  556. public string GetResfile()
  557. {
  558. string str_libraryName = "";
  559. bool endsWithDb = resfile.GetSTDName().EndsWith(".db", StringComparison.OrdinalIgnoreCase);
  560. if (endsWithDb)
  561. {
  562. str_libraryName = resfile.GetSTDName();
  563. }
  564. else
  565. {
  566. str_libraryName = resfile.GetSTDName() + ".db";
  567. }
  568. return str_libraryName;
  569. }
  570. public void IsFilePath(OTSReport_Export m_otsreport_export)
  571. {
  572. FilePath= m_otsreport_export.m_ReportApp.m_rstDataMgr.CurResultFile.FilePath;
  573. }
  574. /// <summary>
  575. /// 得到文件路径
  576. /// </summary>
  577. /// <returns></returns>
  578. public string GetFilePath()
  579. {
  580. return FilePath;
  581. }
  582. #region 内部函数
  583. private string getWhere(string max, string min, string col, string partic)
  584. {
  585. if (col == "Area")
  586. {
  587. return col + ">=" + ((Convert.ToDouble(min) / 2) * (Convert.ToDouble(min) / 2) * Math.PI).ToString() + " and " + col + "<" + ((Convert.ToDouble(max) / 2) * (Convert.ToDouble(max) / 2) * Math.PI).ToString() + " and TypeId=" + partic;
  588. }
  589. else
  590. {
  591. return col + ">=" + min + " and " + col + "<" + max + " and TypeId=" + partic;
  592. }
  593. }
  594. private DataTable InvalidRemoval(DataTable dt)
  595. {
  596. DataTable dataTable = dt.Copy();
  597. dataTable.Clear();
  598. for (int i = 0; i < dt.Rows.Count; i++)
  599. {
  600. if (Convert.ToInt32(dt.Rows[i]["TypeId"]) > 10)
  601. {
  602. dataTable.Rows.Add(dt.Rows[i].ItemArray);
  603. }
  604. }
  605. return dataTable;
  606. }
  607. #endregion
  608. }
  609. }