| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183 |
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Format;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using CoreFS.CA06;
- using Infragistics.Win;
- using Infragistics.Win.UltraWinGrid;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.IO;
- using System.Linq;
- using System.Net;
- using System.Text;
- using System.Windows.Forms;
- using Core.StlMes.Client.Lims.Data.PipeAndOutdec.数据管理.钢管实验管理;
- namespace Core.StlMes.Client.Lims.Data.PipeAndOutdec
- {
- public partial class FrmChemDataManageNew : FrmBase
- {
- public FrmChemDataManageNew()
- {
- InitializeComponent();
- }
- private string[] arrId;//数据权限
- private string[] arrId2;//数据权限
- private string[] plineCodes = { };
- private string deptid = "";
- private int aduitCount = 0;
- private int manageCount = 0;
- private string updateFlag = "0";
- private void FrmChemDataManageNew_Load(object sender, EventArgs e)
- {
- arrId2 = new string[] { "002001007010", "002023003001" };//化学
- arrId = this.ValidDataPurviewIds;
- plineCodes = comm.GetPlineCode(ValidDataPurviewIds, ob);
- //取标钢时默认天管化学实验室
- if (this.UserInfo.GetDeptid().Equals("002023003001"))
- {
- deptid = "002023003001";
- }
- else
- {
- deptid = "002001007010";
- }
-
- DateTime now = DateTime.Now;
- DateTime dt1 = new DateTime(now.Year, now.Month, 1);//当月第一天
- DateTime dt2 = dt1.AddMonths(1).AddDays(-1);//当月最后一天
- this.RegStartTime.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
- this.RegEndTime.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
- EntityHelper.ShowGridCaption<PipeCheckconsignBaseinfoEntity>(this.ultraGrid1.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PipeCheckconsignBaseinfoEntity>(this.ultraGrid2.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PipeCheckconsignBaseinfoEntity>(this.ultraGrid4.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PipeCheckconsignBaseinfoEntity>(this.ultraGrid5.DisplayLayout.Bands[0]);
- initChem();
- cmbContent.SelectedIndex = 0;
- }
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad(e);
- ultraGrid3.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- ultraGrid7.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- ultraGrid8.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- ultraGrid9.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- }
- /// <summary>
- /// 加载基础信息
- /// </summary>
- private void initChem()
- {
- //加载试验设备
- DataTable dt = PublicServer.GetData("com.steering.lims.data.pipe.FrmDataCJBase.initCheckEquipment", new object[] { arrId }, ob);
- if (dt != null && dt.Rows.Count > 0)
- {
- cmbChemDive.DataSource = dt;
- cmbChemDive.ValueMember = "DEVICE_NO";
- }
- //加载试验方法
- DataTable ds = PublicServer.GetData("com.steering.lims.data.pipe.FrmDataCJBase.initCheckMethod", new object[] { arrId }, ob);
- if (ds != null && ds.Rows.Count > 0)
- {
- cmbChemMethodName.DataSource = ds;
- cmbChemMethodName.ValueMember = "CHECK_METHOD_NO";
- }
- //加载钢种分类
- DataTable gradeDt = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryGradeTypeNew", new object[] { }, ob);
- if (gradeDt != null && gradeDt.Rows.Count > 0)
- {
- comGradeType.DataSource = gradeDt;
- comGradeType.ValueMember = "ASSORTMENT_CODE";
- }
- //加载试验人、审核人
- DataTable userDt = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryUser", new object[] { arrId, arrId2 }, ob);
- if (userDt != null && userDt.Rows.Count > 0)
- {
- txtChemUser.DataSource = userDt;
- txtChemUser.ValueMember = "USERID";
- txtAuditUser.DataSource = userDt;
- txtAuditUser.ValueMember = "USERID";
- txtHandOverName.DataSource = userDt;
- txtHandOverName.ValueMember = "USERID";
- txtTakeOverName.DataSource = userDt;
- txtTakeOverName.ValueMember = "USERID";
- }
- this.cmbChemOrder.Value = UserInfo.GetUserOrder();
- this.cmbChemGroup.Value = UserInfo.GetUserGroup();
- this.txtChemUser.Text = UserInfo.GetUserName();
- this.txtAuditUser.Text = UserInfo.GetUserName();
- //加载设备运行记录受控编号
- DataTable lxDt = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.initMeeting", new Object[] { "10012402%" }, ob);
- if (lxDt.Rows.Count > 0 && lxDt != null)
- {
- ultraLabelYX.Text = "设备运行记录:" + lxDt.Rows[0][0].ToString();
- }
- //加载交接班记录受控编号
- DataTable jjDt = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.initMeeting", new Object[] { "100126%" }, ob);
- if (jjDt.Rows.Count > 0 && jjDt != null)
- {
- ultraLabelJJ.Text = "交接班记录:" + jjDt.Rows[0][0].ToString();
- }
- }
- /// <summary>
- /// 重写基类方法
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- doQueryChem();
- break;
- case "CheckStdSteel":
- checkStdSteelValue();
- break;
- case"DeletePipeOutData":
- deletePipeOutData();
- break;
- case "Save":
- saveData();
- break;
- case "Delete":
- deleteChemValue();
- break;
- case "Audit":
- auditChemValue();
- break;
- case"CancelAudit":
- cancelAudit();
- break;
- case "Print":
- printReport();
- break;
- case "UpFile":
- UpFile();
- break;
- case "StdSteelNo":
- doStdSteelNo();
- break;
- case "UpdateFlag0":
- updateFlag = "0";
- break;
- case "UpdateFlag1":
- updateFlag = "1";
- break;
- case "Close":
- close();
- break;
- }
- }
- /// <summary>
- /// 标钢信息
- /// </summary>
- private void doStdSteelNo()
- {
- this.ultraGrid4.UpdateData();
- UltraGridRow uRow = this.ultraGrid4.ActiveRow;
- if (uRow == null) return;
- FrmChemDataManageNewSon labDateParm = new FrmChemDataManageNewSon(uRow.Cells["CheckNo"].Text.Trim(),"HX", this.ob);
- labDateParm.ShowDialog();
- }
- /// <summary>
- /// 清除采集数据
- /// </summary>
- private void deletePipeOutData()
- {
- this.ultraGrid1.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- if (uRow == null) return;
- PipeCheckconsignBaseinfoEntity pipeBaseInfoTity = (PipeCheckconsignBaseinfoEntity)uRow.ListObject;
- string pipeBaseEntity = JSONFormat.Format(pipeBaseInfoTity);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.lims.data.pipe.FrmChemDataManage";
- ccp.MethodName = "deletePipeOutData";
- ccp.ServerParams = new object[] { pipeBaseEntity };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("清除成功!"))
- {
- doQueryChem();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 修约值检查
- /// </summary>
- private void checkStdSteelValue()
- {
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- if (uRow == null) return;
- string gradeType = this.comGradeType.Text;
- if (gradeType == "")
- {
- MessageUtil.ShowTips("修约检查时请选择钢种分类");
- return;
- }
- DataTable dsProvt = ultraGrid3.DataSource as DataTable;
- //取钢种下所有标钢号下元素值
- DataTable stdsteelBaseDt = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryStdsteelBaseInfo", new object[] { uRow.Cells["SteelNo"].Text, deptid }, ob);
- Dictionary<string, DataTable> stdProcessDtDic = new Dictionary<string, DataTable>();
- //取选择了哪些标钢
- DataTable stdsteelDt = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryStdsteel", new object[] { uRow.Cells["SteelNo"].Text, deptid }, ob);
- DataTable stdsteelDt_ = stdsteelDt.DefaultView.ToTable();
- foreach (UltraGridRow row in this.ultraGrid7.Rows)
- {
- for (int m = 1; m < dsProvt.Columns.Count; m++)
- {
- string bName = "0.0";//标钢标定值
- string cName = "0.0";//标钢采集值
- string name = "";
- if (dsProvt.Columns[m].ColumnName.ToUpper().Equals("ALT"))
- {
- name = "ANA_" + "AL";
- }
- else
- {
- name = "ANA_" + dsProvt.Columns[m].ColumnName.ToUpper();
- }
- var list = stdsteelDt_.AsEnumerable().Where(p => p[name].ToString2() == "1").ToList();//取出对应元素所用的哪个标钢号
- if (list.Count() > 0)
- {
- string steelname = list.FirstOrDefault()["SAMPLE_NO"].ToString2();//标钢号
- if (list.Any())
- {
- var list2 = stdsteelBaseDt.AsEnumerable().Where(p => p["SAMPLE_NO"].ToString2() == steelname).ToList();
- if (list2.Any())
- {
- bName = list2.FirstOrDefault()[name].ToString3();//标钢标定值
- if (dsProvt.Columns[m].ColumnName.ToUpper().Equals("SI") || dsProvt.Columns[m].ColumnName.ToUpper().Equals("MN") || dsProvt.Columns[m].ColumnName.ToUpper().Equals("NI") || dsProvt.Columns[m].ColumnName.ToUpper().Equals("CR") || dsProvt.Columns[m].ColumnName.ToUpper().Equals("MO") || dsProvt.Columns[m].ColumnName.ToUpper().Equals("CU") || dsProvt.Columns[m].ColumnName.ToUpper().Equals("V") || dsProvt.Columns[m].ColumnName.ToUpper().Equals("NB") || dsProvt.Columns[m].ColumnName.ToUpper().Equals("TI") || dsProvt.Columns[m].ColumnName.ToUpper().Equals("W") || dsProvt.Columns[m].ColumnName.ToUpper().Equals("CO") || dsProvt.Columns[m].ColumnName.ToUpper().Equals("ZR"))
- {
- bName = Math.Round(decimal.Parse(bName), 2).ToString3();
- }
- else if (dsProvt.Columns[m].ColumnName.ToUpper().Equals("P") || dsProvt.Columns[m].ColumnName.ToUpper().Equals("AL") || dsProvt.Columns[m].ColumnName.ToUpper().Equals("ALS"))
- {
- bName = Math.Round(decimal.Parse(bName), 3).ToString3();
- }
- else if (dsProvt.Columns[m].ColumnName.ToUpper().Equals("B") || dsProvt.Columns[m].ColumnName.ToUpper().Equals("CA") || dsProvt.Columns[m].ColumnName.ToUpper().Equals("PB") || dsProvt.Columns[m].ColumnName.ToUpper().Equals("SN") || dsProvt.Columns[m].ColumnName.ToUpper().Equals("AS") || dsProvt.Columns[m].ColumnName.ToUpper().Equals("SB") || dsProvt.Columns[m].ColumnName.ToUpper().Equals("BI"))
- {
- bName = Math.Round(decimal.Parse(bName), 4).ToString3();
- }
- }
- }
- }
- string boundValue = "";
- //row.Cells[m].Value = double.Parse(bName) - double.Parse(cName);
- DataTable gradeTypeDt = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryGradeTypeMax", new object[] { dsProvt.Columns[m].ColumnName.ToString(), bName, gradeType }, ob);//获取标钢修约值的界限值
- if (gradeTypeDt.Rows.Count > 0)
- {
- boundValue = gradeTypeDt.Rows[0]["BOUNDARY_VALUE"].ToString3();
- }
- else
- {
- boundValue = "";
- }
- if (boundValue != "")
- {
- if (double.Parse(row.Cells[m - 1].Value.ToString3()) > double.Parse(boundValue.ToString3()))
- {
- row.Cells[m - 1].Appearance.BackColor = Color.Red;
- }
- else
- {
- row.Cells[m - 1].Appearance.BackColor = Color.Empty;
- }
- }
-
- }
- }
- }
- /// <summary>
- /// 打印报告
- /// </summary>
- private void printReport()
- {
- this.ultraGrid4.UpdateData();
- UltraGridRow uRow = this.ultraGrid4.ActiveRow;
- if (uRow == null) return;
- string checkNo = uRow.Cells["CheckNo"].Text.Trim();
- string strSUPPLY_UNIT = uRow.Cells["SupplyUnit"].Text.Trim();
- string flag = "";
- DataTable dt = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryFlag", new object[] { checkNo }, ob);
- if (dt.Rows.Count > 0)
- {
- flag = dt.Rows[0]["Flag"].ToString3();
- }
- if (flag != "4" && flag != "5")
- {
- MessageUtil.ShowTips("未审核数据,不允许打印报告!");
- return;
- }
- string strurl = "";
- if (strSUPPLY_UNIT.Equals("江苏天淮钢管有限公司"))
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepPipeChemAnalysisReportTH.cpt&op=view&CHECK_NO=" + checkNo;
- }
- else
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepPipeChemAnalysisReport.cpt&op=view&CHECK_NO=" + checkNo;
- }
-
- FrmRepExcel fBug = new FrmRepExcel(ob, strurl);
- fBug.AutoSize = true;
- fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fBug.WindowState = FormWindowState.Maximized;
- fBug.Text = "化成成分报告";
- fBug.Show();
- }
- //查询上传的PDF文件
- /// <summary>
- /// 查询上传的PDF文件
- /// </summary>
- private void SelectFile(string filePathNew)
- {
- dlgOrderAskDown down = new dlgOrderAskDown(this.ob, filePathNew);
- // down.DeleteButton.Visible = false;
- down.ShowDialog();
- }
- //上传
- /// <summary>
- /// 上传
- /// </summary>
- private void UpFile()
- {
- this.ultraGrid4.UpdateData();
- UltraGridRow uRow = this.ultraGrid4.ActiveRow;
- if (uRow == null) return;
- string checkNo = uRow.Cells["CheckNo"].Text.Trim();
- string strSUPPLY_UNIT = uRow.Cells["SupplyUnit"].Text.Trim();
- string cpt = "";
- if (strSUPPLY_UNIT.Equals("江苏天淮钢管有限公司"))
- {
- cpt = "RepPipeChemAnalysisReportTH.cpt";
- }
- else
- {
- cpt = "RepPipeChemAnalysisReport.cpt";
- }
- DataTable ds = PublicServer.GetData("com.steering.lims.data.pipe.FrmDataCJBase.doQueryIsAudit", new object[] { checkNo, arrId }, ob);
- if (int.Parse(ds.Rows[0][0].ToString()) > 0)
- {
- MessageUtil.ShowTips("还有未审核试样组,不允许上传报告!");
- return;
- }
- string filePathNew = "";
- if (UpLoadHandle.Upload(checkNo, cpt, "huaxue", out filePathNew))
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.lims.data.pipe.FrmLabDateParm";
- ccp.MethodName = "updatePipeReport";
- ccp.ServerParams = new object[] { checkNo, "", "", "HUAXUE_PATH", filePathNew };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("上传成功!"))
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- SelectFile(filePathNew);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- else
- {
- MessageUtil.ShowError("系统生成PDF失败,请稍后再试!");
- return;
- }
- }
- //上传
- /// <summary>
- /// 上传
- /// </summary>
- private void UpFile(string checkNo)
- {
- DataTable ds = PublicServer.GetData("com.steering.lims.data.pipe.FrmDataCJBase.doQueryIsAuditHx", new object[] { checkNo, arrId }, ob);
- if (int.Parse(ds.Rows[0][0].ToString()) > 0)
- {
- MessageUtil.ShowTips("还有未审核试样组,不允许上传报告!");
- return;
- }
- string filePathNew = "";
- if (UpLoadHandle.Upload(checkNo, "RepPipeChemAnalysisReport.cpt", "huaxue", out filePathNew))
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.lims.data.pipe.FrmLabDateParm";
- ccp.MethodName = "updatePipeReport";
- ccp.ServerParams = new object[] { checkNo, "", "", "HUAXUE_PATH", filePathNew };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("上传成功!"))
- {
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- else
- {
- MessageUtil.ShowError("系统生成PDF失败,请稍后再试!");
- return;
- }
- }
- /// <summary>
- /// 查询
- /// </summary>
- private void doQueryChem()
- {
- string startTim = "";
- string endTim = "";
- string checkNo = "";
- string judgeNo = "";
- string sampleNo = "";
- if (this.chkRegTime.Checked)
- {
- startTim = this.RegStartTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
- endTim = this.RegEndTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
- }
- if (this.chkLotNo.Checked && this.txtCheckNo.Text.Trim() != "")
- {
- checkNo = this.txtCheckNo.Text.Trim();
- }
- if (this.chkJudgeNo.Checked && this.txtJudgeNo.Text.Trim() != "")
- {
- judgeNo = this.txtJudgeNo.Text.Trim();
- }
- if (this.chkSampleNo.Checked && this.txtSampleNo.Text.Trim() != "")
- {
- sampleNo = this.txtSampleNo.Text.Trim();
- }
- ArrayList parmList = new ArrayList();
- parmList.Add(startTim);
- parmList.Add(endTim);
- parmList.Add(checkNo);
- parmList.Add(judgeNo);
- parmList.Add(sampleNo);
- if (ultraTabControl1.SelectedTab.Key == "0")
- {
- parmList.Add("2");
- }
- else if (ultraTabControl1.SelectedTab.Key == "1")
- {
- parmList.Add("3");
- }
- List<PipeCheckconsignBaseinfoEntity> listSource = EntityHelper.GetData<PipeCheckconsignBaseinfoEntity>(
- "com.steering.lims.data.pipe.FrmChemDataManage.doQueryChem", new object[] { parmList, arrId, plineCodes }, this.ob);
- if (ultraTabControl1.SelectedTab.Key == "0")
- {
- pipeCheckconsignBaseinfoEntityBindingSource1.Clear();
- //((DataTable)this.ultraGrid3.DataSource).Clear();
- pipeCheckconsignBaseinfoEntityBindingSource.DataSource = listSource;
- foreach (UltraGridRow row in ultraGrid1.Rows)
- {
- if (int.Parse(row.Cells["CheckCount"].Text) > 0)
- {
- row.RowSelectorAppearance.BackColor = Color.GreenYellow; ;
- }
- }
- }
- else if (ultraTabControl1.SelectedTab.Key == "1")
- {
- pipeCheckconsignBaseinfoEntityBindingSource3.Clear();
- //((DataTable)this.ultraGrid6.DataSource).Clear();
- pipeCheckconsignBaseinfoEntityBindingSource2.DataSource = listSource;
- foreach (UltraGridRow row in ultraGrid4.Rows)
- {
- if (row.Cells["Flag"].Text.Equals("已审核") || row.Cells["Flag"].Text.Equals("判定已接收"))
- {
- row.RowSelectorAppearance.BackColor = Color.Yellow;
- }
- }
- }
- }
- /// <summary>
- /// 删除化学结果
- /// </summary>
- private void deleteChemValue()
- {
- this.ultraGrid4.UpdateData();
- UltraGridRow uRow = this.ultraGrid4.ActiveRow;
- if (uRow == null) return;
- PipeCheckconsignBaseinfoEntity pipeBase = (PipeCheckconsignBaseinfoEntity)uRow.ListObject;
- string pipeBaseInfoEntity = JSONFormat.Format(pipeBase);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.lims.data.pipe.FrmChemDataManage";
- ccp.MethodName = "deleteChemValue";
- ccp.ServerParams = new object[] { pipeBaseInfoEntity };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("删除成功!"))
- {
- doQueryChem();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 审核
- /// </summary>
- private void auditChemValue()
- {
- this.ultraGrid4.UpdateData();
- UltraGridRow uRow = this.ultraGrid4.ActiveRow;
- if (uRow == null) return;
-
- if (aduitCount > 0)
- {
- if (MessageUtil.ShowYesNoAndQuestion("存在不符合工艺文件数据信息,是否继续审核检验实绩?") == DialogResult.No)
- {
- return;
- }
- }
- PipeCheckconsignBaseinfoEntity pipeBase = (PipeCheckconsignBaseinfoEntity)uRow.ListObject;
- string pipeBaseInfoEntity = JSONFormat.Format(pipeBase);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.lims.data.pipe.FrmChemDataManage";
- ccp.MethodName = "auditChemValue";
- ccp.ServerParams = new object[] { pipeBaseInfoEntity };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("审核成功!"))
- {
- string isProducer = uRow.Cells["Isproducer"].Text.ToString();
- if (isProducer == "1")
- {
- if (MessageUtil.ShowYesNoAndQuestion("有监制,是否打印?") == DialogResult.Yes)
- {
- printReport();
- }
- }
- UpFile(uRow.Cells["CheckNo"].Text);
- doQueryChem();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 取消审核
- /// </summary>
- private void cancelAudit()
- {
- this.ultraGrid4.UpdateData();
- UltraGridRow uRow = this.ultraGrid4.ActiveRow;
- if (uRow == null) return;
- PipeCheckconsignBaseinfoEntity pipeBase = (PipeCheckconsignBaseinfoEntity)uRow.ListObject;
- string pipeBaseInfoEntity = JSONFormat.Format(pipeBase);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.lims.data.pipe.FrmChemDataManage";
- ccp.MethodName = "cancelAudit";
- ccp.ServerParams = new object[] { pipeBaseInfoEntity };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("撤销成功!"))
- {
- doQueryChem();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 保存数据
- /// </summary>
- private void saveData()
- {
- this.ultraGrid3.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- UltraGridRow stsRow = this.ultraGrid7.ActiveRow;
- if (uRow == null) return;
- UltraGrid ug = this.ultraGrid3;
- if (manageCount > 0)
- {
- if (MessageUtil.ShowYesNoAndQuestion("存在不符合工艺文件数据信息,是否继续保存检验实绩?") == DialogResult.No)
- {
- return;
- }
- }
- if (!checkBaseInfo())
- {
- return;
- }
- string chemDiveCode = this.cmbChemDive.CheckedItems.Select(p => p.DataValue.ToString()).Aggregate((a, b) => a + (a == "" ? "" : ",") + b);
- string chemDiveName = this.cmbChemDive.CheckedItems.Select(p => p.DisplayText.ToString()).Aggregate((a, b) => a + (a == "" ? "" : ",") + b);
- string chemMethodCode = this.cmbChemMethodName.CheckedItems.Select(p => p.DataValue.ToString()).Aggregate((a, b) => a + (a == "" ? "" : ",") + b);
- string chemMethodName = this.cmbChemMethodName.CheckedItems.Select(p => p.DisplayText.ToString()).Aggregate((a, b) => a + (a == "" ? "" : ",") + b);
- ArrayList baseInfoList = new ArrayList();
- baseInfoList.Add(chemDiveCode);
- baseInfoList.Add(chemDiveName);
- baseInfoList.Add(chemMethodCode);
- baseInfoList.Add(chemMethodName);
- baseInfoList.Add(this.cmbChemOrder.Value.ToString2());
- baseInfoList.Add(this.cmbChemGroup.Value.ToString2());
- baseInfoList.Add(this.txtChemUser.Text);
- baseInfoList.Add(this.txtAuditUser.Text);
- baseInfoList.Add(this.txtREMARK.Text);
- baseInfoList.Add(this.txtTemp.Text.Trim());
- baseInfoList.Add(this.txtHumidity.Text.Trim());
- baseInfoList.Add(this.cmbContent.Text);
- baseInfoList.Add(this.txtHandOverName.Text);
- baseInfoList.Add(this.txtTakeOverName.Text);
- baseInfoList.Add(this.txtProductionSituation.Text);
- if (this.txtChemUser.Text.Equals(this.txtAuditUser.Text))
- {
- MessageUtil.ShowTips("试验人和审核人不能是同一人!");
- return;
- }
- string diveName = "";//试样采集设备
- DataTable dsDiveName = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryDiveName", new object[] { uRow.Cells["CheckNo"].Text }, ob);
- if (dsDiveName.Rows.Count > 0)
- {
- diveName = dsDiveName.Rows[0][0].ToString();
- }
- //取选择了哪些标钢
- DataTable stdsteelDt = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryStdsteel", new object[] { uRow.Cells["SteelNo"].Text, deptid }, ob);
- DataTable stdsteelDt_ = stdsteelDt.DefaultView.ToTable();
- //标钢下元素值
- DataTable stdsteelBaseDt = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryStdsteelBaseInfo", new object[] { uRow.Cells["SteelNo"].Text, deptid }, ob);
- ArrayList parmList = new ArrayList();
- for (int i = 0; i < ug.Rows.Count; i++)
- {
- if (ug.Rows[i].Cells["SAMPLE_NO"].Text != "报出值")
- {
- for (int j = 1; j < this.ultraGrid3.DisplayLayout.Bands[0].Columns.Count; j++)
- {
- ArrayList chemCode = new ArrayList();
- chemCode.Add(ug.Rows[i].Cells["SAMPLE_NO"].Text);//试样号
- chemCode.Add(ug.Rows[i].Cells[j].Column.Key);//元素
- chemCode.Add(stsRow.Cells[j - 1].Text);//元素修约值
- chemCode.Add(ug.Rows[i].Cells[j].Text.ToString3());//元素采集值
- chemCode.Add(ug.Rows[i + 1].Cells[j].Text.ToString3().Replace('<', '-'));//报出值
- string chemName = "ANA_" + ug.Rows[i].Cells[j].Column.Key;
- var list = stdsteelDt_.AsEnumerable().Where(p => p[chemName].ToString2() == "1").ToList();//取出对应元素所用的哪个标钢号
- if (list.Any())
- {
- chemCode.Add(list.FirstOrDefault()["SAMPLE_NO"].ToString2());//标钢号
- var list2 = stdsteelBaseDt.AsEnumerable().Where(p => p["SAMPLE_NO"].ToString2() == list.FirstOrDefault()["SAMPLE_NO"].ToString2()).ToList();
- if (list2.Any())
- {
- chemCode.Add(list2.FirstOrDefault()[chemName].ToString3());//标钢标定值
- }
- else
- {
- chemCode.Add("");
- }
- DataTable stdSteelD = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryStdsteelProcess", new object[] { list.FirstOrDefault()["SAMPLE_NO"].ToString2(), diveName }, ob);
- var list3 = stdSteelD.AsEnumerable().Where(p => p["SAMPLE_NO"].ToString2() == list2.FirstOrDefault()[chemName].ToString3()).ToList();
- if (list3.Any())
- {
- chemCode.Add(list3.FirstOrDefault()[chemName].ToString3());//标钢采集值
- }
- else
- {
- chemCode.Add("");
- }
- }
- else
- {
- chemCode.Add("");
- chemCode.Add("");
- chemCode.Add("");
- }
- parmList.Add(chemCode);
- }
- }
- }
- PipeCheckconsignBaseinfoEntity pipeBase = (PipeCheckconsignBaseinfoEntity)uRow.ListObject;
- string pipeBaseInfoEntity = JSONFormat.Format(pipeBase);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.lims.data.pipe.FrmChemDataManage";
- ccp.MethodName = "saveChemValue";
- ccp.ServerParams = new object[] { pipeBaseInfoEntity, parmList, baseInfoList };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("保存成功!"))
- {
- doQueryChem();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 检查基础信息是否选择、录入
- /// </summary>
- /// <returns></returns>
- private bool checkBaseInfo()
- {
- if (this.cmbChemDive.CheckedItems.Count() == 0)
- {
- MessageUtil.ShowTips("请选择试验设备!");
- return false;
- }
- if (this.cmbChemMethodName.CheckedItems.Count() == 0)
- {
- MessageUtil.ShowTips("请选择试验方法!");
- return false;
- }
- if (this.cmbChemOrder.Value.ToString2() == "")
- {
- MessageUtil.ShowTips("请选择试验班次!");
- return false;
- }
- if (this.cmbChemGroup.Value.ToString2() == "")
- {
- MessageUtil.ShowTips("请选择试验班组!");
- return false;
- }
- if (this.txtChemUser.Text.ToString2() == "")
- {
- MessageUtil.ShowTips("请输入试验人!");
- return false;
- }
- if (this.txtAuditUser.Text.ToString2() == "")
- {
- MessageUtil.ShowTips("请输入审核人!");
- return false;
- }
- if (this.txtTemp.Text.Trim() == "")
- {
- MessageUtil.ShowTips("请输入环境温度!");
- return false;
- }
- if (this.txtHumidity.Text.Trim() == "")
- {
- MessageUtil.ShowTips("请输入环境湿度!");
- return false;
- }
- if (this.cmbContent.Text.Trim() == "")
- {
- MessageUtil.ShowTips("请选择工作内容!");
- return false;
- }
- return true;
- }
- /// <summary>
- /// 关闭
- /// </summary>
- private void close()
- {
- this.Close();
- }
- private void chkRegTime_CheckedChanged(object sender, EventArgs e)
- {
- this.RegStartTime.Enabled = this.RegEndTime.Enabled = this.chkRegTime.Checked;
- }
- private void chkLotNo_CheckedChanged(object sender, EventArgs e)
- {
- this.txtCheckNo.Enabled = this.chkLotNo.Checked;
- }
- private void chkJudgeNo_CheckedChanged(object sender, EventArgs e)
- {
- this.txtJudgeNo.Enabled = this.chkJudgeNo.Checked;
- }
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- if (uRow == null) return;
- doQueryChemBaseInfo(uRow);//查询委托基础信息
- doQueryChemStdSteelValue(uRow);//查询标钢修约值
- doQueryChemDetial(uRow);//查询化学检验基础信息
- doQueryLgChem(uRow);//查询熔炼成分信息
- }
- private void ultraGrid4_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow uRow = this.ultraGrid4.ActiveRow;
- if (uRow == null)
- {
- return;
- }
- doQueryChemBaseInfo(uRow);//查询委托基础信息
- doQueryChemDetialQuote(uRow);
- checkChemValue(ultraGrid6, uRow);
- initCheckInformation(uRow);
- doQueryLgChem2(uRow);//查询熔炼成分信息
- }
- private void initCheckInformation(UltraGridRow uRow)
- {
- DataTable ds = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryCheckTime", new object[] { uRow.Cells["CheckNo"].Text, uRow.Cells["SampleNo"].Text }, ob);
- if (ds.Rows.Count > 0)
- {
- this.txtTemp1.Text = ds.Rows[0]["CHECK_TEMP"].ToString();
- this.txtHumidity1.Text = ds.Rows[0]["CHECK_HUMIDITY"].ToString();
- this.cmbChemMethodName1.Value = ds.Rows[0]["FORMUAL_NAME"].ToString();
- cmbChemDive1.Value = ds.Rows[0]["DEVICE_NAME"].ToString();
- cmbChemOrder1.Value = ds.Rows[0]["CHECK_SHIFT"].ToString();
- cmbChemGroup1.Value = ds.Rows[0]["CHECK_CLASS"].ToString();
- txtChemUser1.Value = ds.Rows[0]["CHECK_NAME"].ToString();
- cmbCheckTime.Value = ds.Rows[0]["CHECK_TIME"].ToString();
- txtAuditUser1.Value = ds.Rows[0]["AUDIT_NAME"].ToString();
- cmbAuditTime.Value = ds.Rows[0]["AUDIT_TIME"].ToString();
- cmbContent1.Text = ds.Rows[0]["CONTENT"].ToString();
- ultraHandOverName.Value = ds.Rows[0]["HAND_OVER_NAME"].ToString(); //交班人
- ultraTakeOverName.Value = ds.Rows[0]["TAKE_OVER_NAME"].ToString(); //接班人
- ultraProductionSituation.Value = ds.Rows[0]["PRODUCTION_SITUATION"].ToString(); //生产情况
- }
- }
- /// <summary>
- /// 查询标钢计算修约值
- /// </summary>
- /// <param name="uRow"></param>
- private void doQueryChemStdSteelValue(UltraGridRow uRow)
- {
- //string steelType = "";//钢种分类
- //DataTable steelTypeDt = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryGradeType", new object[] { uRow.Cells["SteelNo"].Text }, ob);
- //if (steelTypeDt.Rows.Count > 0)
- //{
- // steelType = steelTypeDt.Rows[0]["ASSORTMENT_NAME"].ToString();
- //}
- DataTable ds = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryChemDetial", new object[] { uRow.Cells["CheckNo"].Text }, ob);
- DataTable ss = ds.DefaultView.ToTable();
- DataTable dsProvt = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryChemPrivotStdSteel", new object[] { uRow.Cells["CheckNo"].Text }, ob);
- if (dsProvt.Rows.Count > 0)
- {
- for (int i = dsProvt.Columns.Count - 1; i >= 0; i--)
- {
- dsProvt.Columns[i].ColumnName = dsProvt.Columns[i].ColumnName.Trim('\'');
- if ((ss.Select("CHEM_NAME='" + dsProvt.Columns[i].ColumnName + "'").Length == 0))
- {
- dsProvt.Columns.Remove(dsProvt.Columns[i].ColumnName);
- }
- }
- }
- ultraGrid7.DataSource = dsProvt;
- string diveName = "";//试样采集设备
- DataTable dsDiveName = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryDiveName",new object[]{uRow.Cells["CheckNo"].Text},ob);
- if (dsDiveName.Rows.Count > 0)
- {
- diveName = dsDiveName.Rows[0][0].ToString();
- }
- this.txtSamDiveName.Text = diveName;
- //取钢种下所有标钢号下元素值
- DataTable stdsteelBaseDt = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryStdsteelBaseInfo", new object[] { uRow.Cells["SteelNo"].Text, deptid }, ob);
- Dictionary<string, DataTable> stdProcessDtDic = new Dictionary<string, DataTable>();
- //取选择了哪些标钢
- DataTable stdsteelDt = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryStdsteel", new object[] { uRow.Cells["SteelNo"].Text, deptid }, ob);
- DataTable stdsteelDt_ = stdsteelDt.DefaultView.ToTable();
- foreach (UltraGridRow row in this.ultraGrid7.Rows)
- {
- for (int m = 0; m < dsProvt.Columns.Count; m++)
- {
- string bName = "0.0";//标钢标定值
- string cName = "0.0";//标钢采集值
- string name = "";
- if (dsProvt.Columns[m].ColumnName.ToUpper().Equals("ALT"))
- {
- name = "ANA_" + "AL" ;
- }
- else
- {
- name = "ANA_" + dsProvt.Columns[m].ColumnName.ToUpper();
- }
- var list = stdsteelDt_.AsEnumerable().Where(p => p[name].ToString2() == "1").ToList();//取出对应元素所用的哪个标钢号
- if (list.Count() > 0)
- {
- string steelname = list.FirstOrDefault()["SAMPLE_NO"].ToString2();//标钢号
- if (list.Any())
- {
- var list2 = stdsteelBaseDt.AsEnumerable().Where(p => p["SAMPLE_NO"].ToString2() == steelname).ToList();
- if (list2.Any())
- {
-
- bName = list2.FirstOrDefault()[name].ToString3();//标钢标定值
- DataTable stdProcessDt;
- if (stdProcessDtDic.ContainsKey(steelname))
- {
- stdProcessDtDic.TryGetValue(steelname, out stdProcessDt);
- }
- else
- {
- stdProcessDt = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryStdsteelProcess", new object[] { steelname, diveName }, ob);
- stdProcessDtDic.Add(steelname, stdProcessDt);
- }
- var list3 = stdProcessDt.AsEnumerable().Where(p => p["SAMPLE_NO"].ToString2().ToUpper() == steelname.ToUpper()).ToList();
- if (list3.Any())
- {
- cName = list3.FirstOrDefault()[name].ToString3();//标钢采集值
- }
- }
- }
- }
- string boundValue = "";
- if (!StringUtil.IsNumber(cName))
- {
- MessageUtil.ShowTips("标钢采集值:" + cName + "不是数字");
- return;
- }
- row.Cells[m].Value = decimal.Parse(bName) - decimal.Parse(cName);
- //隐藏C、S
- //if (dsProvt.Columns[m].ColumnName.ToUpper().Equals("C") || dsProvt.Columns[m].ColumnName.ToUpper().Equals("S"))
- //{
- // row.Cells[m].Column.Hidden = true;
- //}
- row.Cells[m].Appearance.FontData.SizeInPoints = 10;
- //DataTable gradeTypeDt = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryGradeTypeMax", new object[] { dsProvt.Columns[m].ColumnName.ToString(), bName, steelType }, ob);//获取标钢修约值的界限值
- //if (gradeTypeDt.Rows.Count > 0)
- //{
- // boundValue = gradeTypeDt.Rows[0]["BOUNDARY_VALUE"].ToString3();
- //}
- //else
- //{
- // boundValue = "";
- //}
- //if (double.Parse(row.Cells[m].Value.ToString3()) > double.Parse(boundValue.ToString3()))
- //{
- // row.Cells[m].Appearance.BackColor = Color.Red;
- //}
- }
- }
- //foreach (UltraGridColumn clo in this.ultraGrid7.DisplayLayout.Bands[0].Columns)
- //{
- // clo.Header.Appearance.FontData.SizeInPoints = 12;
- //}
- GridHelper.RefreshAndAutoSize(ultraGrid7);
- //GridHelper.SetAllColumnsActive(ultraGrid7);
- }
- /// <summary>
- /// 查询保存结果
- /// </summary>
- /// <param name="uRow"></param>
- private void doQueryChemDetialQuote(UltraGridRow uRow)
- {
- DataTable chemDetialDt = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryChemDetialQuote", new object[] { uRow.Cells["CheckNo"].Text }, ob);
- DataTable ds = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryChemDetial", new object[] { uRow.Cells["CheckNo"].Text }, ob);
- DataTable ss = ds.DefaultView.ToTable();
- chemDetialDt.Columns["SAMPLE_NO"].Caption = "试样号";
- if (chemDetialDt.Rows.Count > 0)
- {
- if (chemDetialDt.Columns.Contains("'Al'") && chemDetialDt.Columns.Contains("'N'"))
- {
- chemDetialDt.Columns.Add(new DataColumn("ALN") { Caption = "ALN" });
- for (int i = 0; i < chemDetialDt.Rows.Count; i++)
- {
- if (!string.IsNullOrWhiteSpace(chemDetialDt.Rows[i]["'Al'"].ToString2())
- && !string.IsNullOrWhiteSpace(chemDetialDt.Rows[i]["'N'"].ToString2()))
- {
- chemDetialDt.Rows[i]["ALN"] = (Double.Parse(chemDetialDt.Rows[i]["'Al'"].ToString2()) / Double.Parse(chemDetialDt.Rows[i]["'N'"].ToString2())).ToString("f3");
- }
- }
- }
- for (int i = chemDetialDt.Columns.Count - 1; i >= 0; i--)
- {
- chemDetialDt.Columns[i].ColumnName = chemDetialDt.Columns[i].ColumnName.Trim('\'');
- if (chemDetialDt.Columns[i].ColumnName != "SAMPLE_NO" && (ss.Select("CHEM_NAME='" + chemDetialDt.Columns[i].ColumnName + "'").Length == 0)
- && chemDetialDt.Columns[i].ColumnName != "ALN")
- {
- chemDetialDt.Columns.Remove(chemDetialDt.Columns[i].ColumnName);
- }
- }
- }
- ultraGrid6.DataSource = chemDetialDt;
- foreach (UltraGridRow row in ultraGrid6.Rows)
- {
- if (double.Parse( row.Cells["ALN"].Text.ToString3()) < 2 )
- {
- row.Cells["ALN"].Appearance.BackColor = Color.Red;
- }
- for (int i = 0; i < ultraGrid6.DisplayLayout.Bands[0].Columns.Count; i++)
- {
- row.Cells[i].Appearance.FontData.SizeInPoints = 10;
-
- }
- }
- string diveName = "";//试样采集设备
- DataTable dsDiveName = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryDiveName", new object[] { uRow.Cells["CheckNo"].Text }, ob);
- if (dsDiveName.Rows.Count > 0)
- {
- diveName = dsDiveName.Rows[0][0].ToString();
- }
- txtDiveName1.Text = diveName;
- GridHelper.RefreshAndAutoSize(ultraGrid6);
- GridHelper.SetAllColumnsActive(ultraGrid6);
- }
- /// <summary>
- /// 查询熔炼成分
- /// </summary>
- /// <param name="uRow"></param>
- private void doQueryLgChem(UltraGridRow uRow)
- {
- if (ultraGrid8.DataSource != null)
- {
- ((DataTable)ultraGrid8.DataSource).Clear();
- }
- DataTable ds = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryLgChem", new object[] { uRow.Cells["StoveNo"].Text }, ob);
- DataTable dt = ultraGrid3.DataSource as DataTable;
- if (ds.Rows.Count > 0)
- {
- for (int i = ds.Columns.Count - 1; i >= 0; i--)
- {
- if (ds.Columns[i].ColumnName.Equals("SAMPLE_NO"))
- {
- ds.Columns[i].Caption = "式样号";
- }
- if (ds.Columns[i].ColumnName.Equals("ASN"))
- {
- ds.Columns[i].ColumnName = "As";
- }
- else
- {
- if (ds.Columns[i].ColumnName.Length == 2)
- {
- ds.Columns[i].ColumnName = ds.Columns[i].ColumnName.Substring(0, 1) + ds.Columns[i].ColumnName.Substring(1, 1).ToLower();
- }
- }
- if (!dt.Columns.Contains(ds.Columns[i].ColumnName))
- {
- ds.Columns.Remove(ds.Columns[i].ColumnName);
- }
- }
- ultraGrid8.DataSource = ds;
- GridHelper.RefreshAndAutoSize(ultraGrid8);
- }
- else
- {
- ultraGrid8.DataSource = null;
- }
- }
- private void doQueryLgChem2(UltraGridRow uRow)
- {
- if (ultraGrid9.DataSource != null)
- {
- ((DataTable)ultraGrid9.DataSource).Clear();
- }
- DataTable ds = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryLgChem", new object[] { uRow.Cells["StoveNo"].Text }, ob);
- DataTable dt = ultraGrid6.DataSource as DataTable;
- if (ds.Rows.Count > 0)
- {
- for (int i = ds.Columns.Count - 1; i >= 0; i--)
- {
- if (ds.Columns[i].ColumnName.Equals("SAMPLE_NO"))
- {
- ds.Columns[i].Caption = "式样号";
- }
- if (ds.Columns[i].ColumnName.Equals("ASN"))
- {
- ds.Columns[i].ColumnName = "As";
- }
- else
- {
- if (ds.Columns[i].ColumnName.Length == 2)
- {
- ds.Columns[i].ColumnName = ds.Columns[i].ColumnName.Substring(0, 1) + ds.Columns[i].ColumnName.Substring(1, 1).ToLower();
- }
- }
- if (!dt.Columns.Contains(ds.Columns[i].ColumnName))
- {
- ds.Columns.Remove(ds.Columns[i].ColumnName);
- }
- }
- ultraGrid9.DataSource = ds;
- GridHelper.RefreshAndAutoSize(ultraGrid9);
- }
- else
- {
- ultraGrid9.DataSource = null;
- }
- }
- /// <summary>
- /// 查询化学详细检验信息
- /// </summary>
- /// <param name="uRow"></param>
- private void doQueryChemDetial(UltraGridRow uRow)
- {
- string steelType = "";//钢种分类
- string txtLable = "";
- UltraGridRow stsRow = this.ultraGrid7.ActiveRow;
- DataTable steelTypeDt = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryGradeType", new object[] { uRow.Cells["SteelNo"].Text }, ob);
- if (steelTypeDt.Rows.Count > 0)
- {
- steelType = steelTypeDt.Rows[0]["ASSORTMENT_NAME"].ToString();
- }
- DataTable ds = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryChemDetial", new object[] { uRow.Cells["CheckNo"].Text }, ob);
- DataTable ss = ds.DefaultView.ToTable();
- DataTable dsProvt = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryChemPrivot", new object[] { uRow.Cells["CheckNo"].Text }, ob);
- dsProvt.Columns["SAMPLE_NO"].Caption = "试样号";
- if (dsProvt.Rows.Count > 0)
- {
- for (int i = dsProvt.Columns.Count - 1; i >= 0; i--)
- {
- dsProvt.Columns[i].ColumnName = dsProvt.Columns[i].ColumnName.Trim('\'');
- if (dsProvt.Columns[i].ColumnName != "SAMPLE_NO" && (ss.Select("CHEM_NAME='" + dsProvt.Columns[i].ColumnName + "'").Length == 0))
- {
- dsProvt.Columns.Remove(dsProvt.Columns[i].ColumnName);
- }
- }
- }
- //增加修约值行
- for (int h = 0; h < dsProvt.Rows.Count; h++)
- {
- DataRow drr = dsProvt.NewRow();
- drr["SAMPLE_NO"] = "报出值";
- dsProvt.Rows.InsertAt(drr, h + 1);
- h++;
- }
- ultraGrid3.DataSource = dsProvt;
- //取钢种下所有标钢号下元素值
- DataTable stdsteelBaseDt = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryStdsteelBaseInfo", new object[] { uRow.Cells["SteelNo"].Text, deptid }, ob);
- Dictionary<string, DataTable> stdProcessDtDic = new Dictionary<string, DataTable>();
- for (int k = 0; k < ultraGrid3.Rows.Count; k++)
- {
- if (updateFlag == "0")
- {
- ultraGrid3.Rows[k].Cells[0].Activation = Activation.ActivateOnly;
- }
- else
- {
- ultraGrid3.Rows[k].Cells[0].Activation = Activation.AllowEdit;
- }
-
- if (ultraGrid3.Rows[k].Cells["SAMPLE_NO"].Value.ToString() != "报出值")
- {
- //取式样号下采集值
- DataTable dsSampleDt = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQuerySampleProcess", new object[] { uRow.Cells["CheckNo"].Text, ultraGrid3.Rows[k].Cells["SAMPLE_NO"].Value.ToString() }, ob);
- if (dsSampleDt.Rows.Count > 0)
- {
- for (int x = 1; x < dsProvt.Columns.Count; x++)
- {
- string cc = dsProvt.Columns[x].ColumnName.ToUpper();
- decimal bcValue = 0;
- ultraGrid3.Rows[k].Cells[x].Value = dsSampleDt.Rows[0]["ANA_" + dsProvt.Columns[x].ColumnName.ToUpper()].ToString();
- if (!dsProvt.Columns[x].ColumnName.ToUpper().Equals("C") && !dsProvt.Columns[x].ColumnName.ToUpper().Equals("S") && !dsProvt.Columns[x].ColumnName.ToUpper().Equals("CA") && !dsProvt.Columns[x].ColumnName.ToUpper().Equals("BI") && !dsProvt.Columns[x].ColumnName.ToUpper().Equals("ALS"))
- {
- if (updateFlag == "0")
- {
- ultraGrid3.Rows[k].Cells[x].Activation = Activation.ActivateOnly;
- }
- else {
- ultraGrid3.Rows[k].Cells[x].Activation = Activation.AllowEdit;
- }
-
- bcValue = decimal.Parse(dsSampleDt.Rows[0]["ANA_" + dsProvt.Columns[x].ColumnName.ToUpper()].ToString3()) + decimal.Parse(this.ultraGrid7.Rows[0].Cells[x - 1].Value.ToString3());
- }
- else
- {
- ultraGrid3.Rows[k].Cells[x].Activation = Activation.AllowEdit;
- ultraGrid3.Rows[k].Cells[x].Appearance.BackColor = Color.Yellow;
- //bcValue = decimal.Parse(dsSampleDt.Rows[0]["ANA_" + dsProvt.Columns[x].ColumnName.ToUpper()].ToString3());
- bcValue = decimal.Parse(dsSampleDt.Rows[0]["ANA_" + dsProvt.Columns[x].ColumnName.ToUpper()].ToString3()) + decimal.Parse(this.ultraGrid7.Rows[0].Cells[x - 1].Value.ToString3());
- }
- ultraGrid3.Rows[k + 1].Cells[x].Value = bcValue;
- if (!dsProvt.Columns[x].ColumnName.ToUpper().Equals("PB") && !dsProvt.Columns[x].ColumnName.ToUpper().Equals("BI") && !dsProvt.Columns[x].ColumnName.ToUpper().Equals("SB"))
- {
- if (bcValue <= 0)
- {
- txtLable = txtLable + dsProvt.Columns[x].ColumnName + "异常 ";
- }
- }
- if (updateFlag == "0")
- {
- ultraGrid3.Rows[k + 1].Cells[x].Activation = Activation.ActivateOnly;
- }
- else {
- ultraGrid3.Rows[k + 1].Cells[x].Activation = Activation.AllowEdit;
- }
-
- ultraGrid3.Rows[k].Cells[x].Appearance.FontData.SizeInPoints = 10;
- }
- //ultraLabel11.Text = txtLable;
- ultraLabel11.ForeColor = Color.Red;
- }
- else
- {
- for (int x = 1; x < dsProvt.Columns.Count; x++)
- {
- ultraGrid3.Rows[k].Cells[x].Value = "";
- if (!dsProvt.Columns[x].ColumnName.ToUpper().Equals("C") && !dsProvt.Columns[x].ColumnName.ToUpper().Equals("S") && !dsProvt.Columns[x].ColumnName.ToUpper().Equals("B") && !dsProvt.Columns[x].ColumnName.ToUpper().Equals("CA") && !dsProvt.Columns[x].ColumnName.ToUpper().Equals("BI") && !dsProvt.Columns[x].ColumnName.ToUpper().Equals("ALS"))
- {
- ultraGrid3.Rows[k + 1].Cells[x].Value = 0.0 - double.Parse(this.ultraGrid7.Rows[0].Cells[x - 1].Value.ToString3());
- if (updateFlag == "0")
- {
- ultraGrid3.Rows[k].Cells[x].Activation = Activation.ActivateOnly;
- }
- else {
- ultraGrid3.Rows[k].Cells[x].Activation = Activation.AllowEdit;
- }
- }
- else
- {
- ultraGrid3.Rows[k + 1].Cells[x].Value = 0.0 - double.Parse(this.ultraGrid7.Rows[0].Cells[x - 1].Value.ToString3());
- ultraGrid3.Rows[k].Cells[x].Activation = Activation.AllowEdit;
- ultraGrid3.Rows[k].Cells[x].Appearance.BackColor = Color.Yellow;
- }
- ultraGrid3.Rows[k].Cells[x].Appearance.FontData.SizeInPoints = 10;
- //ultraGrid3.Rows[k + 1].Cells[x].Value = 0.0 - double.Parse(this.ultraGrid7.Rows[0].Cells[x - 1].Value.ToString3());
- //ultraGrid3.Rows[k + 1].Cells[x].Activation = Activation.ActivateOnly;
- }
- }
- }
- else
- {
- for (int x = 1; x < dsProvt.Columns.Count; x++)
- {
- ultraGrid3.Rows[k].Cells[x].Appearance.FontData.SizeInPoints = 10;
- }
- }
- }
- checkUltraGrid(ultraGrid3, uRow);
- GridHelper.RefreshAndAutoSize(ultraGrid3);
- //foreach (UltraGridColumn cl in ultraGrid3.DisplayLayout.Bands[0].Columns)
- //{
- // cl.FilterOperandStyle = FilterOperandStyle.Disabled;
- //}
- }
- /// <summary>
- /// 检查保存后数据
- /// </summary>
- /// <param name="ug"></param>
- /// <param name="uRow"></param>
- private void checkChemValue(UltraGrid ug, UltraGridRow uRow)
- {
- DataTable chemDataTable = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryChemDetial", new object[] { uRow.Cells["CheckNo"].Text }, ob);
- if (chemDataTable.Rows.Count <= 0) return;
- for (int i = 0; i < ug.Rows.Count; i++)
- {
- string sampleNo = ug.Rows[i].Cells["SAMPLE_NO"].Value.ToString();
- for (int j = 1; j < ug.DisplayLayout.Bands[0].Columns.Count; j++)
- {
- string columsKey = ug.DisplayLayout.Bands[0].Columns[j].Key;
- if (!chemDataTable.AsEnumerable().Any(p => p["SAMPLE_NO"].ToString() == sampleNo && p["CHEM_NAME"].ToString() == columsKey)) continue;
- DataRow list = chemDataTable.AsEnumerable().First(p => p["SAMPLE_NO"].ToString() == sampleNo && p["CHEM_NAME"].ToString() == columsKey);
- string stdMax = list["STDMAX"].ToString();//元素上限值
- string stdMin = list["STDMIN"].ToString();//元素下限值
- double quoteValue = double.Parse(ug.Rows[i].Cells[j].Value.ToString3().Replace('<', '-'));
- //判断报出值是否不合
- if (stdMin != "" && stdMax != "")
- {
- if (quoteValue < double.Parse(stdMin) || quoteValue > double.Parse(stdMax))
- {
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Red;
- aduitCount = aduitCount + 1;
- }
- }
- else if (stdMin != "" && stdMax == "")
- {
- if (StringUtil.IsNumber(stdMin))
- {
- if (quoteValue < double.Parse(stdMin))
- {
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Red;
- aduitCount = aduitCount + 1;
- }
- }
- }
- else if (stdMin == "" && stdMax != "")
- {
- if (StringUtil.IsNumber(stdMax))
- {
- if (quoteValue > double.Parse(stdMax))
- {
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Red;
- aduitCount = aduitCount + 1;
- }
- }
- }
- }
- }
- }
- /*/// <summary>
- /// 检查数据
- /// </summary>
- /// <param name="ultraGrid3"></param>
- private void checkUltraGrid(UltraGrid ug, UltraGridRow uRow)
- {
- manageCount = 0;
- DataTable chemDataTable = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryChemDetial", new object[] { uRow.Cells["CheckNo"].Text }, ob);
- if (chemDataTable.Rows.Count <= 0) return;
- int quoteIndex = 0;//报出值位数
- int stdMinIndex = 0;//下限小数位数
- int stdMaxIndex = 0;//上限小数位数
- int stdIndex = 0;//报出位数
- string txtLable = "";
- this.ultraLabel27.Text = "";
- for (int i = 0; i < ug.Rows.Count; i++)
- {
- if (ug.Rows[i].Cells["SAMPLE_NO"].Text == "报出值")
- {
- string sampleNo = ug.Rows[i - 1].Cells["SAMPLE_NO"].Value.ToString();
- for (int j = 1; j < ug.DisplayLayout.Bands[0].Columns.Count; j++)
- {
- string columsKey = ug.DisplayLayout.Bands[0].Columns[j].Key;
- if (!chemDataTable.AsEnumerable().Any(p => p["SAMPLE_NO"].ToString() == sampleNo && p["CHEM_NAME"].ToString() == columsKey)) continue;
- DataRow list = chemDataTable.AsEnumerable().First(p => p["SAMPLE_NO"].ToString() == sampleNo && p["CHEM_NAME"].ToString() == columsKey);
- string stdMax = list["STDMAX"].ToString();//元素上限值
- string stdMin = list["STDMIN"].ToString();//元素下限值
- double quoteValue = double.Parse(ug.Rows[i].Cells[j].Value.ToString3().Replace('<', '-'));//报出值
- quoteIndex = ug.Rows[i].Cells[j].Value.ToString3().Length - ug.Rows[i].Cells[j].Value.ToString3().IndexOf('.') - 1;//报出值小数位数
- stdMinIndex = stdMin.Length - stdMin.IndexOf('.') - 1;//下限值小数位数
- stdMaxIndex = stdMax.Length - stdMax.IndexOf('.') - 1;//上限值小数位数
- if (stdMax == "" && stdMin == "")//工艺无要求上下限
- {
- if (columsKey == "V" || columsKey == "Nb" || columsKey == "Ti" || columsKey == "Zr" || columsKey == "Mo" || columsKey == "Ni" || columsKey == "Cr" || columsKey == "Mo" || columsKey == "Cu" || columsKey == "W" || columsKey == "Co")
- {
- //大于0.006的数据四舍六入后是0.01
- if (quoteValue < 0.006)
- {
- ug.Rows[i].Cells[j].Value = "<0.01";
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Empty;
- }
- else
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, 2).ToString("f" + 2);
- }
- }
- else if (columsKey == "Pb" || columsKey == "Bi" || columsKey == "Sn" || columsKey == "As")
- {
- if (quoteValue < 0.0010)
- {
- ug.Rows[i].Cells[j].Value = "<0.0010";
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Empty;
- }
- else
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, 4).ToString("f" + 4);
- }
- }
- else if (columsKey == "Sb")
- {
- if (quoteValue < 0.0020)
- {
- ug.Rows[i].Cells[j].Value = "<0.0020";
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Empty;
- }
- else
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, 4).ToString("f" + 4);
- }
- }
- else if (columsKey == "B")
- {
- if(uRow.Cells["ContractNo"].Text.Contains("EXMPQ-180449E"))
- {
- this.ultraLabel27.Text = "B元素需报出实际值!";
- this.ultraLabel27.ForeColor = Color.Red;
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, 4).ToString("f" + 4);
- }
- else
- {
- if (quoteValue < 0.0005)
- {
- ug.Rows[i].Cells[j].Value = "<0.0005";
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Empty;
- }
- else
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, 4).ToString("f" + 4);
- }
- }
-
- }
- else if (columsKey == "C" || columsKey == "Si" || columsKey == "Mn" || columsKey == "Ni" || columsKey == "Cr" || columsKey == "Mo" || columsKey == "Cu" || columsKey == "W" || columsKey == "Co")
- {
- if (columsKey == "C" && uRow.Cells["SteelGrade"].Text.Contains("DNVGL SMLS 13Cr"))
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, 3).ToString("f" + 3);
- }
- else
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, 2).ToString("f" + 2);
- }
-
- if (double.Parse(ug.Rows[i].Cells[j].Value.ToString3()) <= 0)
- {
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Red;
- txtLable = txtLable + columsKey + "元素修约后为负数。";
- }
- }
- else if (columsKey == "P" || columsKey == "S" || columsKey == "Al" || columsKey == "Als")
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, 3).ToString("f" + 3);
- if (double.Parse(ug.Rows[i].Cells[j].Value.ToString3()) <= 0)
- {
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Red;
- txtLable = txtLable + columsKey + "元素修约后为负数。";
- }
- }
- else if (columsKey == "Ca" || columsKey == "Sn" || columsKey == "As")
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, 4).ToString("f" + 4);
- if (double.Parse(ug.Rows[i].Cells[j].Value.ToString3()) <= 0)
- {
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Red;
- txtLable = txtLable + columsKey + "元素修约后为负数。。";
- }
- }
- }
- else
- {
- //判断报出值是否不合
- if (columsKey != "Ca" && columsKey != "S")
- {
- if (stdMaxIndex >= stdMinIndex)//按工艺位数修约位数
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, stdMaxIndex).ToString("f" + stdMaxIndex);
- }
- else
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, stdMinIndex).ToString("f" + stdMinIndex);
- }
- }
- else if (columsKey == "C")
- {
- if (stdMaxIndex >= stdMinIndex)//按工艺位数修约位数
- {
- if (quoteIndex != stdMaxIndex)
- {
- txtLable = txtLable + columsKey + "元素工艺要求报出" + stdMaxIndex + "位";
- }
- }
- else
- {
- if (quoteIndex != stdMinIndex)
- {
- txtLable = txtLable + columsKey + "元素工艺要求报出" + stdMinIndex + "位";
- }
- }
- }
- else
- {
- if (columsKey == "Ca")
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, 4).ToString("f" + 4);
- }
- if (columsKey == "S")
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, 3).ToString("f" + 3);
- }
-
- }
-
- //判断符合工艺文件否
- if (stdMin != "" && stdMax != "")
- {
- if (double.Parse(ug.Rows[i].Cells[j].Value.ToString3()) < double.Parse(stdMin) || double.Parse(ug.Rows[i].Cells[j].Value.ToString3()) > double.Parse(stdMax))
- {
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Red;
- manageCount = manageCount + 1;
- txtLable = txtLable + columsKey + "元素不合。";
-
- }
- else
- {
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Empty;
- }
- }
- else if (stdMin != "" && stdMax == "")
- {
- if (double.Parse(ug.Rows[i].Cells[j].Value.ToString3()) < double.Parse(stdMin))
- {
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Red;
- manageCount = manageCount + 1;
- txtLable = txtLable + columsKey + "元素不合。";
- }
- else
- {
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Empty;
- }
- }
- else if (stdMin == "" && stdMax != "")
- {
- if (double.Parse(ug.Rows[i].Cells[j].Value.ToString3()) > double.Parse(stdMax))
- {
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Red;
- manageCount = manageCount + 1;
- txtLable = txtLable + columsKey + "元素不合。";
- }
- else
- {
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Empty;
- }
- }
- if (columsKey == "V" || columsKey == "Nb" || columsKey == "Ti" || columsKey == "Zr" || columsKey == "Ni" || columsKey == "Cr" || columsKey == "Mo" || columsKey == "Cu" || columsKey == "W" || columsKey == "Co")
- {
- //大于0.006的数据四舍六入后是0.01
- if (quoteValue < 0.006)
- {
- ug.Rows[i].Cells[j].Value = "<0.01";
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Empty;
- }
- else if (quoteValue >= 0.006 && quoteValue < 0.01)
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, 2).ToString("f" + 2);
- }
- //if (quoteValue < 0.01)
- //{
- // ug.Rows[i].Cells[j].Value = "<0.01";
- // ug.Rows[i].Cells[j].Appearance.BackColor = Color.Empty;
- //}
- else
- {
- if (stdMaxIndex > 2 || stdMinIndex > 2)
- {
- if (stdMaxIndex > stdMinIndex)
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, stdMaxIndex).ToString("f" + stdMaxIndex);
- }
- else
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, stdMinIndex).ToString("f" + stdMinIndex);
- }
- }
- }
- }
- else if (columsKey == "Pb" || columsKey == "Bi" || columsKey == "Sn" || columsKey == "As")
- {
- if (quoteValue < 0.0010)
- {
- ug.Rows[i].Cells[j].Value = "<0.0010";
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Empty;
- }
- }
- else if (columsKey == "Sb")
- {
- if (quoteValue < 0.0020)
- {
- ug.Rows[i].Cells[j].Value = "<0.0020";
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Empty;
- }
- }
- else if (columsKey == "B")
- {
- if (uRow.Cells["ContractNo"].Text.Contains("EXMPQ-180449E"))
- {
- this.ultraLabel27.Text = "B元素需报出实际值!";
- this.ultraLabel27.ForeColor = Color.Red;
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, 4).ToString("f" + 4);
- }
- else
- {
- if (quoteValue < 0.0005)
- {
- ug.Rows[i].Cells[j].Value = "<0.0005";
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Empty;
- }
- }
-
- }
- else
- {
- if (double.Parse(ug.Rows[i].Cells[j].Value.ToString3()) <= 0)
- {
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Red;
- txtLable = txtLable + columsKey + "元素修约后为负数。";
- }
- }
- }
- }
- }
- }
- this.ultraLabel11.Text = txtLable;
- }
- */
- /// <summary>
- /// 检查数据
- /// </summary>
- /// <param name="ultraGrid3"></param>
- private void checkUltraGrid(UltraGrid ug, UltraGridRow uRow)
- {
- manageCount = 0;
- DataTable chemDataTable = PublicServer.GetData("com.steering.lims.data.pipe.FrmChemDataManage.doQueryChemDetial", new object[] { uRow.Cells["CheckNo"].Text }, ob);
- if (chemDataTable.Rows.Count <= 0) return;
- // 定义元素精度字典
- Dictionary<string, int> elementPrecision = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase)
- {
- {"Fe", 2}, {"Co", 2}, {"Ta", 2}, {"Se", 2}, {"C", 2}, {"Si", 2},
- {"Mn", 2}, {"P", 3}, {"S", 3}, {"Ni", 2}, {"Cr", 2}, {"Cu", 2},
- {"As", 4}, {"Ti", 3}, {"V", 3}, {"Mo", 3}, {"B", 4}, {"W", 3},
- {"Al", 3}, {"Zn", 3}, {"Pb", 4}, {"Sn", 4}, {"Ca", 4}, {"Sb", 4},
- {"Nb", 3}, {"Bi", 4}, {"N", 4}, {"H", 5}, {"O", 4}, {"Zr", 3},
- {"Alt", 3}, {"Als", 3}
- };
- int quoteIndex = 0;//报出值位数
- int stdMinIndex = 0;//下限小数位数
- int stdMaxIndex = 0;//上限小数位数
- int stdIndex = 0;//报出位数
- string txtLable = "";
- this.ultraLabel27.Text = "";
- for (int i = 0; i < ug.Rows.Count; i++)
- {
- if (ug.Rows[i].Cells["SAMPLE_NO"].Text == "报出值")
- {
- string sampleNo = ug.Rows[i - 1].Cells["SAMPLE_NO"].Value.ToString();
- for (int j = 1; j < ug.DisplayLayout.Bands[0].Columns.Count; j++)
- {
- string columsKey = ug.DisplayLayout.Bands[0].Columns[j].Key;
- if (!chemDataTable.AsEnumerable().Any(p => p["SAMPLE_NO"].ToString() == sampleNo && p["CHEM_NAME"].ToString() == columsKey))
- continue;
- DataRow list = chemDataTable.AsEnumerable().First(p => p["SAMPLE_NO"].ToString() == sampleNo && p["CHEM_NAME"].ToString() == columsKey);
- string stdMax = list["STDMAX"].ToString();//元素上限值
- string stdMin = list["STDMIN"].ToString();//元素下限值
- double quoteValue = double.Parse(ug.Rows[i].Cells[j].Value.ToString3().Replace('<', '-'));//报出值
- quoteIndex = ug.Rows[i].Cells[j].Value.ToString3().Length - ug.Rows[i].Cells[j].Value.ToString3().IndexOf('.') - 1;//报出值小数位数
- stdMinIndex = stdMin.Length - stdMin.IndexOf('.') - 1;//下限值小数位数
- stdMaxIndex = stdMax.Length - stdMax.IndexOf('.') - 1;//上限值小数位数
- // 获取元素的精度,默认为2位
- int precision = elementPrecision.ContainsKey(columsKey) ? elementPrecision[columsKey] : 2;
- if (stdMax == "" && stdMin == "")//工艺无要求上下限
- {
- if (columsKey == "V" || columsKey == "Nb" || columsKey == "Ti" || columsKey == "Zr" ||
- columsKey == "Mo" || columsKey == "Ni" || columsKey == "Cr" || columsKey == "Cu" ||
- columsKey == "W" || columsKey == "Co")
- {
- // 使用固定精度修约
- if (quoteValue < 0.006)
- {
- ug.Rows[i].Cells[j].Value = "<0.01";
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Empty;
- }
- else
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, precision).ToString("f" + precision);
- }
- }
- else if (columsKey == "Pb" || columsKey == "Bi" || columsKey == "Sn" || columsKey == "As")
- {
- if (quoteValue < 0.0010)
- {
- ug.Rows[i].Cells[j].Value = "<0.0010";
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Empty;
- }
- else
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, precision).ToString("f" + precision);
- }
- }
- else if (columsKey == "Sb")
- {
- if (quoteValue < 0.0020)
- {
- ug.Rows[i].Cells[j].Value = "<0.0020";
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Empty;
- }
- else
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, precision).ToString("f" + precision);
- }
- }
- else if (columsKey == "B")
- {
- if (uRow.Cells["ContractNo"].Text.Contains("EXMPQ-180449E"))
- {
- this.ultraLabel27.Text = "B元素需报出实际值!";
- this.ultraLabel27.ForeColor = Color.Red;
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, precision).ToString("f" + precision);
- }
- else
- {
- if (quoteValue < 0.0005)
- {
- ug.Rows[i].Cells[j].Value = "<0.0005";
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Empty;
- }
- else
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, precision).ToString("f" + precision);
- }
- }
- }
- else if (columsKey == "C" || columsKey == "Si" || columsKey == "Mn" || columsKey == "Ni" ||
- columsKey == "Cr" || columsKey == "Mo" || columsKey == "Cu" || columsKey == "W" ||
- columsKey == "Co")
- {
- if (columsKey == "C" && uRow.Cells["SteelGrade"].Text.Contains("DNVGL SMLS 13Cr"))
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, 3).ToString("f" + 3);
- }
- else
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, precision).ToString("f" + precision);
- }
- if (double.Parse(ug.Rows[i].Cells[j].Value.ToString3()) <= 0)
- {
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Red;
- txtLable = txtLable + columsKey + "元素修约后为负数。";
- }
- }
- else if (columsKey == "P" || columsKey == "S" || columsKey == "Al" || columsKey == "Als")
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, precision).ToString("f" + precision);
- if (double.Parse(ug.Rows[i].Cells[j].Value.ToString3()) <= 0)
- {
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Red;
- txtLable = txtLable + columsKey + "元素修约后为负数。";
- }
- }
- else if (columsKey == "Ca" || columsKey == "Sn" || columsKey == "As")
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, precision).ToString("f" + precision);
- if (double.Parse(ug.Rows[i].Cells[j].Value.ToString3()) <= 0)
- {
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Red;
- txtLable = txtLable + columsKey + "元素修约后为负数。";
- }
- }
- else
- {
- // 默认使用固定精度修约
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, precision).ToString("f" + precision);
- }
- }
- else
- {
- //判断报出值是否不合
- if (columsKey != "Ca" && columsKey != "S")
- {
- if (stdMaxIndex >= stdMinIndex)//按工艺位数修约位数
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, stdMaxIndex).ToString("f" + stdMaxIndex);
- }
- else
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, stdMinIndex).ToString("f" + stdMinIndex);
- }
- }
- else if (columsKey == "C")
- {
- if (stdMaxIndex >= stdMinIndex)//按工艺位数修约位数
- {
- if (quoteIndex != stdMaxIndex)
- {
- txtLable = txtLable + columsKey + "元素工艺要求报出" + stdMaxIndex + "位";
- }
- }
- else
- {
- if (quoteIndex != stdMinIndex)
- {
- txtLable = txtLable + columsKey + "元素工艺要求报出" + stdMinIndex + "位";
- }
- }
- }
- else
- {
- // 使用固定精度修约
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, precision).ToString("f" + precision);
- }
- //判断符合工艺文件否
- if (stdMin != "" && stdMax != "")
- {
- if (double.Parse(ug.Rows[i].Cells[j].Value.ToString3()) < double.Parse(stdMin) || double.Parse(ug.Rows[i].Cells[j].Value.ToString3()) > double.Parse(stdMax))
- {
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Red;
- manageCount = manageCount + 1;
- txtLable = txtLable + columsKey + "元素不合。";
- }
- else
- {
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Empty;
- }
- }
- else if (stdMin != "" && stdMax == "")
- {
- if (double.Parse(ug.Rows[i].Cells[j].Value.ToString3()) < double.Parse(stdMin))
- {
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Red;
- manageCount = manageCount + 1;
- txtLable = txtLable + columsKey + "元素不合。";
- }
- else
- {
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Empty;
- }
- }
- else if (stdMin == "" && stdMax != "")
- {
- if (double.Parse(ug.Rows[i].Cells[j].Value.ToString3()) > double.Parse(stdMax))
- {
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Red;
- manageCount = manageCount + 1;
- txtLable = txtLable + columsKey + "元素不合。";
- }
- else
- {
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Empty;
- }
- }
- if (columsKey == "V" || columsKey == "Nb" || columsKey == "Ti" || columsKey == "Zr" ||
- columsKey == "Ni" || columsKey == "Cr" || columsKey == "Mo" || columsKey == "Cu" ||
- columsKey == "W" || columsKey == "Co")
- {
- //大于0.006的数据四舍六入后是0.01
- if (quoteValue < 0.006)
- {
- ug.Rows[i].Cells[j].Value = "<0.01";
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Empty;
- }
- else if (quoteValue >= 0.006 && quoteValue < 0.01)
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, precision).ToString("f" + precision);
- }
- else
- {
- if (stdMaxIndex > 2 || stdMinIndex > 2)
- {
- if (stdMaxIndex > stdMinIndex)
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, stdMaxIndex).ToString("f" + stdMaxIndex);
- }
- else
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, stdMinIndex).ToString("f" + stdMinIndex);
- }
- }
- else
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, precision).ToString("f" + precision);
- }
- }
- }
- else if (columsKey == "Pb" || columsKey == "Bi" || columsKey == "Sn" || columsKey == "As")
- {
- if (quoteValue < 0.0010)
- {
- ug.Rows[i].Cells[j].Value = "<0.0010";
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Empty;
- }
- else
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, precision).ToString("f" + precision);
- }
- }
- else if (columsKey == "Sb")
- {
- if (quoteValue < 0.0020)
- {
- ug.Rows[i].Cells[j].Value = "<0.0020";
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Empty;
- }
- else
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, precision).ToString("f" + precision);
- }
- }
- else if (columsKey == "B")
- {
- if (uRow.Cells["ContractNo"].Text.Contains("EXMPQ-180449E"))
- {
- this.ultraLabel27.Text = "B元素需报出实际值!";
- this.ultraLabel27.ForeColor = Color.Red;
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, precision).ToString("f" + precision);
- }
- else
- {
- if (quoteValue < 0.0005)
- {
- ug.Rows[i].Cells[j].Value = "<0.0005";
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Empty;
- }
- else
- {
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, precision).ToString("f" + precision);
- }
- }
- }
- else
- {
- // 使用固定精度修约
- ug.Rows[i].Cells[j].Value = Math.Round(quoteValue, precision).ToString("f" + precision);
- if (double.Parse(ug.Rows[i].Cells[j].Value.ToString3()) <= 0)
- {
- ug.Rows[i].Cells[j].Appearance.BackColor = Color.Red;
- txtLable = txtLable + columsKey + "元素修约后为负数。";
- }
- }
- }
- }
- }
- }
- this.ultraLabel11.Text = txtLable;
- }
- /// <summary>
- /// 查询委托基础信息
- /// </summary>
- /// <param name="uRow"></param>
- private void doQueryChemBaseInfo(UltraGridRow uRow)
- {
- List<PipeCheckconsignBaseinfoEntity> listSource = EntityHelper.GetData<PipeCheckconsignBaseinfoEntity>(
- "com.steering.lims.data.pipe.FrmChemDataManage.doQueryChemBaseInfo", new object[] { uRow.Cells["CheckNo"].Text, arrId }, this.ob);
- if (ultraTabControl1.SelectedTab.Key == "0")
- {
- pipeCheckconsignBaseinfoEntityBindingSource1.DataSource = listSource;
- }
- else if (ultraTabControl1.SelectedTab.Key == "1")
- {
- pipeCheckconsignBaseinfoEntityBindingSource3.DataSource = listSource;
- }
- }
- private void FrmChemDataManageNew_Shown(object sender, EventArgs e)
- {
- if (toolMenu == null || toolMenu.Toolbars == null) return;
- if (toolMenu.Toolbars[0].Tools.Exists("Audit"))
- {
- toolMenu.Toolbars[0].Tools["Audit"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("Delete"))
- {
- toolMenu.Toolbars[0].Tools["Delete"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("Print"))
- {
- toolMenu.Toolbars[0].Tools["Print"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("CancelAudit"))
- {
- toolMenu.Toolbars[0].Tools["CancelAudit"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("StdSteelNo"))
- {
- toolMenu.Toolbars[0].Tools["StdSteelNo"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- }
- private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
- {
- if (toolMenu == null || toolMenu.Toolbars == null) return;
- if (toolMenu.Toolbars[0].Tools.Exists("Save")) { toolMenu.Toolbars[0].Tools["Save"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 0 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("DeletePipeOutData")) { toolMenu.Toolbars[0].Tools["DeletePipeOutData"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 0 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("Audit")) { toolMenu.Toolbars[0].Tools["Audit"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 1 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("Print")) { toolMenu.Toolbars[0].Tools["Print"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 1 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("Delete")) { toolMenu.Toolbars[0].Tools["Delete"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 1 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("CheckStdSteel")) { toolMenu.Toolbars[0].Tools["CheckStdSteel"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 0 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("CancelAudit")) { toolMenu.Toolbars[0].Tools["CancelAudit"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 1 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("StdSteelNo")) { toolMenu.Toolbars[0].Tools["StdSteelNo"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 1 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (ultraTabControl1.SelectedTab.Key == "0")
- {
- ultraLabel10.Visible = true;
- comGradeType.Visible = true;
- chkRegTime.Text = "收样日期";
- }
- else
- {
- ultraLabel10.Visible = false;
- comGradeType.Visible = false;
- chkRegTime.Text = "录入日期";
- doQueryChem();
- }
- }
- private void ultraGrid3_CellChange(object sender, CellEventArgs e)
- {
- this.ultraGrid3.UpdateData();
- UltraGridRow uRow = this.ultraGrid3.ActiveRow;
- UltraGridRow uRow1 = this.ultraGrid1.ActiveRow;
- if (uRow == null || uRow1 == null) return;
- //可以手录全部元素
- //if ((e.Cell.Column.Key == "C" || e.Cell.Column.Key == "S" || e.Cell.Column.Key == "B" || e.Cell.Column.Key == "Ca" || e.Cell.Column.Key == "Bi" || e.Cell.Column.Key == "Als") && uRow.Cells["SAMPLE_NO"].Text != "报出值")
- //{
- if (!StringUtil.IsDouble(uRow.Cells[e.Cell.Column.Key].Value.ToString3()))
- {
- return;
- }
- ultraGrid3.Rows[uRow.Index + 1].Cells[e.Cell.Column.Key].Value = decimal.Parse(uRow.Cells[e.Cell.Column.Key].Value.ToString3());
- checkUltraGrid(ultraGrid3, uRow1);
- //}
-
- }
- private void ultraGrid7_CellChange(object sender, CellEventArgs e)
- {
- this.ultraGrid7.UpdateData();
- this.ultraGrid1.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- foreach (UltraGridRow row in this.ultraGrid3.Rows)
- {
- if (row.Cells["SAMPLE_NO"].Text == "报出值")
- {
- if (!StringUtil.IsDouble(ultraGrid7.ActiveRow.Cells[e.Cell.Column.Key].Value.ToString3())) return;
- row.Cells[e.Cell.Column.Key].Value = decimal.Parse(ultraGrid3.Rows[row.Index - 1].Cells[e.Cell.Column.Key].Value.ToString3()) + decimal.Parse(ultraGrid7.ActiveRow.Cells[e.Cell.Column.Key].Value.ToString3());
- if (double.Parse(row.Cells[e.Cell.Column.Key].Value.ToString3()) <= 0)
- {
- ultraLabel11.Text = ultraLabel11.Text + e.Cell.Column.Key + "异常 ";
- }
- }
- }
- checkUltraGrid(ultraGrid3, uRow);
- }
- private void chkSampleNo_CheckedChanged(object sender, EventArgs e)
- {
- this.txtSampleNo.Enabled = this.chkSampleNo.Checked;
- }
- private void ultraTextEditor5_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- UltraGridRow uRow = this.ultraGrid2.ActiveRow;
- if (uRow.Cells["CraftFileNo"].Text.Trim() == "" || uRow.Cells["CraftPath"].Text.Trim() == "")
- {
- return;
- }
- PublicPipeAndOutdec.ViewCarft_No(uRow.Cells["CraftPath"].Text.Trim());
- }
- private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- UltraGridRow uRow = this.ultraGrid5.ActiveRow;
- if (uRow.Cells["CraftFileNo"].Text.Trim() == "" || uRow.Cells["CraftPath"].Text.Trim() == "")
- {
- return;
- }
- PublicPipeAndOutdec.ViewCarft_No(uRow.Cells["CraftPath"].Text.Trim());
- }
- }
- }
|