BasicData.cs 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  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. //去除物质分类(非夹杂物分类)
  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. GroupInformation = new List<string>();
  207. for (int i = 0; i < m_bt_DBData.Rows.Count; i++)
  208. {
  209. bool bl = false;
  210. for (int a = 0; a < GroupInformation.Count; a++)
  211. {
  212. if (GroupInformation[a] == m_bt_DBData.Rows[i]["Class"].ToString())
  213. {
  214. bl = true;
  215. }
  216. }
  217. if (!bl)
  218. {
  219. GroupInformation.Add(m_bt_DBData.Rows[i]["Class"].ToString());
  220. }
  221. }
  222. if (m_otsreport_export.m_ReportApp.m_RptConfigFile.Systype == OTS_SysType_ID.IncA)
  223. {
  224. Measurements = new List<DataTable>();
  225. for (int i = 0; i < GroupInformation.Count; i++)
  226. {
  227. DataTable table = m_bt_DBData.Clone();
  228. for (int a = 0; a < m_bt_DBData.Rows.Count; a++)
  229. {
  230. if (GroupInformation[i] == m_bt_DBData.Rows[a]["Class"].ToString())
  231. {
  232. table.Rows.Add(m_bt_DBData.Rows[a].ItemArray);
  233. }
  234. }
  235. BData.Add(table);
  236. }
  237. //Measurements = BData.Copy();
  238. for (int i = 0; i < GroupInformation.Count; i++)
  239. {
  240. DataTable table = dtp.Clone();
  241. for (int a = 0; a < dtp.Rows.Count; a++)
  242. {
  243. if (GroupInformation[i] == dtp.Rows[a]["GroupName"].ToString())
  244. {
  245. table.Rows.Add(dtp.Rows[a].ItemArray);
  246. }
  247. }
  248. Measurements.Add(table);
  249. }
  250. return;
  251. }
  252. #region 判断是否使用指定选择组和规则
  253. bool bl1 = false;
  254. for (int i = 0; i < m_otsreport_export.m_mbszclass.RuleGroup.Rows.Count; i++)
  255. {
  256. if (m_otsreport_export.m_mbszclass.RuleGroup.Rows[i]["GroupId"].ToString() == "0")
  257. {
  258. bl1 = true;
  259. }
  260. }
  261. #endregion
  262. if (!bl1)
  263. {
  264. #region 筛选现有组
  265. List<string> strings = new List<string>();
  266. for (int i = 0; i < m_bt_DBData.Rows.Count; i++)
  267. {
  268. bool bl2 = false;
  269. for (int a = 0; a < strings.Count; a++)
  270. {
  271. if (m_bt_DBData.Rows[i]["GroupId"].ToString() == strings[a])
  272. {
  273. bl2 = true;
  274. }
  275. }
  276. if (!bl2)
  277. {
  278. strings.Add(m_bt_DBData.Rows[i]["GroupId"].ToString());
  279. }
  280. }
  281. #endregion
  282. List<DataTable> OutData = new List<DataTable>();
  283. for (int i = 0; i < strings.Count(); i++)
  284. {
  285. DataTable data = m_bt_DBData.Clone();
  286. for (int a = 0; a < m_bt_DBData.Rows.Count; a++)
  287. {
  288. if (strings[i] == m_bt_DBData.Rows[a]["GroupId"].ToString())
  289. {
  290. data.Rows.Add(m_bt_DBData.Rows[a].ItemArray);
  291. }
  292. }
  293. OutData.Add(data);
  294. }
  295. BData = OutData.Copy();
  296. Measurements = new List<DataTable>();
  297. for (int i = 0; i < GroupInformation.Count; i++)
  298. {
  299. DataTable table = dtp.Clone();
  300. for (int a = 0; a < dtp.Rows.Count; a++)
  301. {
  302. string strGroupId = "Default";
  303. if (dtp.Rows[a]["GroupName"].ToString() != "")
  304. {
  305. strGroupId = dtp.Rows[a]["GroupName"].ToString();
  306. }
  307. if (GroupInformation[i] == strGroupId)
  308. {
  309. table.Rows.Add(dtp.Rows[a].ItemArray);
  310. }
  311. }
  312. Measurements.Add(table);
  313. }
  314. return;
  315. }
  316. List<DataTable> SpecifyGroup = new List<DataTable>();
  317. for (int i = 0; i < m_otsreport_export.m_mbszclass.List_data.Count; i++)
  318. {
  319. DataTable data= m_bt_DBData.Clone();
  320. bool b3 = false;
  321. string str_class = "";
  322. for (int a = 0; a < m_otsreport_export.m_mbszclass.RuleGroup.Rows.Count; a++)
  323. {
  324. if (m_otsreport_export.m_mbszclass.RuleGroup.Rows[a]["GroupId"].ToString() == m_otsreport_export.m_mbszclass.List_data[i].TableName)
  325. {
  326. if (m_otsreport_export.m_mbszclass.RuleGroup.Rows[a]["display"].ToString() == "1")
  327. {
  328. str_class = m_otsreport_export.m_mbszclass.RuleGroup.Rows[a]["GroupName"].ToString();
  329. b3 = true;
  330. }
  331. }
  332. }
  333. data.TableName = m_otsreport_export.m_mbszclass.List_data[i].TableName;
  334. if (b3)
  335. {
  336. for (int a = 0; a < m_otsreport_export.m_mbszclass.List_data[i].Rows.Count; a++)
  337. {
  338. if (m_otsreport_export.m_mbszclass.List_data[i].Rows[a]["display"].ToString() == "1")
  339. {
  340. DataTable data1 = m_bt_DBData.Clone();
  341. DataRow row = data.NewRow();
  342. row["TypeName"] = m_otsreport_export.m_mbszclass.List_data[i].Rows[a]["StrName"];
  343. row["ar"] = 0;
  344. row["TypeId"] = m_otsreport_export.m_mbszclass.List_data[i].Rows[a]["STDId"];
  345. row["GroupId"] = m_otsreport_export.m_mbszclass.List_data[i].Rows[a]["GroupId"];
  346. row["con"] = 0;
  347. row["Largest"] = 0;
  348. row["Class"] = str_class;
  349. for (int j = 7; j < data.Columns.Count; j++)
  350. {
  351. row[j] = 0;
  352. }
  353. bool b2 = false;
  354. for (int j = 0; j < m_bt_DBData.Rows.Count; j++)
  355. {
  356. if (m_otsreport_export.m_mbszclass.List_data[i].Rows[a]["STDId"].ToString() == m_bt_DBData.Rows[j]["TypeId"].ToString())
  357. {
  358. data1.Rows.Add(m_bt_DBData.Rows[j].ItemArray);
  359. b2 = true;
  360. }
  361. }
  362. if (b2)
  363. {
  364. data.Rows.Add(data1.Rows[0].ItemArray);
  365. }
  366. else
  367. {
  368. data.Rows.Add(row);
  369. }
  370. }
  371. }
  372. }
  373. SpecifyGroup.Add(data);
  374. }
  375. BData = SpecifyGroup.Copy();
  376. #region 测量结果颗粒组队列
  377. List<DataTable> datas1 = new List<DataTable>();
  378. List<string> stringsa = fielddata.ObtainParticleCategory(m_otsreport_export, this);
  379. for (int i = 0; i < stringsa.Count; i++)
  380. {
  381. DataTable data = dtp.Clone();
  382. for (int a = 0; a < dtp.Rows.Count; a++)
  383. {
  384. if (Convert.ToInt64(dtp.Rows[i]["TypeId"]) > 10)
  385. {
  386. string strGroupName = "Default";
  387. if (dtp.Rows[a]["GroupName"].ToString() != "")
  388. {
  389. strGroupName = dtp.Rows[a]["GroupName"].ToString();
  390. }
  391. if (stringsa[i].ToString() == strGroupName)
  392. {
  393. data.Rows.Add(dtp.Rows[a].ItemArray);
  394. }
  395. }
  396. }
  397. datas1.Add(data);
  398. }
  399. Measurements = new List<DataTable>();
  400. for (int i = 0; i < m_otsreport_export.m_mbszclass.List_data.Count; i++)
  401. {
  402. bool b3 = false;
  403. string str_class = "";
  404. for (int a = 0; a < m_otsreport_export.m_mbszclass.RuleGroup.Rows.Count; a++)
  405. {
  406. if (m_otsreport_export.m_mbszclass.RuleGroup.Rows[a]["GroupId"].ToString() == m_otsreport_export.m_mbszclass.List_data[i].TableName)
  407. {
  408. if (m_otsreport_export.m_mbszclass.RuleGroup.Rows[a]["display"].ToString() == "1")
  409. {
  410. str_class = m_otsreport_export.m_mbszclass.RuleGroup.Rows[a]["GroupName"].ToString();
  411. b3 = true;
  412. }
  413. }
  414. }
  415. if (b3)
  416. {
  417. DataTable table = datas1[i].Clone();
  418. for (int a = 0; a < datas1[i].Rows.Count; a++)
  419. {
  420. for (int b = 0; b < m_otsreport_export.m_mbszclass.List_data[i].Rows.Count; b++)
  421. {
  422. if (m_otsreport_export.m_mbszclass.List_data[i].Rows[b]["display"].ToString() == "1")
  423. {
  424. if (datas1[i].Rows[a]["TypeId"].ToString() == m_otsreport_export.m_mbszclass.List_data[i].Rows[b]["STDId"].ToString())
  425. {
  426. table.Rows.Add(datas1[i].Rows[a].ItemArray);
  427. }
  428. }
  429. }
  430. }
  431. Measurements.Add(table);
  432. }
  433. }
  434. #endregion
  435. }
  436. /// <summary>
  437. /// 获取夹杂物组信息
  438. /// </summary>
  439. /// <returns></returns>
  440. public List<string> GetGroupInformation()
  441. {
  442. return GroupInformation;
  443. }
  444. /// <summary>
  445. /// 获取读取数据库并过滤颗粒
  446. /// </summary>
  447. /// <returns></returns>
  448. public List<DataTable> GetDBData()
  449. {
  450. return BData;
  451. }
  452. /// <summary>
  453. /// 获取读取数据库并过滤颗粒
  454. /// </summary>
  455. /// <returns></returns>
  456. public List<DataTable> etDBData()
  457. {
  458. return BData;
  459. }
  460. public void SetAllClass()
  461. {
  462. AllClass = fielddata.GetAllClass();
  463. }
  464. /// <summary>
  465. /// 获取全部大类
  466. /// </summary>
  467. /// <returns></returns>
  468. public DataTable GetAllClass()
  469. {
  470. return AllClass;
  471. }
  472. /// <summary>
  473. ///测量结果数据列队
  474. /// </summary>
  475. /// <returns></returns>
  476. public List<DataTable> GetMeasurements()
  477. {
  478. return Measurements;
  479. }
  480. /// <summary>
  481. /// 定义ParticleData类
  482. /// </summary>
  483. public void newParticleData(OTSReport_Export m_otsreport_export)
  484. {
  485. fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResultId()].FilePath);
  486. }
  487. public ParticleData getParticleData()
  488. {
  489. return fielddata;
  490. }
  491. public void SetAllElement()
  492. {
  493. AllElement = fielddata.GetAllElement();
  494. }
  495. /// <summary>
  496. /// 获取全部元素
  497. /// </summary>
  498. /// <returns></returns>
  499. public DataTable GetAllElement()
  500. {
  501. return AllElement;
  502. }
  503. /// <summary>
  504. /// 判断是否有大分类,有为true
  505. /// </summary>
  506. /// <param name="m_otsreport_export"></param>
  507. /// <returns></returns>
  508. public void IsThereAMajorClassification(BasicData basicData, OTSReport_Export m_otsreport_export)
  509. {
  510. //List<string> ClassName = ObtainParticleCategory(m_otsreport_export, basicData);
  511. List<string> ClassName = new List<string>();
  512. for (int i = 0; i < BData.Count; i++)
  513. {
  514. if (BData[i].Rows.Count != 0)
  515. {
  516. ClassName.Add(i.ToString());
  517. }
  518. }
  519. if (ClassName.Count < 2)
  520. {
  521. IsShereAClassificationGroup= false;
  522. }
  523. else
  524. {
  525. IsShereAClassificationGroup= true;
  526. }
  527. }
  528. public bool GetIsThereAMajorClassification()
  529. {
  530. return IsShereAClassificationGroup;
  531. }
  532. public void IsResultFilesList(OTSReport_Export m_otsreport_export)
  533. {
  534. resfile = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResultId()];
  535. }
  536. /// <summary>
  537. /// 获取标准库名称
  538. /// </summary>
  539. /// <returns></returns>
  540. public string GetResfile()
  541. {
  542. string str_libraryName = "";
  543. bool endsWithDb = resfile.GetSTDName().EndsWith(".db", StringComparison.OrdinalIgnoreCase);
  544. if (endsWithDb)
  545. {
  546. str_libraryName = resfile.GetSTDName();
  547. }
  548. else
  549. {
  550. str_libraryName = resfile.GetSTDName() + ".db";
  551. }
  552. return str_libraryName;
  553. }
  554. public void IsFilePath(OTSReport_Export m_otsreport_export)
  555. {
  556. FilePath= m_otsreport_export.m_ReportApp.m_rstDataMgr.CurResultFile.FilePath;
  557. }
  558. /// <summary>
  559. /// 得到文件路径
  560. /// </summary>
  561. /// <returns></returns>
  562. public string GetFilePath()
  563. {
  564. return FilePath;
  565. }
  566. #region 内部函数
  567. private string getWhere(string max, string min, string col, string partic)
  568. {
  569. if (col == "Area")
  570. {
  571. 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;
  572. }
  573. else
  574. {
  575. return col + ">=" + min + " and " + col + "<" + max + " and TypeId=" + partic;
  576. }
  577. }
  578. private DataTable InvalidRemoval(DataTable dt)
  579. {
  580. DataTable dataTable = dt.Copy();
  581. dataTable.Clear();
  582. for (int i = 0; i < dt.Rows.Count; i++)
  583. {
  584. if (Convert.ToInt32(dt.Rows[i]["TypeId"]) > 10)
  585. {
  586. dataTable.Rows.Add(dt.Rows[i].ItemArray);
  587. }
  588. }
  589. return dataTable;
  590. }
  591. #endregion
  592. }
  593. }