BasicData.cs 22 KB

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