12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157 |
-
- using OTSCommon.Model;
- using OTSIncAReportApp.DataOperation.DataAccess;
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using static OTSIncAReportApp.OTSReport_Export;
- namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
- {
- /// <summary>
- /// 颗粒分析
- /// </summary>
- class ParticleAnalysis
- {
- /// <summary>
- /// 大分类
- /// </summary>
- /// <returns></returns>
- public DataTable GetLargeClassification(c_TemplateClass m_mbszclass, OTSReport_Export m_otsreport_export)
- {
- DataTable data = GetDBData(m_mbszclass, m_otsreport_export);
- List<string> colid = new List<string>();
- //获取粒级表
- string path1 = m_otsreport_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.PartSizeFileFolder + m_mbszclass.M_KLFXJG.str_cb_klcc_ljb.ToString();
- DataSet ds = OTSIncAReportApp.DataOperation.DataAccess.XMLoperate.GetXml(path1);
- string sizestr = ds.Tables[0].Rows[0]["Sizes"].ToString();
- for (int i = 0; i < sizestr.Split(',').Length - 1; i++)
- {
- if (sizestr.Split(',')[i].Length > 0)
- {
- double d1 = Convert.ToDouble(sizestr.Split(',')[i]);
- double d2 = Convert.ToDouble(sizestr.Split(',')[i + 1]);
- colid.Add(d1.ToString() + "~" + d2.ToString());
- }
- }
- double d = Convert.ToDouble(sizestr.Split(',')[sizestr.Split(',').Length - 1]);
- colid.Add(d.ToString() + "~MAX");
- ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FilePath);
- DataTable ls_partsize_dt = new DataTable();
- ls_partsize_dt.TableName = "PartSize";
- ls_partsize_dt.Columns.Add("c1");
- ls_partsize_dt.Columns.Add("c2");
- ls_partsize_dt.Columns.Add("c3");
- ls_partsize_dt.Columns.Add("c4");
- ls_partsize_dt.Columns.Add("c5");
- ls_partsize_dt.Columns.Add("c6");
- ls_partsize_dt.Columns.Add("c7");
- ls_partsize_dt.Columns.Add("c8");
- ls_partsize_dt.Columns.Add("c9");
- DataRow dr = ls_partsize_dt.NewRow();
- for (int i = 1; i < 10; i++)
- {
- if (colid.Count < i)
- {
- dr["c" + i.ToString()] = "";
- }
- else
- {
- dr["c" + i.ToString()] = colid[i - 1];
- }
- }
- ls_partsize_dt.Rows.Add(dr);
- DataTable ls_Particel_dt = new DataTable();
- ls_Particel_dt.TableName = "Particel";
- ls_Particel_dt.Columns.Add("c1", typeof(double));
- ls_Particel_dt.Columns.Add("c2", typeof(double));
- ls_Particel_dt.Columns.Add("c3", typeof(double));
- ls_Particel_dt.Columns.Add("c4", typeof(double));
- ls_Particel_dt.Columns.Add("c5", typeof(double));
- ls_Particel_dt.Columns.Add("c6", typeof(double));
- ls_Particel_dt.Columns.Add("c7", typeof(double));
- ls_Particel_dt.Columns.Add("c8", typeof(double));
- ls_Particel_dt.Columns.Add("c9", typeof(double));
- ls_Particel_dt.Columns.Add("Name");
- ls_Particel_dt.Columns.Add("total", typeof(double));
- ls_Particel_dt.Columns.Add("TypeId");
- ls_Particel_dt.Columns.Add("Class");
- for (int i = 0; i < data.Rows.Count; i++)
- {
- DataRow dr2 = ls_Particel_dt.NewRow();
- dr2["Name"] = data.Rows[i]["TypeName"].ToString();
- dr2["Class"] = data.Rows[i]["Class"].ToString();
- dr2["TypeId"] = data.Rows[i]["TypeId"].ToString();//获取分类编号
- for (int j = 1; j < 10; j++)
- {
- if (colid.Count >= j)
- {
- dr2["c" + j.ToString()] = Convert.ToDouble(data.Rows[i][colid[j - 1]]);
- }
- }
- if (dr2["Name"].ToString() != "" && dr2["Name"].ToString().IndexOf("number") < 0)
- {
- dr2["total"] = "0"; //求合
- double d_total = 0;
- for (int j = 1; j < 10; j++)
- {
- if (colid.Count >= j)
- {
- d_total = d_total + Convert.ToInt64(data.Rows[i][colid[j - 1]]);
- }
- }
- dr2["total"] = d_total.ToString();
- }
- ls_Particel_dt.Rows.Add(dr2);
- }
- //按照list列表进行物质类排序,物质类中的元素分类按照面积的大小进行排序
- List<string> ClassName = new List<string>();
- DataTable getClass_dt = fielddata.GetAllClass();
- for (int i = 0; i < getClass_dt.Rows.Count; i++)
- {
- if (getClass_dt.Rows[i]["GroupName"].ToString() != "NOT_INCLUTION" && getClass_dt.Rows[i]["GroupName"].ToString() != "Invalid")
- if (getClass_dt.Rows[i]["GroupName"].ToString() == "")
- ClassName.Add("NULL");
- else
- ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
- }
- //获取大分类信息
- DataTable dt = QuantityOfIntegratedSubstances(ls_Particel_dt, ClassName);
- return dt;
- }
- /// <summary>
- /// 小分类
- /// </summary>
- /// <returns></returns>
- public DataTable GetSubClassification(c_TemplateClass m_mbszclass, OTSReport_Export m_otsreport_export)
- {
- DataTable data = GetDBData(m_mbszclass, m_otsreport_export);
- List<string> colid = new List<string>();
- //获取粒级表
- string path1 = m_otsreport_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.PartSizeFileFolder + m_mbszclass.M_KLFXJG.str_cb_klcc_ljb.ToString();
- DataSet ds = OTSIncAReportApp.DataOperation.DataAccess.XMLoperate.GetXml(path1);
- string sizestr = ds.Tables[0].Rows[0]["Sizes"].ToString();
- for (int i = 0; i < sizestr.Split(',').Length - 1; i++)
- {
- if (sizestr.Split(',')[i].Length > 0)
- {
- double d1 = Convert.ToDouble(sizestr.Split(',')[i]);
- double d2 = Convert.ToDouble(sizestr.Split(',')[i + 1]);
- colid.Add(d1.ToString() + "~" + d2.ToString());
- }
- }
- double d = Convert.ToDouble(sizestr.Split(',')[sizestr.Split(',').Length - 1]);
- colid.Add(d.ToString() + "~MAX");
- //------------------------------------------------
- DataTable ls_partsize_dt = new DataTable();
- ls_partsize_dt.TableName = "PartSize";
- ls_partsize_dt.Columns.Add("c1");
- ls_partsize_dt.Columns.Add("c2");
- ls_partsize_dt.Columns.Add("c3");
- ls_partsize_dt.Columns.Add("c4");
- ls_partsize_dt.Columns.Add("c5");
- ls_partsize_dt.Columns.Add("c6");
- ls_partsize_dt.Columns.Add("c7");
- ls_partsize_dt.Columns.Add("c8");
- ls_partsize_dt.Columns.Add("c9");
- DataRow dr = ls_partsize_dt.NewRow();
- for (int i = 1; i < 10; i++)
- {
- if (colid.Count < i)
- {
- dr["c" + i.ToString()] = "";
- }
- else
- {
- dr["c" + i.ToString()] = colid[i - 1];
- }
- }
- ls_partsize_dt.Rows.Add(dr);
- DataTable ls_Particel_dt = new DataTable();
- ls_Particel_dt.TableName = "Particel";
- ls_Particel_dt.Columns.Add("c1", typeof(double));
- ls_Particel_dt.Columns.Add("c2", typeof(double));
- ls_Particel_dt.Columns.Add("c3", typeof(double));
- ls_Particel_dt.Columns.Add("c4", typeof(double));
- ls_Particel_dt.Columns.Add("c5", typeof(double));
- ls_Particel_dt.Columns.Add("c6", typeof(double));
- ls_Particel_dt.Columns.Add("c7", typeof(double));
- ls_Particel_dt.Columns.Add("c8", typeof(double));
- ls_Particel_dt.Columns.Add("c9", typeof(double));
- ls_Particel_dt.Columns.Add("Name");
- ls_Particel_dt.Columns.Add("total", typeof(double));
- ls_Particel_dt.Columns.Add("TypeId");
- ls_Particel_dt.Columns.Add("Class");
- for (int i = 0; i < data.Rows.Count; i++)
- {
- DataRow dr2 = ls_Particel_dt.NewRow();
- dr2["Name"] = data.Rows[i]["TypeName"].ToString();
- dr2["Class"] = data.Rows[i]["Class"].ToString();
- dr2["TypeId"] = data.Rows[i]["TypeId"].ToString();//获取分类编号
- for (int j = 1; j < 10; j++)
- {
- if (colid.Count >= j)
- {
- dr2["c" + j.ToString()] = Convert.ToDouble(data.Rows[i][colid[j - 1]]);
- }
- }
- if (dr2["Name"].ToString() != "" && dr2["Name"].ToString().IndexOf("number") < 0)
- {
- dr2["total"] = "0"; //求合
- double d_total = 0;
- for (int j = 1; j < 10; j++)
- {
- if (colid.Count >= j)
- {
- d_total = d_total + Convert.ToInt64(data.Rows[i][colid[j - 1]]);
- }
- }
- dr2["total"] = d_total.ToString();
- }
- ls_Particel_dt.Rows.Add(dr2);
- }
- return ls_Particel_dt;
- }
- /// <summary>
- /// 分类整合大小分类都有
- /// </summary>
- /// <returns></returns>
- public List<DataTable> GetClassificationConsolidationTable(c_TemplateClass m_mbszclass, OTSReport_Export m_otsreport_export)
- {
- List<DataTable> datas = new List<DataTable>();
- DataTable data = GetDBData(m_mbszclass, m_otsreport_export);
- List<string> colid = new List<string>();
- //获取粒级表
- string path1 = m_otsreport_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.PartSizeFileFolder + m_mbszclass.M_KLFXJG.str_cb_klcc_ljb.ToString();
- DataSet ds = OTSIncAReportApp.DataOperation.DataAccess.XMLoperate.GetXml(path1);
- string sizestr = ds.Tables[0].Rows[0]["Sizes"].ToString();
- for (int i = 0; i < sizestr.Split(',').Length - 1; i++)
- {
- if (sizestr.Split(',')[i].Length > 0)
- {
- double d1 = Convert.ToDouble(sizestr.Split(',')[i]);
- double d2 = Convert.ToDouble(sizestr.Split(',')[i + 1]);
- colid.Add(d1.ToString() + "~" + d2.ToString());
- }
- }
- double d = Convert.ToDouble(sizestr.Split(',')[sizestr.Split(',').Length - 1]);
- colid.Add(d.ToString() + "~MAX");
- ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FilePath);
- //------------------------------------------------
- DataTable ls_partsize_dt = new DataTable();
- ls_partsize_dt.TableName = "PartSize";
- ls_partsize_dt.Columns.Add("c1");
- ls_partsize_dt.Columns.Add("c2");
- ls_partsize_dt.Columns.Add("c3");
- ls_partsize_dt.Columns.Add("c4");
- ls_partsize_dt.Columns.Add("c5");
- ls_partsize_dt.Columns.Add("c6");
- ls_partsize_dt.Columns.Add("c7");
- ls_partsize_dt.Columns.Add("c8");
- ls_partsize_dt.Columns.Add("c9");
- DataRow dr = ls_partsize_dt.NewRow();
- for (int i = 1; i < 10; i++)
- {
- if (colid.Count < i)
- {
- dr["c" + i.ToString()] = "";
- }
- else
- {
- dr["c" + i.ToString()] = colid[i - 1];
- }
- }
- ls_partsize_dt.Rows.Add(dr);
- DataTable ls_Particel_dt = new DataTable();
- ls_Particel_dt.TableName = "Particel";
- ls_Particel_dt.Columns.Add("c1", typeof(double));
- ls_Particel_dt.Columns.Add("c2", typeof(double));
- ls_Particel_dt.Columns.Add("c3", typeof(double));
- ls_Particel_dt.Columns.Add("c4", typeof(double));
- ls_Particel_dt.Columns.Add("c5", typeof(double));
- ls_Particel_dt.Columns.Add("c6", typeof(double));
- ls_Particel_dt.Columns.Add("c7", typeof(double));
- ls_Particel_dt.Columns.Add("c8", typeof(double));
- ls_Particel_dt.Columns.Add("c9", typeof(double));
- ls_Particel_dt.Columns.Add("Name");
- ls_Particel_dt.Columns.Add("total", typeof(double));
- ls_Particel_dt.Columns.Add("TypeId");
- ls_Particel_dt.Columns.Add("Class");
- for (int i = 0; i < data.Rows.Count; i++)
- {
- DataRow dr2 = ls_Particel_dt.NewRow();
- dr2["Name"] = data.Rows[i]["TypeName"].ToString();
- dr2["Class"] = data.Rows[i]["Class"].ToString();
- dr2["TypeId"] = data.Rows[i]["TypeId"].ToString();//获取分类编号
- for (int j = 1; j < 10; j++)
- {
- if (colid.Count >= j)
- {
- dr2["c" + j.ToString()] = Convert.ToDouble(data.Rows[i][colid[j - 1]]);
- }
- }
- if (dr2["Name"].ToString() != "" && dr2["Name"].ToString().IndexOf("number") < 0)
- {
- dr2["total"] = "0"; //求合
- double d_total = 0;
- for (int j = 1; j < 10; j++)
- {
- if (colid.Count >= j)
- {
- d_total = d_total + Convert.ToInt64(data.Rows[i][colid[j - 1]]);
- }
- }
- dr2["total"] = d_total.ToString();
- }
- ls_Particel_dt.Rows.Add(dr2);
- }
- //按照list列表进行物质类排序,物质类中的元素分类按照面积的大小进行排序
- List<string> ClassName = new List<string>();
- DataTable getClass_dt = fielddata.GetAllClass();
- for (int i = 0; i < getClass_dt.Rows.Count; i++)
- {
-
- if (getClass_dt.Rows[i]["GroupName"].ToString() != "NOT_INCLUTION" && getClass_dt.Rows[i]["GroupName"].ToString() != "Invalid"
- && getClass_dt.Rows[i]["GroupName"].ToString() != "Not Identified")
- if (getClass_dt.Rows[i]["GroupName"].ToString() == "")
- ClassName.Add("Default");
- else
- ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
- }
- //获取大分类信息
- DataTable dt = QuantityOfIntegratedSubstances(ls_Particel_dt, ClassName);
- DataTable data2 = classIfIcationSort(ls_Particel_dt, ClassName, dt);
- datas.Add(ls_partsize_dt.Copy());
- datas.Add(data2.Copy());
- return datas;
- }
- /// <summary>
- /// 判断是否有大分类,有为true
- /// </summary>
- /// <param name="m_otsreport_export"></param>
- /// <returns></returns>
- public bool IsThereAMajorClassification(OTSReport_Export m_otsreport_export)
- {
- ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FilePath);
- DataTable getClass_dt = fielddata.GetAllClass();
- List<string> ClassName = new List<string>();
- for (int i = 0; i < getClass_dt.Rows.Count; i++)
- {
- if (getClass_dt.Rows[i]["GroupName"].ToString() != "NOT_INCLUTION" && getClass_dt.Rows[i]["GroupName"].ToString() != "Invalid"
- && getClass_dt.Rows[i]["GroupName"].ToString() != "Not Identified")
- if (getClass_dt.Rows[i]["GroupName"].ToString() == "")
- ClassName.Add("Default");
- else
- ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
- }
- if (ClassName.Count < 2)
- {
- return false;
- }
- else
- {
- return true;
- }
- }
- /// <summary>
- /// 大分类chart数据
- /// </summary>
- /// <param name="m_mbszclass"></param>
- /// <param name="m_otsreport_export"></param>
- /// <returns></returns>
- public DataTable GetChartDataCalss(c_TemplateClass m_mbszclass, OTSReport_Export m_otsreport_export)
- {
- DataTable data = GetDBData(m_mbszclass, m_otsreport_export);
- List<string> colid = new List<string>();
- //获取粒级表
- string path1 = m_otsreport_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.PartSizeFileFolder + m_mbszclass.M_KLFXJG.str_cb_klcc_ljb.ToString();
- DataSet ds = OTSIncAReportApp.DataOperation.DataAccess.XMLoperate.GetXml(path1);
- string sizestr = ds.Tables[0].Rows[0]["Sizes"].ToString();
- for (int i = 0; i < sizestr.Split(',').Length - 1; i++)
- {
- if (sizestr.Split(',')[i].Length > 0)
- {
- double d1 = Convert.ToDouble(sizestr.Split(',')[i]);
- double d2 = Convert.ToDouble(sizestr.Split(',')[i + 1]);
- colid.Add(d1.ToString() + "~" + d2.ToString());
- }
- }
- double d = Convert.ToDouble(sizestr.Split(',')[sizestr.Split(',').Length - 1]);
- colid.Add(d.ToString() + "~MAX");
- ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FilePath);
- //------------------------------------------------
- DataTable ls_partsize_dt = new DataTable();
- ls_partsize_dt.TableName = "PartSize";
- ls_partsize_dt.Columns.Add("c1");
- ls_partsize_dt.Columns.Add("c2");
- ls_partsize_dt.Columns.Add("c3");
- ls_partsize_dt.Columns.Add("c4");
- ls_partsize_dt.Columns.Add("c5");
- ls_partsize_dt.Columns.Add("c6");
- ls_partsize_dt.Columns.Add("c7");
- ls_partsize_dt.Columns.Add("c8");
- ls_partsize_dt.Columns.Add("c9");
- DataRow dr = ls_partsize_dt.NewRow();
- for (int i = 1; i < 10; i++)
- {
- if (colid.Count < i)
- {
- dr["c" + i.ToString()] = "";
- }
- else
- {
- dr["c" + i.ToString()] = colid[i - 1];
- }
- }
- ls_partsize_dt.Rows.Add(dr);
- DataTable ls_Particel_dt = new DataTable();
- ls_Particel_dt.TableName = "Particel";
- ls_Particel_dt.Columns.Add("c1", typeof(double));
- ls_Particel_dt.Columns.Add("c2", typeof(double));
- ls_Particel_dt.Columns.Add("c3", typeof(double));
- ls_Particel_dt.Columns.Add("c4", typeof(double));
- ls_Particel_dt.Columns.Add("c5", typeof(double));
- ls_Particel_dt.Columns.Add("c6", typeof(double));
- ls_Particel_dt.Columns.Add("c7", typeof(double));
- ls_Particel_dt.Columns.Add("c8", typeof(double));
- ls_Particel_dt.Columns.Add("c9", typeof(double));
- ls_Particel_dt.Columns.Add("Name");
- ls_Particel_dt.Columns.Add("total", typeof(double));
- ls_Particel_dt.Columns.Add("TypeId");
- ls_Particel_dt.Columns.Add("Class");
- for (int i = 0; i < data.Rows.Count; i++)
- {
- DataRow dr2 = ls_Particel_dt.NewRow();
- dr2["Name"] = data.Rows[i]["TypeName"].ToString();
- dr2["Class"] = data.Rows[i]["Class"].ToString();
- dr2["TypeId"] = data.Rows[i]["TypeId"].ToString();//获取分类编号
- for (int j = 1; j < 10; j++)
- {
- if (colid.Count >= j)
- {
- dr2["c" + j.ToString()] = Convert.ToDouble(data.Rows[i][colid[j - 1]]);
- }
- }
- if (dr2["Name"].ToString() != "" && dr2["Name"].ToString().IndexOf("number") < 0)
- {
- dr2["total"] = "0"; //求合
- double d_total = 0;
- for (int j = 1; j < 10; j++)
- {
- if (colid.Count >= j)
- {
- d_total = d_total + Convert.ToInt64(data.Rows[i][colid[j - 1]]);
- }
- }
- dr2["total"] = d_total.ToString();
- }
- ls_Particel_dt.Rows.Add(dr2);
- }
- //按照list列表进行物质类排序,物质类中的元素分类按照面积的大小进行排序
- List<string> ClassName = new List<string>();
- DataTable getClass_dt = fielddata.GetAllClass();
- for (int i = 0; i < getClass_dt.Rows.Count; i++)
- {
- if (getClass_dt.Rows[i]["GroupName"].ToString() != "NOT_INCLUTION" && getClass_dt.Rows[i]["GroupName"].ToString() != "Invalid")
- if (getClass_dt.Rows[i]["GroupName"].ToString() == "")
- ClassName.Add("NULL");
- else
- ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
- }
- //颗粒尺寸数据(例 1.5有多少,2.0有多少)
- DataTable colid_data = new DataTable();
- colid_data.Columns.Add("name");
- colid_data.Columns.Add("quantity", typeof(double));
- for (int i = 0; i < ls_Particel_dt.Columns.Count; i++)
- {
- if (ls_Particel_dt.Columns[i].ColumnName == "c" + (i + 1).ToString())
- {
- if (i < colid.Count)
- {
- DataRow dr1 = colid_data.NewRow();
- dr1["name"] = colid[i].ToString();
- int quantity = 0;
- for (int a = 0; a < ls_Particel_dt.Rows.Count; a++)
- {
- quantity = quantity + Convert.ToInt32(ls_Particel_dt.Rows[a][i].ToString());
- }
- dr1["quantity"] = quantity.ToString();
- colid_data.Rows.Add(dr1);
- }
- }
- }
- return colid_data;
-
- }
- /// <summary>
- /// 小分类chart数据
- /// </summary>
- /// <param name="m_mbszclass"></param>
- /// <param name="m_otsreport_export"></param>
- /// <returns></returns>
- public DataTable GetChartDataSubdivision(c_TemplateClass m_mbszclass, OTSReport_Export m_otsreport_export)
- {
- DataTable data = GetDBData(m_mbszclass, m_otsreport_export);
- List<string> colid = new List<string>();
- string path1 = m_otsreport_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.PartSizeFileFolder + m_mbszclass.M_KLFXJG.str_cb_klcc_ljb.ToString();
- DataSet ds = OTSIncAReportApp.DataOperation.DataAccess.XMLoperate.GetXml(path1);
- string sizestr = ds.Tables[0].Rows[0]["Sizes"].ToString();
- for (int i = 0; i < sizestr.Split(',').Length - 1; i++)
- {
- if (sizestr.Split(',')[i].Length > 0)
- {
- double d1 = Convert.ToDouble(sizestr.Split(',')[i]);
- double d2 = Convert.ToDouble(sizestr.Split(',')[i + 1]);
- colid.Add(d1.ToString() + "~" + d2.ToString());
- }
- }
- double d = Convert.ToDouble(sizestr.Split(',')[sizestr.Split(',').Length - 1]);
- colid.Add(d.ToString() + "~MAX");
- //------------------------------------------------
- DataTable ls_partsize_dt = new DataTable();
- ls_partsize_dt.TableName = "PartSize";
- ls_partsize_dt.Columns.Add("c1");
- ls_partsize_dt.Columns.Add("c2");
- ls_partsize_dt.Columns.Add("c3");
- ls_partsize_dt.Columns.Add("c4");
- ls_partsize_dt.Columns.Add("c5");
- ls_partsize_dt.Columns.Add("c6");
- ls_partsize_dt.Columns.Add("c7");
- ls_partsize_dt.Columns.Add("c8");
- ls_partsize_dt.Columns.Add("c9");
- DataRow dr = ls_partsize_dt.NewRow();
- for (int i = 1; i < 10; i++)
- {
- if (colid.Count < i)
- {
- dr["c" + i.ToString()] = "";
- }
- else
- {
- dr["c" + i.ToString()] = colid[i - 1];
- }
- }
- ls_partsize_dt.Rows.Add(dr);
- DataTable ls_Particel_dt = new DataTable();
- ls_Particel_dt.TableName = "Particel";
- ls_Particel_dt.Columns.Add("c1", typeof(double));
- ls_Particel_dt.Columns.Add("c2", typeof(double));
- ls_Particel_dt.Columns.Add("c3", typeof(double));
- ls_Particel_dt.Columns.Add("c4", typeof(double));
- ls_Particel_dt.Columns.Add("c5", typeof(double));
- ls_Particel_dt.Columns.Add("c6", typeof(double));
- ls_Particel_dt.Columns.Add("c7", typeof(double));
- ls_Particel_dt.Columns.Add("c8", typeof(double));
- ls_Particel_dt.Columns.Add("c9", typeof(double));
- ls_Particel_dt.Columns.Add("Name");
- ls_Particel_dt.Columns.Add("total", typeof(double));
- ls_Particel_dt.Columns.Add("TypeId");
- ls_Particel_dt.Columns.Add("Class");
- for (int i = 0; i < data.Rows.Count; i++)
- {
- DataRow dr2 = ls_Particel_dt.NewRow();
- dr2["Name"] = data.Rows[i]["TypeName"].ToString();
- dr2["Class"] = data.Rows[i]["Class"].ToString();
- dr2["TypeId"] = data.Rows[i]["TypeId"].ToString();//获取分类编号
- for (int j = 1; j < 10; j++)
- {
- if (colid.Count >= j)
- {
- dr2["c" + j.ToString()] = Convert.ToDouble(data.Rows[i][colid[j - 1]]);
- }
- }
- if (dr2["Name"].ToString() != "" && dr2["Name"].ToString().IndexOf("number") < 0)
- {
- dr2["total"] = "0"; //求合
- double d_total = 0;
- for (int j = 1; j < 10; j++)
- {
- if (colid.Count >= j)
- {
- d_total = d_total + Convert.ToInt64(data.Rows[i][colid[j - 1]]);
- }
- }
- dr2["total"] = d_total.ToString();
- }
- ls_Particel_dt.Rows.Add(dr2);
- }
- return ls_Particel_dt;
-
- }
- public DataTable ParticleResults(c_TemplateClass m_mbszclass, OTSReport_Export m_otsreport_export)
- {
- DataTable data = GetDBData(m_mbszclass, m_otsreport_export);
- List<string> colid = new List<string>();
- //获取粒级表
- string path1 = m_otsreport_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.PartSizeFileFolder + m_mbszclass.M_KLFXJG.str_cb_klcc_ljb.ToString();
- DataSet ds = OTSIncAReportApp.DataOperation.DataAccess.XMLoperate.GetXml(path1);
- string sizestr = ds.Tables[0].Rows[0]["Sizes"].ToString();
- for (int i = 0; i < sizestr.Split(',').Length - 1; i++)
- {
- if (sizestr.Split(',')[i].Length > 0)
- {
- double d1 = Convert.ToDouble(sizestr.Split(',')[i]);
- double d2 = Convert.ToDouble(sizestr.Split(',')[i + 1]);
- colid.Add(d1.ToString() + "~" + d2.ToString());
- }
- }
- double d = Convert.ToDouble(sizestr.Split(',')[sizestr.Split(',').Length - 1]);
- colid.Add(d.ToString() + "~MAX");
- ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FilePath);
- //------------------------------------------------
- DataTable ls_partsize_dt = new DataTable();
- ls_partsize_dt.TableName = "PartSize";
- ls_partsize_dt.Columns.Add("c1");
- ls_partsize_dt.Columns.Add("c2");
- ls_partsize_dt.Columns.Add("c3");
- ls_partsize_dt.Columns.Add("c4");
- ls_partsize_dt.Columns.Add("c5");
- ls_partsize_dt.Columns.Add("c6");
- ls_partsize_dt.Columns.Add("c7");
- ls_partsize_dt.Columns.Add("c8");
- ls_partsize_dt.Columns.Add("c9");
- ls_partsize_dt.Columns.Add("c10");
- DataRow dr = ls_partsize_dt.NewRow();
- for (int i = 1; i < 10; i++)
- {
- if (colid.Count < i)
- {
- dr["c" + i.ToString()] = "";
- }
- else
- {
- dr["c" + i.ToString()] = colid[i - 1];
- }
- }
- ls_partsize_dt.Rows.Add(dr);
- DataTable ls_Particel_dt = new DataTable();
- ls_Particel_dt.TableName = "Particel";
- ls_Particel_dt.Columns.Add("c1");
- ls_Particel_dt.Columns.Add("c2");
- ls_Particel_dt.Columns.Add("c3");
- ls_Particel_dt.Columns.Add("c4");
- ls_Particel_dt.Columns.Add("c5");
- ls_Particel_dt.Columns.Add("c6");
- ls_Particel_dt.Columns.Add("c7");
- ls_Particel_dt.Columns.Add("c8");
- ls_Particel_dt.Columns.Add("c9");
- ls_Particel_dt.Columns.Add("c10");
- ls_Particel_dt.Columns.Add("Name");
- ls_Particel_dt.Columns.Add("total");
- ls_Particel_dt.Columns.Add("TypeId");
- for (int i = 0; i < data.Rows.Count; i++)
- {
- DataRow dr2 = ls_Particel_dt.NewRow();
- dr2["Name"] = data.Rows[i]["TypeName"].ToString();
- dr2["TypeId"] = data.Rows[i]["TypeId"].ToString();//获取分类编号
- for (int j = 1; j < 11; j++)
- {
- if (colid.Count >= j)
- {
- double de = Convert.ToDouble(data.Rows[i][colid[j - 1]]);
- if (de == 0)
- dr2["c" + j.ToString()] = " ";
- else
- dr2["c" + j.ToString()] = de.ToString();
- }
- }
- if (dr2["Name"].ToString() != "" && dr2["Name"].ToString().IndexOf("number") < 0)
- {
- dr2["total"] = " "; //求合
- double d_total = 0;
- for (int j = 1; j < 11; j++)
- {
- if (colid.Count >= j)
- {
- d_total = d_total + Convert.ToInt64(data.Rows[i][colid[j - 1]]);
- }
- }
- if (d_total == 0)
- {
- continue;
- dr2["total"] = " ";
- }
- else
- dr2["total"] = d_total.ToString();
- }
- ls_Particel_dt.Rows.Add(dr2);
- }
- return ls_Particel_dt;
- }
- public DataTable TypeRange(c_TemplateClass m_mbszclass, OTSReport_Export m_otsreport_export)
- {
- List<string> colid = new List<string>();
- //获取粒级表
- string path1 = m_otsreport_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.PartSizeFileFolder + m_mbszclass.M_KLFXJG.str_cb_klcc_ljb.ToString();
- DataSet ds = OTSIncAReportApp.DataOperation.DataAccess.XMLoperate.GetXml(path1);
- string sizestr = ds.Tables[0].Rows[0]["Sizes"].ToString();
- for (int i = 0; i < sizestr.Split(',').Length - 1; i++)
- {
- if (sizestr.Split(',')[i].Length > 0)
- {
- double d1 = Convert.ToDouble(sizestr.Split(',')[i]);
- double d2 = Convert.ToDouble(sizestr.Split(',')[i + 1]);
- colid.Add(d1.ToString() + "~" + d2.ToString());
- }
- }
- double d = Convert.ToDouble(sizestr.Split(',')[sizestr.Split(',').Length - 1]);
- colid.Add(d.ToString() + "~MAX");
- DataTable ls_partsize_dt = new DataTable();
- ls_partsize_dt.TableName = "PartSize";
- ls_partsize_dt.Columns.Add("c1");
- ls_partsize_dt.Columns.Add("c2");
- ls_partsize_dt.Columns.Add("c3");
- ls_partsize_dt.Columns.Add("c4");
- ls_partsize_dt.Columns.Add("c5");
- ls_partsize_dt.Columns.Add("c6");
- ls_partsize_dt.Columns.Add("c7");
- ls_partsize_dt.Columns.Add("c8");
- ls_partsize_dt.Columns.Add("c9");
- ls_partsize_dt.Columns.Add("c10");
- ls_partsize_dt.Columns.Add("c11");
- ls_partsize_dt.Columns.Add("c12");
- DataRow dr = ls_partsize_dt.NewRow();
- for (int i = 1; i < 13; i++)
- {
- if (colid.Count < i)
- {
- dr["c" + i.ToString()] = "";
- }
- else
- {
- dr["c" + i.ToString()] = colid[i - 1];
- }
- }
- ls_partsize_dt.Rows.Add(dr);
- return ls_partsize_dt;
- }
- private DataTable QuantityOfIntegratedSubstances(DataTable dataTable, List<string> ClassName)
- {
- DataTable dt_Class = dataTable.Copy();
- dt_Class.Clear();
- dt_Class.TableName = "Particel";
- dt_Class.Columns.Remove("Name");
- dt_Class.Columns.Remove("TypeId");
- for (int i = 0; i < ClassName.Count; i++)
- {
- //保留当前循环中大类物质,去除其他物质
- DataTable dt = dataTable.Copy();
- dt.Clear();
- for (int a = 0; a < dataTable.Rows.Count; a++)
- {
- if (dataTable.Rows[a]["Class"].ToString() == ClassName[i].ToString())
- {
- dt.Rows.Add(dataTable.Rows[a].ItemArray);
- }
- }
- if (dt.Rows.Count == 0)
- continue;
- DataTable dt_2 = new DataTable();
- dt_2 = dataTable.Copy();
- dt_2.Clear();
- DataRow row = dt_2.NewRow();
- dt_2.Rows.Add(row);
- for (int a = 0; a < dt.Columns.Count; a++)
- {
- if (dt.Columns[a].ToString() != "Name" && dt.Columns[a].ToString() != "Class" && dt.Columns[a].ToString() != "TypeId")
- {
- bool bl = false;
- for (int b = 0; b < dt.Rows.Count; b++)
- {
- if (!dt.Rows[b].IsNull(dt.Columns[a].ToString()))
- {
- bl = true;
- }
- }
- if (bl)
- {
- dt_2.Rows[0][dt.Columns[a].ToString()] = decimal.Parse(dt.Compute("sum(" + dt.Columns[a].ToString() + ")", "").ToString());
- }
- }
- }
- dt_2.Columns.Remove("Name");
- dt_2.Columns.Remove("TypeId");
- dt_2.Rows[0]["Class"] = ClassName[i];
- dt_Class.Rows.Add(dt_2.Rows[0].ItemArray);
- }
- return dt_Class;
- }
- private DataTable classIfIcationSort(DataTable dataTable, List<string> ClassName, DataTable data)
- {
- DataTable dt = new DataTable();
- dt = dataTable.Copy();
- dt.Clear();
- dt.TableName = "Particel_subdivision";
- //循环list中每个类型
- for (int i = 0; i < ClassName.Count(); i++)
- {
- DataTable data1 = dt.Copy();
- data1.Clear();
- data1.Rows.Add();
- for (int a = 0; a < data.Rows.Count; a++)
- {
- if (data.Rows[a]["Class"].ToString() == ClassName[i].ToString())
- {
- for (int b = 1; b < 10; b++)
- {
- data1.Rows[0]["c" + b.ToString()] = data.Rows[a]["c" + b.ToString()];
- }
- data1.Rows[0]["total"] = data.Rows[a]["total"];
- data1.Rows[0]["Class"] = data.Rows[a]["Class"];
- dt.Rows.Add(data1.Rows[0].ItemArray);
- }
- }
- DataTable dt_1 = new DataTable();
- dt_1 = dt.Copy();
- dt_1.Clear();
- //循环DataTable中每个分类的数据
- for (int a = 0; a < dataTable.Rows.Count; a++)
- {
- if (!string.IsNullOrWhiteSpace(ClassName[i].ToString()))
- if (dataTable.Rows[a]["Class"].ToString() == ClassName[i].ToString())
- {
- dataTable.Rows[a]["Class"] = "";
- dt_1.Rows.Add(dataTable.Rows[a].ItemArray);
- }
- }
- //将颗粒数量排序(从大到小)
- DataView dv = dt_1.DefaultView;
- dv.Sort = "total DESC";
- DataTable dt_1_sort = dv.ToTable();
- for (int a = 0; a < dt_1_sort.Rows.Count; a++)
- {
- dt.Rows.Add(dt_1_sort.Rows[a].ItemArray);
- }
- }
- dt.Columns.Remove("TypeId");
- return dt;
- }
- private DataTable InvalidRemoval(DataTable dt)
- {
- DataTable dataTable = dt.Copy();
- dataTable.Clear();
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- if (Convert.ToInt32(dt.Rows[i]["TypeId"])>10 )
- {
- dataTable.Rows.Add(dt.Rows[i].ItemArray);
- }
- }
- return dataTable;
- }
- private void SelectParticleData(out DataTable dt, OTSReport_Export m_otsreport_export)
- {
- List<Particle> selectParticles = m_otsreport_export.m_ReportApp.GetSelectedParticles();
- #region Datatable数据表格式
- DataTable dtUelect = new DataTable();
- dtUelect.Columns.Add("fieldid");
- dtUelect.Columns.Add("particleid");
- dtUelect.Columns.Add("AveGray");
- dtUelect.Columns.Add("RectLeft");
- dtUelect.Columns.Add("RectTop");
- dtUelect.Columns.Add("RectWidth");
- dtUelect.Columns.Add("RectHeight");
- dtUelect.Columns.Add("Area");
- dtUelect.Columns.Add("PosX");
- dtUelect.Columns.Add("PosY");
- dtUelect.Columns.Add("TypeId");
- dtUelect.Columns.Add("SegmentNum");
- dtUelect.Columns.Add("SEMPosX");
- dtUelect.Columns.Add("SEMPosY");
- dtUelect.Columns.Add("XrayId");
- dtUelect.Columns.Add("DMAX");
- dtUelect.Columns.Add("DMIN");
- dtUelect.Columns.Add("DPERP");
- dtUelect.Columns.Add("PERIMETER");
- dtUelect.Columns.Add("ORIENTATION");
- dtUelect.Columns.Add("DINSCR");
- dtUelect.Columns.Add("DMEAN");
- dtUelect.Columns.Add("DELONG");
- dtUelect.Columns.Add("DFERET");
- dtUelect.Columns.Add("TypeName");
- dtUelect.Columns.Add("TypeColor");
- #endregion
- for (int i = 0; i < selectParticles.Count; i++)
- {
- dtUelect.Rows.Add(selectParticles[i].FieldId, selectParticles[i].ParticleId, selectParticles[i].AveGray, selectParticles[i].RectLeft, selectParticles[i].RectTop, selectParticles[i].RectWidth, selectParticles[i].RectHeight, selectParticles[i].Area, selectParticles[i].PosX, selectParticles[i].PosX, selectParticles[i].TypeId, /*selectParticles[i].ElementNum,*/ selectParticles[i].SegmentNum, selectParticles[i].SEMPosX, selectParticles[i].SEMPosY, selectParticles[i].ParticleId, selectParticles[i].DMAX, selectParticles[i].DMIN, selectParticles[i].DPERP, selectParticles[i].PERIMETER, selectParticles[i].ORIENTATION, selectParticles[i].DINSCR, selectParticles[i].DMEAN, selectParticles[i].DELONG, selectParticles[i].DFERET, selectParticles[i].TypeName, selectParticles[i].TypeColor);
- }
- dt = dtUelect.Copy();
- }
- private DataTable GetParticleListForParticlSize(DataTable data, DataTable table)
- {
- DataTable dt_Partick = new DataTable();
- dt_Partick.Columns.Add("TypeId");
- dt_Partick.Columns.Add("TypeName");
- dt_Partick.Columns.Add("TypeColor");
- dt_Partick.Columns.Add("con");
- dt_Partick.Columns.Add("ar");
- dt_Partick.Columns.Add("max");
- dt_Partick.Columns.Add("Area", typeof(double));
- dt_Partick.Columns.Add("GroupName");
- List<string> typeName = new List<string>();
- for (int i = 0; i < data.Rows.Count; i++)
- {
- typeName.Add(data.Rows[i]["TypeId"].ToString());
- }
- typeName = typeName.Distinct().ToList();
- for (int i = 0; i < typeName.Count; i++)
- {
- DataTable dt = dt_Partick.Clone();
- for (int j = 0; j < data.Rows.Count; j++)
- {
- if (typeName[i].ToString() == data.Rows[j]["TypeId"].ToString())
- {
- DataRow row = dt.NewRow();
- row["TypeId"] = data.Rows[j]["TypeId"];
- row["TypeName"] = data.Rows[j]["TypeName"];
- row["TypeColor"] = data.Rows[j]["TypeColor"];
- row["Area"] = data.Rows[j]["Area"];
- dt.Rows.Add(row);
- }
- }
- DataRow dr = dt_Partick.NewRow();
- dr["TypeId"] = dt.Rows[0]["TypeId"].ToString();
- dr["TypeName"] = dt.Rows[0]["TypeName"].ToString();
- dr["TypeColor"] = dt.Rows[0]["TypeColor"].ToString();
- dr["con"] = dt.Rows.Count;
- dr["ar"] = dt.Compute("min(Area)", "");
- dr["max"] = dt.Compute("Max(Area)", "");
- dr["Area"] = dt.Compute("SUM(Area)", "");
- dt_Partick.Rows.Add(dr);
- }
- for (int i = 0; i < dt_Partick.Rows.Count; i++)
- {
- for (int j = 0; j < table.Rows.Count; j++)
- {
- if (dt_Partick.Rows[i]["TypeId"].ToString() == table.Rows[j]["TypeId"].ToString())
- {
- dt_Partick.Rows[i]["GroupName"] = table.Rows[j]["GroupName"];
- break;
- }
- }
- }
- return dt_Partick;
- }
- private string getWhere(string max, string min, string col, string partic)
- {
- return col + ">=" + min + " and " + col + "<" + max + " and TypeId=" + partic;
- }
- private DataTable GetDBData(c_TemplateClass m_mbszclass , OTSReport_Export m_otsreport_export)
- {
- DataTable m_bt_DBData = new DataTable();
- ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FilePath);
- List<string> colid = new List<string>() { "TypeName", "ar", "TypeId", "Largest", "Class", "con" };
- //获取粒级表
- string path1 = m_otsreport_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.PartSizeFileFolder + m_mbszclass.M_KLFXJG.str_cb_klcc_ljb.ToString();
- DataSet ds = OTSIncAReportApp.DataOperation.DataAccess.XMLoperate.GetXml(path1);
- string sizestr = ds.Tables[0].Rows[0]["Sizes"].ToString();
- for (int i = 0; i < sizestr.Split(',').Length - 1; i++)
- {
- if (sizestr.Split(',')[i].Length > 0)
- {
- double d1 = Convert.ToDouble(sizestr.Split(',')[i]);
- double d2 = Convert.ToDouble(sizestr.Split(',')[i + 1]);
- colid.Add(d1.ToString() + "~" + d2.ToString());
- }
- }
- double d = Convert.ToDouble(sizestr.Split(',')[sizestr.Split(',').Length - 1]);
- colid.Add(d.ToString() + "~MAX");
- for (int i = 0; i < colid.Count; i++)
- {
- m_bt_DBData.Columns.Add(colid[i].ToString());
- }
- DataTable dt = InvalidRemoval(fielddata.GetParticleListForParticlSize("area", ""));
- DataTable AreaInformationOfAllElements = InvalidRemoval(fielddata.GetAreaByAllIncA(""));
- DataTable dtp = InvalidRemoval(fielddata.GetParticleAll(""));
- //选择颗粒信息
- DataTable data;
- SelectParticleData(out data, m_otsreport_export);
- //选择颗粒整理成表
- DataTable Partic_dt = new DataTable();
- if (data.Rows.Count > 0)
- {
- Partic_dt = GetParticleListForParticlSize(data, dtp);
- }
- List<string> vs = new List<string>() { "DMAX", "DMIN", "FERET", "Area" };
- string po = vs[m_otsreport_export.m_mbszclass.M_KLFXJG.index_cb_klcc_jsfs];
- switch (po)
- {
- case "DMAX":
- po = "DMAX";
- break;
- case "DMIN":
- po = "DMIN";
- break;
- case "ECD":
- po = "Area";
- break;
- case "FERET":
- po = "DFERET";
- break;
- }
- //如果是全部颗粒(0)
- if (m_mbszclass.M_SY.int_xzkl == 0)
- {
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- DataRow dr = m_bt_DBData.NewRow();
- dr["TypeName"] = dt.Rows[i]["TypeName"].ToString();
- dr["TypeId"] = dt.Rows[i]["TypeId"].ToString();
- dr["con"] = dt.Rows[i]["con"].ToString();
- if (dt.Rows[i]["GroupName"].ToString() == "")
- dr["Class"] = "Default";
- else
- dr["Class"] = dt.Rows[i]["GroupName"].ToString();
- //continue;
- dr["Largest"] = Math.Round(Convert.ToDouble(dt.Rows[i]["max"]), 2);
- for (int a = 6; a < colid.Count; a++)
- {
- string d1 = colid[a].Split('~')[0];
- string d2 = colid[a].Split('~')[1];
- if (d2 == "MAX")
- {
- d2 = "999";
- }
- DataRow[] datas = dtp.Select(getWhere(d2, d1, po, dt.Rows[i]["TypeId"].ToString()));
- dr[colid[a]] = datas.Count();
- }
- for (int a = 0; a < AreaInformationOfAllElements.Rows.Count; a++)
- {
- if (dt.Rows[i]["TypeId"].ToString() == AreaInformationOfAllElements.Rows[a]["TypeId"].ToString())
- {
- dr["ar"] = AreaInformationOfAllElements.Rows[a]["ar"];
- }
- }
- m_bt_DBData.Rows.Add(dr);
- }
- }
- else//选择颗粒(1)
- {
- for (int i = 0; i < Partic_dt.Rows.Count; i++)
- {
- DataRow dr = m_bt_DBData.NewRow();
- dr["TypeName"] = Partic_dt.Rows[i]["TypeName"].ToString();
- dr["TypeId"] = Partic_dt.Rows[i]["TypeId"].ToString();
- dr["con"] = Partic_dt.Rows[i]["con"].ToString();
- dr["Class"] = Partic_dt.Rows[i]["GroupName"].ToString();
- dr["Largest"] = Math.Round(Convert.ToDouble(Partic_dt.Rows[i]["max"]), 2);
- for (int a = 6; a < colid.Count; a++)
- {
- string d1 = colid[a].Split('~')[0];
- string d2 = colid[a].Split('~')[1];
- if (d2 == "MAX")
- {
- d2 = "999";
- }
- DataRow[] datas = dtp.Select(getWhere(d2, d1, po, Partic_dt.Rows[i]["TypeId"].ToString()));
- dr[colid[a]] = datas.Count();
- }
- dr["ar"] = Partic_dt.Rows[i]["Area"];
- m_bt_DBData.Rows.Add(dr);
- }
- }
- //去除物质分类(非夹杂物分类)
- for (int a = 0; a < m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Count; a++)
- {
- for (int i = m_bt_DBData.Rows.Count - 1; i >= 0; i--)
- {
- if (m_bt_DBData.Rows[i]["TypeName"].ToString() == m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass[a].ToString())
- {
- m_bt_DBData.Rows.RemoveAt(i);
- }
- }
- }
- return m_bt_DBData;
- }
-
- }
- }
|