| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912 |
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Format;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.Lims.Port.数据管理.实体类;
- 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.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace Core.StlMes.Client.Lims.Port
- {
- public partial class FrmMchBatchSampleNew : FrmBase
- {
- public FrmMchBatchSampleNew()
- {
- InitializeComponent();
- }
- private string plineCode = "";//产线
- List<CraftSamplingMEntity> dtPlanM = null;//检验计划主信息
- List<CraftSamplingDetailEntity> dtPlanDetial = null;//检验计划从信息
- List<CraftSamplingMEntity> dtPlanM1 = null;//分批详细方案
- int minBatchNum = 0;//最小分批数量
- private Color color1 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
- private Color color2 = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
- private string batchNoZ = "";//性能批号产线标识
- private void FrmMilBatchSampleNew_Load(object sender, EventArgs e)
- {
- 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<PlnZyJgxMEntity>(this.ultraGrid1.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PlnZyJgxMEntity>(this.ultraGrid2.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PortMchBatchSampleResultEntity>(this.ultraGrid3.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PortMchBatchSampleResultEntity>(this.ultraGrid8.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PlnZyJgxMEntity>(this.ultraGrid5.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PlnZyJgxMEntity>(this.ultraGrid6.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PortMchBatchSampleResultEntity>(this.ultraGrid7.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PlnZyJgxMEntity>(this.ultraGrid9.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PlnZyJgxMEntity>(this.ultraGrid10.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PipeCheckconsignBaseinfoEntity>(this.ultraGrid12.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PlnZyJgxMEntity>(this.ultraGrid13.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PipeCheckconsignNoqualifiedEntity>(this.ultraGrid15.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PipeCheckconsignNoqualifiedEntity>(this.ultraGrid16.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PortMchBatchSampleResultEntity>(this.ultraGrid17.DisplayLayout.Bands[0]);
-
- EntityHelper.ShowGridCaption<PipeCheckconsignNoqualifiedEntity>(this.ultraGrid19.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PipeCheckconsignNoqualifiedEntity>(this.ultraGrid20.DisplayLayout.Bands[0]);
- plineCode = PublicPort.GetPCode(this.ValidDataPurviewIds, ob);
- cmbSampleType.SelectedIndex = 0;
- initPostion();
- }
- /// <summary>
- /// 加载基础取样位置
- /// </summary>
- private void initPostion()
- {
- DataTable ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryPostion", new object[] { }, ob);
- if (ds != null && ds.Rows.Count > 0)
- {
- cmbPostion.DataSource = ds;
- cmbPostion.ValueMember = "BASECODE";
- cmbPostion1.DataSource = ds;
- cmbPostion1.ValueMember = "BASECODE";
- cmbPiecePostion.DataSource = ds;
- cmbPiecePostion.ValueMember = "BASECODE";
- }
- }
- /// <summary>
- /// 重写基类方法
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- doQueryPlan();
- break;
- case "QueryRepeate":
- doQueryRepeate();
- break;
- case "GetSample":
- getSample();
- break;
- case"ComfrimComplete":
- comfrimComplete();
- break;
- case "CancelGetSample":
- cancelGetSample();
- break;
- case "Confirm":
- confirm();
- break;
- case "CancelConfirm":
- cancelConfirm();
- break;
- case "ReGetSample":
- reGetSample();
- break;
- case "CancelReGetSample":
- cancelReGetSample();
- break;
- case "RepeateFrim":
- repeateFrim();
- break;
- case "CancelRepeateFrim":
- cancelRepeateFrim();
- break;
- case "Print":
- printTrust();
- break;
- case "PrintLable":
- printLable();
- break;
- case "PrintReLable":
- printReLable();
- break;
- case "PrintRe":
- printReTrust();
- break;
- case "Close":
- close();
- break;
- }
- }
-
-
-
- /// <summary>
- /// 撤销复取样
- /// </summary>
- private void cancelReGetSample()
- {
- this.ultraGrid15.UpdateData();
- this.ultraGrid17.UpdateData();
- UltraGridRow uRow = this.ultraGrid15.ActiveRow;
- List<PortMchBatchSampleResultEntity> lists = portMchBatchSampleResultEntityBindingSource2.DataSource as List<PortMchBatchSampleResultEntity>;
- if (uRow == null || lists.Count <= 0)
- {
- return;
- }
- PipeCheckconsignNoqualifiedEntity milPlans = (PipeCheckconsignNoqualifiedEntity)uRow.ListObject;
- string milPlanEntity = JSONFormat.Format(milPlans);
- List<string> portMilEntity = lists.Where(p => p.ResamplePipeLenA != "" || p.ResamplePipeLenB != "" || p.ResamplePipeLenC != "" || p.ResamplePipeLenD != "" || p.ResamplePipeLenM != "" || p.ResamplePipeLenE != "" || p.ResamplePipeLenF != "" || p.ResamplePipeLenP != "" || p.ResamplePipeLenQ != "").Select(JSONFormat.Format).ToList();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.port.vrp.FrmMchBatchSampleNew";
- ccp.MethodName = "cancelReGetSample";
- ccp.ServerParams = new object[] { milPlanEntity, portMilEntity };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("撤销成功!"))
- {
- doQueryRepeate();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 复取样
- /// </summary>
- private void reGetSample()
- {
- this.ultraGrid15.UpdateData();
- this.ultraGrid17.UpdateData();
- UltraGridRow uRow = this.ultraGrid15.ActiveRow;
- List<PortMchBatchSampleResultEntity> lists = portMchBatchSampleResultEntityBindingSource2.DataSource as List<PortMchBatchSampleResultEntity>;
- if (uRow == null || lists.Count <= 0)
- {
- return;
- }
- if (lists.Any(p => p.Chk == true && p.ResamplePipeLenA == "" && p.ResamplePipeLenB == "" && p.ResamplePipeLenC == "" && p.ResamplePipeLenD == "" && p.ResamplePipeLenE == "" && p.ResamplePipeLenF == "" && p.ResamplePipeLenP == "" && p.ResamplePipeLenQ == "" && p.ResamplePipeLenM == ""))
- {
- MessageUtil.ShowTips("还有已选做样管未输入样管长度的管材,不允许进行复取样完成!");
- return;
- }
- if (lists.Any(p => p.Chk == true && !StringUtil.IsInt32(p.ResamplePipeLenA) && !StringUtil.IsInt32(p.ResamplePipeLenB) && !StringUtil.IsInt32(p.ResamplePipeLenC) && !StringUtil.IsInt32(p.ResamplePipeLenD) && !StringUtil.IsInt32(p.ResamplePipeLenE) && !StringUtil.IsInt32(p.ResamplePipeLenF) && !StringUtil.IsInt32(p.ResamplePipeLenP) && !StringUtil.IsInt32(p.ResamplePipeLenQ)&& !StringUtil.IsInt32(p.ResamplePipeLenM)))
- {
- MessageUtil.ShowTips("样管长度单位为毫米,请输入整数!");
- return;
- }
- PipeCheckconsignNoqualifiedEntity milPlans = (PipeCheckconsignNoqualifiedEntity)uRow.ListObject;
- string milPlanEntity = JSONFormat.Format(milPlans);
- List<string> portMilEntity = lists.Where(p => p.Chk).Select(JSONFormat.Format).ToList();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.port.vrp.FrmMchBatchSampleNew";
- ccp.MethodName = "reGetSample";
- ccp.ServerParams = new object[] { milPlanEntity, portMilEntity, UserInfo.GetUserName(), UserInfo.GetUserGroup(), UserInfo.GetUserOrder() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("复取样完成!"))
- {
- doQueryRepeate();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 委托完成
- /// </summary>
- private void comfrimComplete()
- {
- this.ultraGrid1.UpdateData();
- UltraGridRow row = this.ultraGrid1.ActiveRow;
- if (row == null) return;
- PlnZyJgxMEntity planEntity = (PlnZyJgxMEntity)row.ListObject;
- string planTity = JSONFormat.Format(planEntity);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.port.vrp.FrmMchBatchSampleNew";
- ccp.MethodName = "comfrimComplete";
- ccp.ServerParams = new object[] { planTity };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("委托完成!"))
- {
- doQueryPlan();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 查询复取样信息
- /// </summary>
- private void doQueryRepeate()
- {
- string startTime = "";
- string endTim = "";
- string lotNo = "";
- string judgeNo = "";
- if (this.chkRegTime.Checked)
- {
- startTime = this.RegStartTime.Value.ToString();
- endTim = this.RegEndTime.Value.ToString();
- }
- if (chkLotNo.Checked && this.txtLotNo.Text.Trim() != "")
- {
- lotNo = this.txtLotNo.Text;
- }
- if (chkJudgeNo.Checked && this.txtJudgeNo.Text.Trim() != "")
- {
- judgeNo = this.txtJudgeNo.Text;
- }
- ArrayList parm = new ArrayList();
- parm.Add(startTime);
- parm.Add(endTim);
- parm.Add(lotNo);
- parm.Add(judgeNo);
- if (ultraTabControl1.SelectedTab.Key == "4")
- {
- parm.Add("0");
- }
- else if (ultraTabControl1.SelectedTab.Key == "5")
- {
- parm.Add("1");
- }
- List<PipeCheckconsignNoqualifiedEntity> listSource = EntityHelper.GetData<PipeCheckconsignNoqualifiedEntity>(
- "com.steering.mes.port.mil.FrmMilBatchSampleNew.doQueryRepeate", new object[] { parm, plineCode }, this.ob);
- if (ultraTabControl1.SelectedTab.Key == "4")
- {
- pipeCheckconsignNoqualifiedEntityBindingSource.DataSource = listSource;
- }
- else if (ultraTabControl1.SelectedTab.Key == "5")
- {
- pipeCheckconsignNoqualifiedEntityBindingSource3.DataSource = listSource;
- }
- }
- /// <summary>
- /// 复取样委托
- /// </summary>
- private void repeateFrim()
- {
- this.ultraGrid19.UpdateData();
- this.ultraGrid20.UpdateData();
- UltraGridRow uRow = this.ultraGrid19.ActiveRow;
- if (uRow == null) return;
- PipeCheckconsignNoqualifiedEntity pipeCheckEntity = (PipeCheckconsignNoqualifiedEntity)uRow.ListObject;
- string pipeTity = JSONFormat.Format(pipeCheckEntity);
- List<List<string>> parmList = new List<List<string>>();
- foreach (UltraGridRow row in this.ultraGrid21.Rows)
- {
- List<string> list = new List<string>();
- list.Add(row.Cells["PHY_BATCH_NO"].Text);
- list.Add(row.Cells["MAT_NO"].Text);
- list.Add(row.Cells["SAMPLE_PIPE_LEN"].Text);
- list.Add(row.Cells["SAMPLE_POSTION"].Text);
- for (int j = 5; j < dataTable5.Columns.Count; j++)
- {
- if (row.Cells[j].Value == "√")
- {
- list.Add(row.Cells[j].Column.Key);
- }
- }
- parmList.Add(list);
- }
- List<List<string>> batchList = parmList.GroupBy(p => p[0]).Select(p => p.FirstOrDefault()
- ).ToList();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.port.vrp.FrmMchBatchSampleNew";
- ccp.MethodName = "repeateFrim";
- ccp.ServerParams = new object[] { pipeTity, parmList, batchList, UserInfo.GetUserName(), UserInfo.GetDepartment() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("复取样委托成功!"))
- {
- doQueryRepeate();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 撤销复取样委托
- /// </summary>
- private void cancelRepeateFrim()
- {
- this.ultraGrid19.UpdateData();
- UltraGridRow uRow = this.ultraGrid19.ActiveRow;
- if (uRow == null) return;
- PipeCheckconsignNoqualifiedEntity pipeNoTity = (PipeCheckconsignNoqualifiedEntity)uRow.ListObject;
- string pipeNoEntity = JSONFormat.Format(pipeNoTity);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.port.vrp.FrmMchBatchSampleNew";
- ccp.MethodName = "cancelRepeateFrim";
- ccp.ServerParams = new object[] { pipeNoEntity };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("撤销复取样委托成功!"))
- {
- doQueryRepeate();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 打印复样标签
- /// </summary>
- private void printReLable()
- {
- this.ultraGrid19.UpdateData();
- UltraGridRow uRow = this.ultraGrid19.ActiveRow;
- if (uRow == null) return;
- string checkNo = "F" + uRow.Cells["CheckNo"].Text.Trim();
- string strurl = "";
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepEntrustLabel.cpt" + "&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();
- }
- /// <summary>
- /// 标签
- /// </summary>
- private void printLable()
- {
- this.ultraGrid12.UpdateData();
- UltraGridRow uRow = this.ultraGrid12.ActiveRow;
- if (uRow == null) return;
- string checkNo = uRow.Cells["CheckNo"].Text.Trim();
- string strurl = "";
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepEntrustLabel.cpt&&format=pdf&__embed__=true" + "&CHECK_NO=" + checkNo + "&JUDGE_STOVE_NO=" + uRow.Cells["HeatNo"].Text.Trim() + "&PROCESS_CODE=F";
- 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();
- }
- /// <summary>
- /// 打印
- /// </summary>
- private void printTrust()
- {
- this.ultraGrid12.UpdateData();
- UltraGridRow uRow = this.ultraGrid12.ActiveRow;
- if (uRow == null) return;
- this.ultraGrid13.UpdateData();
- UltraGridRow uRow2 = this.ultraGrid13.ActiveRow;
- if (uRow2 == null) return;
- string checkNo = uRow.Cells["CheckNo"].Text.Trim();
- string orderNo = uRow2.Cells["OrderNo"].Text.Trim();
- string strurl = "";
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepLimsPortCheckConsignOrder.cpt&&format=pdf&__embed__=true" + "&CHECK_NO=" + checkNo + "&orderNo=" + orderNo;
- 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();
- }
- /// <summary>
- /// 打印复样委托单
- /// </summary>
- private void printReTrust()
- {
- this.ultraGrid19.UpdateData();
- UltraGridRow uRow = this.ultraGrid19.ActiveRow;
- if (uRow == null) return;
- this.ultraGrid20.UpdateData();
- UltraGridRow uRow2 = this.ultraGrid20.ActiveRow;
- if (uRow2 == null) return;
- string checkNo = "F" + uRow.Cells["CheckNo"].Text.Trim();
-
- string strurl = "";
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepLimsPortCheckConsignOrder.cpt&&format=pdf&__embed__=true" + "&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();
- }
- private void close()
- {
- this.Close();
- }
- /// <summary>
- /// 取样完成
- /// </summary>
- private void getSample()
- {
- this.ultraGrid1.UpdateData();
- this.ultraGrid3.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- List<PortMchBatchSampleResultEntity> lists = portMchBatchSampleResultEntityBindingSource.DataSource as List<PortMchBatchSampleResultEntity>;
- if (uRow == null || lists.Count <= 0)
- {
- return;
- }
- if (lists.Any(p => p.Chk == true && p.SamplePipeLenA == "" && p.SamplePipeLenB == "" && p.SamplePipeLenC == "" && p.SamplePipeLenD == "" && p.SamplePipeLenM == "" && p.SamplePipeLenE == "" && p.SamplePipeLenF == "" && p.SamplePipeLenP == "" && p.SamplePipeLenQ == ""))
- {
- MessageUtil.ShowTips("还有已选做样管未输入样管长度的管材,不允许进行取样完成!");
- return;
- }
- if (lists.Any(p => p.Chk == true && !StringUtil.IsInt32(p.SamplePipeLenA) && !StringUtil.IsInt32(p.SamplePipeLenB) && !StringUtil.IsInt32(p.SamplePipeLenC) && !StringUtil.IsInt32(p.SamplePipeLenD) && !StringUtil.IsInt32(p.SamplePipeLenM) && !StringUtil.IsInt32(p.SamplePipeLenE) && !StringUtil.IsInt32(p.SamplePipeLenF) && !StringUtil.IsInt32(p.SamplePipeLenP) && !StringUtil.IsInt32(p.SamplePipeLenQ)))
- {
- MessageUtil.ShowTips("样管长度单位为毫米,请输入整数!");
- return;
- }
- PlnZyJgxMEntity milPlans = (PlnZyJgxMEntity)uRow.ListObject;
- string milPlanEntity = JSONFormat.Format(milPlans);
- List<string> portMilEntity = lists.Where(p => p.Chk).Select(JSONFormat.Format).ToList();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.port.vrp.FrmMchBatchSampleNew";
- ccp.MethodName = "getSample";
- ccp.ServerParams = new object[] { milPlanEntity, portMilEntity, UserInfo.GetUserName(), UserInfo.GetUserGroup(), UserInfo.GetUserOrder(), this.cmbSampleType.Value.ToString() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("取样完成!"))
- {
- doQueryPlan();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 撤销取样完成
- /// </summary>
- private void cancelGetSample()
- {
- this.ultraGrid5.UpdateData();
- UltraGridRow uRow = this.ultraGrid5.ActiveRow;
- UltraGridRow row = this.ultraGrid8.ActiveRow;
- if (uRow == null || row == null) return;
- PlnZyJgxMEntity milPlans = (PlnZyJgxMEntity)uRow.ListObject;
- string milPlanEntity = JSONFormat.Format(milPlans);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.port.vrp.FrmMchBatchSampleNew";
- ccp.MethodName = "cancelGetSample";
- ccp.ServerParams = new object[] { milPlanEntity,row.Cells["PHY_BATCH_NO"].Text };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("撤销成功!"))
- {
- doQueryPlan();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
-
-
- /// <summary>
- /// 确认委托
- /// </summary>
- private void confirm()
- {
- this.ultraGrid9.UpdateData();
- this.ultraGrid10.UpdateData();
- this.ultraGrid11.UpdateData();
- this.ultraGrid18.UpdateData();
- UltraGrid ug = null;
- DataTable dataTable = null;
- string craftSource = "";
- if (ultraTabControl3.SelectedTab.Key == "0")
- {
- ug = ultraGrid11;
- dataTable = dataTable3;
- craftSource = "0";
- }
- else if (ultraTabControl3.SelectedTab.Key == "1")
- {
- ug = ultraGrid18;
- dataTable = dataTable5;
- craftSource = "1";
- }
- else if (ultraTabControl3.SelectedTab.Key == "2")
- {
- ug = ultraGrid23;
- dataTable = dataTable7;
- craftSource = "2";
- }
- UltraGridRow uRow = ultraGrid9.ActiveRow;
- if (uRow == null) return;
- // List<CraftOrdDesignStdCicEntity> chemSource = EntityHelper.GetData<CraftOrdDesignStdCicEntity>(
- //"com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryChem", new object[] { uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text.Substring(0, 6) }, this.ob);//查询成分详细信息
- // List<CraftOrdDesignStdPicEntity> phySource = EntityHelper.GetData<CraftOrdDesignStdPicEntity>(
- //"com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryPhy", new object[] { uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text.Substring(0, 6) }, this.ob);//查询理化详细信息
- PlnZyJgxMEntity milTity = (PlnZyJgxMEntity)uRow.ListObject;
- milTity.CraftSource = craftSource;
- string milEntity = JSONFormat.Format(milTity);
- List<List<string>> parmList = new List<List<string>>();
- foreach(UltraGridRow row in ug.Rows)
- {
- int m = 0;
- List<string> list = new List<string>();
- list.Add(row.Cells["PHY_BATCH_NO"].Text);
- list.Add(row.Cells["MAT_NO"].Text);
- list.Add(row.Cells["SAMPLE_PIPE_LEN"].Text);
- list.Add(row.Cells["SAMPLE_POSTION"].Text);
- for (int j = 5; j < dataTable.Columns.Count; j++)
- {
- if (row.Cells[j].Value == "√")
- {
- list.Add(row.Cells[j].Column.Key);
- m = m + 1;
- }
- }
- if (m > 0)
- {
- parmList.Add(list);
- }
-
- }
- List<List<string>> batchList = parmList.GroupBy(p => p[0]).Select(p => p.FirstOrDefault()
- ).ToList();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.port.vrp.FrmMchBatchSampleNew";
- ccp.MethodName = "confirm";
- ccp.ServerParams = new object[] { milEntity, parmList, batchList, UserInfo.GetUserName(), UserInfo.GetDepartment() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("委托成功!"))
- {
- doQueryPlan();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
-
- /// <summary>
- /// 取消确认
- /// </summary>
- private void cancelConfirm()
- {
- this.ultraGrid14.UpdateData();
- UltraGridRow uRow = this.ultraGrid12.ActiveRow;
- if (uRow == null) return;
- PipeCheckconsignBaseinfoEntity milTity = (PipeCheckconsignBaseinfoEntity)uRow.ListObject;
- string milPlanEntity = JSONFormat.Format(milTity);
-
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.port.vrp.FrmMchBatchSampleNew";
- ccp.MethodName = "cancelConfirm";
- ccp.ServerParams = new object[] { milPlanEntity };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("撤销委托成功!"))
- {
- doQueryPlan();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 查询炉计划
- /// </summary>
- private void doQueryPlan()
- {
- string startTime = "";
- string endTim = "";
- string lotNo = "";
- string judgeNo = "";
- List<PlnZyJgxMEntity> listSource = null;
- List<PipeCheckconsignBaseinfoEntity> listSource1 = null;
- if (this.chkRegTime.Checked)
- {
- startTime = this.RegStartTime.Value.ToString();
- endTim = this.RegEndTime.Value.ToString();
- }
- if (chkLotNo.Checked && this.txtLotNo.Text.Trim() != "")
- {
- lotNo = this.txtLotNo.Text;
- }
- if (chkJudgeNo.Checked && this.txtJudgeNo.Text.Trim() != "")
- {
- judgeNo = this.txtJudgeNo.Text;
- }
- ArrayList parm = new ArrayList();
- parm.Add(startTime);
- parm.Add(endTim);
- parm.Add(lotNo);
- parm.Add(judgeNo);
- if (this.ultraTabControl1.SelectedTab.Key == "0")
- {
- parm.Add("0");
- listSource = EntityHelper.GetData<PlnZyJgxMEntity>(
- "com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryPlan", new object[] { parm, plineCode }, this.ob);
- }
- else if (this.ultraTabControl1.SelectedTab.Key == "1")
- {
- parm.Add("2");
- listSource = EntityHelper.GetData<PlnZyJgxMEntity>(
- "com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryPlan", new object[] { parm, plineCode }, this.ob);
- }
- else if (this.ultraTabControl1.SelectedTab.Key == "2")
- {
- parm.Add("2");
- listSource = EntityHelper.GetData<PlnZyJgxMEntity>(
- "com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryPlan", new object[] { parm, plineCode }, this.ob);
- }
- else if (this.ultraTabControl1.SelectedTab.Key == "3")
- {
- parm.Add("3");
- listSource1= EntityHelper.GetData<PipeCheckconsignBaseinfoEntity>(
- "com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryPipeBaseInfo", new object[] { parm, plineCode }, this.ob);
- }
-
- if (this.ultraTabControl1.SelectedTab.Key == "0")
- {
- plnZyJgxMEntityBindingSource1.Clear();
- portMchBatchSampleResultEntityBindingSource.Clear();
- plnZyJgxMEntityBindingSource.DataSource = listSource;
- }
- else if (this.ultraTabControl1.SelectedTab.Key == "1")
- {
- plnZyJgxMEntityBindingSource3.Clear();
- portMchBatchSampleResultEntityBindingSource1.Clear();
- dataTable2.Clear();
- plnZyJgxMEntityBindingSource2.DataSource = listSource;
- }
- else if (this.ultraTabControl1.SelectedTab.Key == "2")
- {
- plnZyJgxMEntityBindingSource5.Clear();
- dataTable3.Clear();
- plnZyJgxMEntityBindingSource4.DataSource = listSource;
- }
- else if (this.ultraTabControl1.SelectedTab.Key == "3")
- {
- plnZyJgxMEntityBindingSource6.Clear();
- dataTable4.Clear();
- pipeCheckconsignBaseinfoEntityBindingSource.DataSource = listSource1;
- }
-
- }
- 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.txtLotNo.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)
- {
- this.ultraGrid1.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
-
- doQueryBasePlan(uRow);
- doQueryRack(uRow);
- }
- private void initBindTable(UltraGridRow row)
- {
- List<PortMchBatchSampleResultEntity> lists = portMchBatchSampleResultEntityBindingSource1.DataSource as List<PortMchBatchSampleResultEntity>;
- DataTable ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryHeadNum", new object[] { row.Cells["HeatPlanNo"].Text, row.Cells["JudgeStoveNo"].Text }, ob);
- dataTable2.Rows.Clear();
- if (lists == null || lists.Count() <= 0) return;
- foreach (var list in lists.Where(p => p.PhyBatchNo != "").GroupBy(p => p.PhyBatchNo))
- {
- DataRow newRow;
- newRow = dataTable2.NewRow();
- newRow["PHY_BATCH_NO"] = list.Key;
- newRow["START_SEQ"] = list.Min(p => int.Parse(p.Seq));
- newRow["END_SEQ"] = list.Max(p => int.Parse(p.Seq));
- newRow["NUM"] = list.Count();
- newRow["SAMPLE_NUM"] = list.Count(p => p.SamplePipeLenA != "" || p.SamplePipeLenB != "" || p.SamplePipeLenC != "" || p.SamplePipeLenD != "" || p.SamplePipeLenM != "" || p.SamplePipeLenE != "" || p.SamplePipeLenF != "" || p.SamplePipeLenP != "" || p.SamplePipeLenQ != "");
- if (ds.Rows.Count > 0)
- {
- for (int i = 0; i < ds.Rows.Count; i++)
- {
- if (ds.Rows[i]["BATCH_NO"].ToString() == list.Key)
- {
- newRow["HEAD_NUM"] = ds.Rows[i]["ACOUNT"].ToString();
- }
- }
- }
- dataTable2.Rows.Add(newRow);
- }
- ultraGrid8.Update();
- }
-
- /// <summary>
- /// 查询炉计划基础信息
- /// </summary>
- /// <param name="row"></param>
- private void doQueryBasePlan(UltraGridRow row)
- {
- List<PlnZyJgxMEntity> listSource = null;
-
- if (this.ultraTabControl1.SelectedTab.Key == "0")
- {
- listSource = EntityHelper.GetData<PlnZyJgxMEntity>(
- "com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryBasePlan", new object[] { row.Cells["HeatPlanNo"].Text, row.Cells["ZyBatchId"].Text, row.Cells["JudgeStoveNo"].Text }, this.ob);
- plnZyJgxMEntityBindingSource1.DataSource = listSource;
- }
- else if (this.ultraTabControl1.SelectedTab.Key == "1")
- {
- listSource = EntityHelper.GetData<PlnZyJgxMEntity>(
- "com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryBasePlan", new object[] { row.Cells["HeatPlanNo"].Text, row.Cells["ZyBatchId"].Text, row.Cells["JudgeStoveNo"].Text }, this.ob);
- plnZyJgxMEntityBindingSource3.DataSource = listSource;
- }
- else if (this.ultraTabControl1.SelectedTab.Key == "2")
- {
- listSource = EntityHelper.GetData<PlnZyJgxMEntity>(
- "com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryBasePlan", new object[] { row.Cells["HeatPlanNo"].Text, row.Cells["ZyBatchId"].Text, row.Cells["JudgeStoveNo"].Text }, this.ob);
- plnZyJgxMEntityBindingSource5.DataSource = listSource;
- }else if(this.ultraTabControl1.SelectedTab.Key == "3")
- {
- listSource = EntityHelper.GetData<PlnZyJgxMEntity>(
- "com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryBasePlan", new object[] { row.Cells["HeatPlanNo"].Text, row.Cells["LotNo"].Text, row.Cells["HeatNo"].Text }, this.ob);
- plnZyJgxMEntityBindingSource6.DataSource = listSource;
- }
- }
- /// <summary>
- /// 查询管号队列
- /// </summary>
- /// <param name="row"></param>
- private void doQueryRack(UltraGridRow row)
- {
- List<PortMchBatchSampleResultEntity> listSource = null;
- if (this.ultraTabControl1.SelectedTab.Key == "0")
- {
- listSource = EntityHelper.GetData<PortMchBatchSampleResultEntity>(
- "com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryRackQ", new object[] { row.Cells["HeatPlanNo"].Text, row.Cells["JudgeStoveNo"].Text }, this.ob);
- portMchBatchSampleResultEntityBindingSource.DataSource = listSource;
- }
- else if (this.ultraTabControl1.SelectedTab.Key == "1")
- {
- listSource = EntityHelper.GetData<PortMchBatchSampleResultEntity>(
- "com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryRack", new object[] { row.Cells["HeatPlanNo"].Text, row.Cells["JudgeStoveNo"].Text }, this.ob);
- List<PortMchBatchSampleResultEntity> lists = listSource as List<PortMchBatchSampleResultEntity>;
- lists.Where(p => p.IsSamplePipe == "1").ToList().ForEach(p => p.Chk = true);
- portMchBatchSampleResultEntityBindingSource1.DataSource = lists;
- initBindTable(row);
-
- }
-
- }
-
- private void ultraGrid3_CellChange(object sender, CellEventArgs e)
- {
- this.ultraGrid3.UpdateData();
- dataTable1.Rows.Clear();
- ultraGrid3.Update();
- ultraGrid3.UpdateData();
- List<PortMchBatchSampleResultEntity> lists = portMchBatchSampleResultEntityBindingSource.DataSource as List<PortMchBatchSampleResultEntity>;
- if (lists == null || lists.Count() <= 0) return;
- //foreach (var list in lists.Where(p => p.PhyBatchNo != "").GroupBy(p => p.PhyBatchNo))
- //{
- // DataRow newRow;
- // newRow = dataTable1.NewRow();
- // newRow["PHY_BATCH_NO"] = list.Key;
- // newRow["START_SEQ"] = list.Min(p => int.Parse(p.Seq));
- // newRow["END_SEQ"] = list.Max(p => int.Parse(p.Seq));
- // newRow["NUM"] = list.Count();
- // newRow["SAMPLE_NUM"] = list.Count(p => p.SamplePipeLenA != "" || p.SamplePipeLenB != "" || p.SamplePipeLenC != "" || p.SamplePipeLenD != "" || p.SamplePipeLenM != "" || p.SamplePipeLenE != "" || p.SamplePipeLenF != "" || p.SamplePipeLenP != "" || p.SamplePipeLenQ != "");
- // newRow["HEAD_NUM"] = list.Sum(p => (p.SamplePipeLenA == "" ? 0 : 1) + (p.SamplePipeLenB == "" ? 0 : 1) + (p.SamplePipeLenC == "" ? 0 : 1) + (p.SamplePipeLenD == "" ? 0 : 1) + (p.SamplePipeLenM == "" ? 0 : 1) + (p.SamplePipeLenE == "" ? 0 : 1) + (p.SamplePipeLenF == "" ? 0 : 1) + (p.SamplePipeLenP == "" ? 0 : 1) + (p.SamplePipeLenQ == "" ? 0 : 1));
- // dataTable1.Rows.Add(newRow);
- //}
-
- //ultraGrid4.Update();
- if (e != null && (e.Cell.Column.Key == "SamplePipeLenA" || e.Cell.Column.Key == "SamplePipeLenB" || e.Cell.Column.Key == "SamplePipeLenC" || e.Cell.Column.Key == "SamplePipeLenD" || e.Cell.Column.Key == "SamplePipeLenM"))
- {
- if (e.Cell.Row.Cells["Chk"].Value.ToString() == "False")
- {
- MessageUtil.ShowTips("输入长度前,请勾选样管!");
- return;
- }
- }
- if (e != null && e.Cell.Column.Key == "Chk")
- {
- if (e.Cell.Value.ToString() == "True")
- {
- e.Cell.Row.RowSelectorAppearance.BackColor = Color.Red;
- txtMatNo.Text = e.Cell.Row.Cells["MatNo"].Text;
- }
- else
- {
- e.Cell.Row.RowSelectorAppearance.BackColor = Color.Empty;
- }
- }
- }
- private void ultraGrid5_AfterRowActivate(object sender, EventArgs e)
- {
- this.ultraGrid5.UpdateData();
- UltraGridRow uRow = this.ultraGrid5.ActiveRow;
- if (uRow == null) return;
- doQueryRack(uRow);
- doQueryBasePlan(uRow);
- }
- DataTable dtChem = new DataTable();
- DataTable dtPhy = new DataTable();
- private void ultraGrid9_AfterRowActivate(object sender, EventArgs e)
- {
- this.ultraGrid9.UpdateData();
- UltraGridRow uRow = this.ultraGrid9.ActiveRow;
- if (uRow == null) return;
- doQuerySampleRack(uRow,"0");//查询正常样管信息
- doQuerySampleRack(uRow,"1");//查询首日检样管信息
- doQuerySampleRack(uRow, "2");//查询生产加样样管信息
- doQueryBasePlan(uRow);
- doQueryPhyChem(uRow,"0");//查询正常样成分、理化项目明细
- doQueryPhyChem(uRow,"1");//查询首日检成分、理化项目明细
- doQueryPhyChem(uRow, "2");//查询生产加样成分、理化项目明细
- //initBaseInfo(uRow);//加载已委托检验单
-
- }
- private void initBaseInfo(UltraGridRow row)
- {
- DataTable ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.initBaseInfo", new object[] { row.Cells["JudgeStoveNo"].Text, "F" }, ob);
- if (ds != null && ds.Rows.Count > 0)
- {
- //cmbCheckNo.DataSource = ds;
- //cmbCheckNo.ValueMember = "CHECK_NO_VALUE";
- }
- }
- private void ultraGrid12_AfterRowActivate(object sender, EventArgs e)
- {
- this.ultraGrid12.UpdateData();
- UltraGridRow uRow = this.ultraGrid12.ActiveRow;
- if (uRow == null) return;
- doQueryBasePlan(uRow);
- doQuerySampleNo(uRow);//查询试样号信息
- }
- /// <summary>
- /// 查询试样号信息
- /// </summary>
- /// <param name="uRow"></param>
- private void doQuerySampleNo(UltraGridRow uRow)
- {
- while (dataTable4.Columns.Count > 5)
- {
- dataTable4.Columns.RemoveAt(5);
- }
- DataTable dtSample = PublicServer.GetData("com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryDetialSampleNo",
- new Object[] { uRow.Cells["CheckNo"].Text }, ob);
- dataTable4.Rows.Clear();
- dtSample.AsEnumerable().GroupBy(p => new { BatchNo = p["BATCH_NO"].ToString(), Sample = p["HEAD_MAT_NO"].ToString(),MatNo = p["MAT_NO"].ToString(),CheckNo = p["CHECK_NO"].ToString() }).ToList()
- .ForEach(p =>
- {
- foreach (DataRow row in p)
- {
- if (!dataTable4.Columns.Contains(row["PHY_CODE_MAX"].ToString()))
- {
- DataColumn phyCloum = new DataColumn();
- phyCloum.ColumnName = row["PHY_CODE_MAX"].ToString();
- phyCloum.Caption = row["PHY_NAME_MAX"].ToString();
- dataTable4.Columns.Add(phyCloum);
- }
- }
- DataRow dr = dataTable4.NewRow();
- dr["PHY_BATCH_NO"] = p.Key.BatchNo;
- dr["HEAD_MAT_NO"] = p.Key.Sample;
- dr["SAMPLE_LEN"] = p.Max(q => q["SAMPLE_LEN"]);
- dr["MAT_NO"] = p.Key.MatNo;
- dr["CHECK_NO"] = p.Key.CheckNo;
- foreach (DataRow row in p)
- {
- dr[row["PHY_CODE_MAX"].ToString()] = row["SAMPLE_COUNT"].ToString();
- }
- dataTable4.Rows.Add(dr);
- });
- ultraGrid14.DataBind();
- GridHelper.RefreshAndAutoSize(ultraGrid14);
- }
- /// <summary>
- /// 查询成分理化项目明细
- /// </summary>
- /// <param name="uRow"></param>
- private void doQueryPhyChem(UltraGridRow uRow,string sampleType)
- {
- DataTable dataTable = null;
- UltraGrid ug = null;
- string craftSource = "";
- if (sampleType == "0")
- {
- dataTable = dataTable3;
- ug = ultraGrid11;
- craftSource = "0";
- }
- else if (sampleType == "1")
- {
- dataTable = dataTable5;
- ug = ultraGrid18;
- craftSource = "2";
- ultraLabel1.Text = "";
- }
- else if (sampleType == "2")
- {
- dataTable = dataTable7;
- ug = ultraGrid23;
- craftSource = "0";
- }
- while (dataTable.Columns.Count > 5)
- {
- dataTable.Columns.RemoveAt(5);
- }
- dtChem = PublicServer.GetData("com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryChem", new Object[] { uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text.Substring(0, 6), craftSource }, ob);//查询成分明细
- if (dtChem.Rows.Count > 0)
- {
- DataColumn hxCloum = new DataColumn();
- hxCloum.ColumnName = "HX";
- hxCloum.Caption = "化学";
- dataTable.Columns.Add(hxCloum);
- }
- dtPhy = PublicServer.GetData("com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryPhy", new Object[] { uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text.Substring(0, 6), craftSource }, ob);//查询理化明细
- string[] phyMaxCode = null;
- ultraLabel4.Text = "";
- List<string> list = new List<string>();
- if (dtPhy.Rows.Count > 0)
- {
- dtPhy.AsEnumerable().Select(p => new { Code = p["PHY_CODE_MIN"].ToString(), Name = p["PHY_NAME_MIN"].ToString(), rate = p["RATE"].ToString(), rateName = p["DESC_RATE"].ToString(), common = p["COMMON"].ToString() }).Distinct().ToList()
- .ForEach(p =>
- {
- DataColumn phyCloum = new DataColumn();
- phyCloum.ColumnName = p.Code;
- phyCloum.Caption = p.Name;
- dataTable.Columns.Add(phyCloum);
- if (p.rate.Equals("408601") || p.rate.Equals("408608"))
- {
- ultraLabel4.Text = ultraLabel4.Text + p.Name + " 取样频次:" + p.rateName;
- list.Add(p.Code);
- }
- if (sampleType == "1")
- {
- if (p.common.Equals("1"))
- {
- ultraLabel1.Text = ultraLabel1.Text + p.Name + " (共样) ";
- }
- }
- });
- }
- foreach (DataRow dr in dataTable.Rows)
- {
- string[] phyCodeGroup = dr["PHY_CODE_GROUP"].ToString().Split(',');
- for (int i = 5; i < dataTable.Columns.Count; i++)
- {
- if (phyCodeGroup.Contains(dataTable.Columns[i].ColumnName))
- {
- dr[i] = "√";
- }
- }
- }
- phyMaxCode = list.ToArray();
- ug.DataBind();
- GridHelper.RefreshAndAutoSize(ug);
- ultraLabel4.ForeColor = Color.Red;
- ultraLabel1.ForeColor = Color.Red;
- }
- private void doQueryPhyCodeMax(string[] phyMaxCode, string lotNo)
- {
- List<PipeCheckconsignDetailEntity> listSource = EntityHelper.GetData<PipeCheckconsignDetailEntity>(
- "com.steering.mes.port.mil.FrmMilBatchSampleNew.doQueryPhyCodeMax", new object[] { lotNo, phyMaxCode }, this.ob);
- pipeCheckconsignDetailEntityBindingSource.DataSource = listSource;
- }
- /// <summary>
- /// 查询正常样管信息
- /// </summary>
- private void doQuerySampleRack(UltraGridRow uRow, string sampleType)
- {
- DataTable dtBatchNo = null;
- if (sampleType == "0")
- {
- dtBatchNo = PublicServer.GetData("com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQuerySampleInfo",
- new Object[] { uRow.Cells["HeatPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, sampleType }, ob);
- }else if(sampleType == "1")
- {
- dtBatchNo = PublicServer.GetData("com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQuerySampleInfo",
- new Object[] { uRow.Cells["HeatPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, "1" }, ob);
- }
- else if (sampleType == "2")
- {
- dtBatchNo = PublicServer.GetData("com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQuerySampleInfo",
- new Object[] { uRow.Cells["HeatPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, "2" }, ob);
- }
- if (sampleType == "0")
- {
- GridHelper.CopyDataToDatatable(dtBatchNo, dataTable3, true);
- }
- else if (sampleType == "1")
- {
- GridHelper.CopyDataToDatatable(dtBatchNo, dataTable5, true);
- }
- else if (sampleType == "2")
- {
- GridHelper.CopyDataToDatatable(dtBatchNo, dataTable7, true);
- }
-
- }
- private void ultraGrid11_ClickCell(object sender, ClickCellEventArgs e)
- {
- this.ultraGrid9.UpdateData();
- UltraGridRow uRow = this.ultraGrid9.ActiveRow;
- if (uRow == null) return;
- string craftSource = "";
- if (ultraTabControl3.SelectedTab.Key == "0")
- {
- craftSource = "0";
- }
- else if (ultraTabControl3.SelectedTab.Key == "1")
- {
- craftSource = "2";
- }
- else
- {
- craftSource = "0";
- }
-
- if (e.Cell.Column.Key != "PHY_BATCH_NO" && e.Cell.Column.Key != "MAT_NO" && e.Cell.Column.Key != "SAMPLE_PIPE_LEN" && e.Cell.Column.Key != "SAMPLE_POSTION")
- {
- if (e.Cell.Text.Trim() == "")
- {
- DataTable ds = new DataTable();
- if (e.Cell.Column.Key == "C0004" || e.Cell.Column.Key == "C0100" || e.Cell.Column.Key == "C0103" || e.Cell.Column.Key == "C0107")
- {
- if(ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0030")){
- ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryS", new object[] { craftSource, uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, "C0030" }, ob);
- if (ds.Rows[0]["SSC_CONDITION"].ToString().Equals("409902"))
- {
- e.Cell.Row.Cells["C0030"].Value = "√";
- }
- }
- if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0033"))
- {
- ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryS", new object[] { craftSource, uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, "C0033" }, ob);
- if (ds.Rows[0]["SSC_CONDITION"].ToString().Equals("409902"))
- {
- e.Cell.Row.Cells["C0033"].Value = "√";
- }
- }
- }
- else if (e.Cell.Column.Key == "C0030")
- {
- ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryS", new object[] { craftSource, uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, "C0030" }, ob);
- if (ds.Rows[0]["SSC_CONDITION"].ToString().Equals("409902"))
- {
- if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0107"))
- {
- e.Cell.Row.Cells["C0107"].Value = "√";
- }
- else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0103"))
- {
- e.Cell.Row.Cells["C0103"].Value = "√";
- }
- else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0100"))
- {
- e.Cell.Row.Cells["C0100"].Value = "√";
- }
- else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0004"))
- {
- e.Cell.Row.Cells["C0004"].Value = "√";
- }
-
-
- }
- }
- else if (e.Cell.Column.Key == "C0033")
- {
- ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryS", new object[] { craftSource, uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, "C0033" }, ob);
- if (ds.Rows[0]["SSC_CONDITION"].ToString().Equals("409902"))
- {
- if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0107"))
- {
- e.Cell.Row.Cells["C0107"].Value = "√";
- }
- else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0103"))
- {
- e.Cell.Row.Cells["C0103"].Value = "√";
- }
- else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0100"))
- {
- e.Cell.Row.Cells["C0100"].Value = "√";
- }
- else if (ultraGrid11.DisplayLayout.Bands[0].Columns.Exists("C0004"))
- {
- e.Cell.Row.Cells["C0004"].Value = "√";
- }
- }
- }
- e.Cell.Value = "√";
- }
- else
- {
- e.Cell.Value = "";
- }
- }
- }
- private void FrmMilBatchSampleNew_Shown(object sender, EventArgs e)
- {
- if (toolMenu == null || toolMenu.Toolbars == null) return;
-
- if (toolMenu.Toolbars[0].Tools.Exists("Confirm"))
- {
- toolMenu.Toolbars[0].Tools["Confirm"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("CancelConfirm"))
- {
- toolMenu.Toolbars[0].Tools["CancelConfirm"].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("PrintLable"))
- {
- toolMenu.Toolbars[0].Tools["PrintLable"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("CancelGetSample"))
- {
- toolMenu.Toolbars[0].Tools["CancelGetSample"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("QueryRepeate"))
- {
- toolMenu.Toolbars[0].Tools["QueryRepeate"].InstanceProps.Visible = DefaultableBoolean.False;
- }
-
- if (toolMenu.Toolbars[0].Tools.Exists("ReGetSample"))
- {
- toolMenu.Toolbars[0].Tools["ReGetSample"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("CancelReGetSample"))
- {
- toolMenu.Toolbars[0].Tools["CancelReGetSample"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("RepeateFrim"))
- {
- toolMenu.Toolbars[0].Tools["RepeateFrim"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("CancelRepeateFrim"))
- {
- toolMenu.Toolbars[0].Tools["CancelRepeateFrim"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("PrintRe"))
- {
- toolMenu.Toolbars[0].Tools["PrintRe"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("PrintReLable"))
- {
- toolMenu.Toolbars[0].Tools["PrintReLable"].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("Query")) { toolMenu.Toolbars[0].Tools["Query"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 4 || this.ultraTabControl1.SelectedTab.Index == 5 ? DefaultableBoolean.False : DefaultableBoolean.True; }
-
- if (toolMenu.Toolbars[0].Tools.Exists("GetSample")) { toolMenu.Toolbars[0].Tools["GetSample"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 0 ? DefaultableBoolean.True : DefaultableBoolean.False; }
-
- if (toolMenu.Toolbars[0].Tools.Exists("ComfrimComplete")) { toolMenu.Toolbars[0].Tools["ComfrimComplete"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 0 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("CancelGetSample")) { toolMenu.Toolbars[0].Tools["CancelGetSample"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 1 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("Confirm")) { toolMenu.Toolbars[0].Tools["Confirm"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 2 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("CancelConfirm")) { toolMenu.Toolbars[0].Tools["CancelConfirm"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 3 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("Print")) { toolMenu.Toolbars[0].Tools["Print"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 3 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("PrintLable")) { toolMenu.Toolbars[0].Tools["PrintLable"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 3 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("ReGetSample")) { toolMenu.Toolbars[0].Tools["ReGetSample"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 4 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("CancelReGetSample")) { toolMenu.Toolbars[0].Tools["CancelReGetSample"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 4 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("QueryRepeate")) { toolMenu.Toolbars[0].Tools["QueryRepeate"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 4 || this.ultraTabControl1.SelectedTab.Index == 5 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("RepeateFrim")) { toolMenu.Toolbars[0].Tools["RepeateFrim"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 5 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("CancelRepeateFrim")) { toolMenu.Toolbars[0].Tools["CancelRepeateFrim"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 5 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("PrintRe")) { toolMenu.Toolbars[0].Tools["PrintRe"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 5 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("PrintReLable")) { toolMenu.Toolbars[0].Tools["PrintReLable"].InstanceProps.Visible = this.ultraTabControl1.SelectedTab.Index == 5 ? DefaultableBoolean.True : DefaultableBoolean.False; }
- }
-
- /// <summary>
- /// 逐支取样
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void pipeceButtonStd_Click(object sender, EventArgs e)
- {
- this.ultraGrid1.UpdateData();
- this.ultraGrid3.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- if (uRow == null) return;
- string len = "";
- List<PortMchBatchSampleResultEntity> lists = portMchBatchSampleResultEntityBindingSource.DataSource as List<PortMchBatchSampleResultEntity>;
- var m = lists.Where(p => p.PhyBatchNo != "").ToList();//判断是否还未分配性能批号集合数据
- if (m.Count == 0)
- {
- return;
- }
- if (this.txtPieceLen.Text == "")
- {
- MessageUtil.ShowTips("请输入逐支取样长度!");
- return;
- }
- if (!StringUtil.IsInt(this.txtPieceLen.Text.Trim().ToString3()))
- {
- MessageUtil.ShowTips("逐支取样长度需输入正整数!");
- return;
- }
- len = this.txtPieceLen.Text.Trim();
- DataTable ds = PublicServer.GetData("com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryPhyMaxPipece", new object[] { uRow.Cells["ProPlanId"].Text, uRow.Cells["GxPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, this.cmbSampleType.Value.ToString() }, ob);
- if (ds.Rows.Count == 0)
- {
- MessageUtil.ShowTips("无逐支取样试样组,不允许一键取样!");
- return;
- }
- var status = new List<string> { };
- status = this.cmbPiecePostion.CheckedItems.Select(p => p.DataValue.ToString()).ToList();
- if (!status.Any()) status = new List<string> { "401201", "401202", "401217", "401218", "401219", "401220", "401221", "401222", "401223" };
- List<PipeCheckconsignDetailEntity> listS = EntityHelper.GetData<PipeCheckconsignDetailEntity>(
- "com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQuerySampleMatNo", new object[] { uRow.Cells["JudgeStoveNo"].Text, this.cmbSampleType.Value.ToString() }, this.ob);
- for (int i = 0; i < lists.Count; i++)
- {
- var p = lists[i];
- if (status.ToArray().Length == 1)
- {
- var listD = listS.Where(q => q.MatNo == p.MatNo).ToList();
- if (listD.Any()) return;
- if (status.Contains("401201") || status.Contains("401202"))
- {
- if (i == 0)
- {
- p.SamplePipeLenA = len;
- }
- else
- {
- var LastlistD = listS.Where(q => q.MatNo == lists[i - 1].MatNo).ToList();
- if (LastlistD.Any())
- {
- if (LastlistD[0].Postion == "A")
- {
- p.SamplePipeLenB = len;
- }
- else
- {
- p.SamplePipeLenA = len;
- }
- }
- else
- {
- if (lists[i - 1].SamplePipeLenA == "")
- {
- p.SamplePipeLenA = len;
- }
- else
- {
- p.SamplePipeLenB = len;
- }
- }
- }
- }
- if (status.Contains("401217"))
- {
- p.SamplePipeLenC = len;
- }
- if (status.Contains("401218"))
- {
- p.SamplePipeLenD = len;
- }
- if (status.Contains("401219"))
- {
- p.SamplePipeLenM = len;
- }
- if (status.Contains("401220"))
- {
- p.SamplePipeLenE = len;
- }
- if (status.Contains("401221"))
- {
- p.SamplePipeLenF = len;
- }
- if (status.Contains("401222"))
- {
- p.SamplePipeLenP = len;
- }
- if (status.Contains("401223"))
- {
- p.SamplePipeLenQ = len;
- }
- }
- else
- {
- var listD = listS.Where(q => q.MatNo == p.MatNo).ToList();
- if (listD.Any()) return;
- if (status.Contains("401201"))
- {
- p.SamplePipeLenA = len;
- }
- if (status.Contains("401202"))
- {
- p.SamplePipeLenB = len;
- }
- if (status.Contains("401217"))
- {
- p.SamplePipeLenC = len;
- }
- if (status.Contains("401218"))
- {
- p.SamplePipeLenD = len;
- }
- if (status.Contains("401219"))
- {
- p.SamplePipeLenM = len;
- }
- if (status.Contains("401220"))
- {
- p.SamplePipeLenE = len;
- }
- if (status.Contains("401221"))
- {
- p.SamplePipeLenF = len;
- }
- if (status.Contains("401222"))
- {
- p.SamplePipeLenP = len;
- }
- if (status.Contains("401223"))
- {
- p.SamplePipeLenQ = len;
- }
- }
- //p.ChemResultCode = "1";
- p.Chk = true;
- }
- ultraGrid3.Update();
- ultraGrid3.DataBind();
- ultraGrid3_CellChange(null, null);
- }
-
- private void ultraGrid3_InitializeRow(object sender, InitializeRowEventArgs e)
- {
- PortMchBatchSampleResultEntity portHttBatchSampleResultEntity = e.Row.ListObject as PortMchBatchSampleResultEntity;
- if (portHttBatchSampleResultEntity.PhyBatchNo == "") return;
- if (portHttBatchSampleResultEntity.IsSamplePipe == "1")
- {
- ultraGrid3.Rows[e.Row.Index].RowSelectorAppearance.BackColor = Color.Red;
- }
- if (e.Row.Index == 0)
- {
- e.Row.Appearance.BackColor = color1;
- }
- else
- {
- PortMchBatchSampleResultEntity lastList = ultraGrid3.Rows[e.Row.Index - 1].ListObject as PortMchBatchSampleResultEntity;
- if (portHttBatchSampleResultEntity.PhyBatchNo == lastList.PhyBatchNo)
- {
- e.Row.Appearance.BackColor = ultraGrid3.Rows[e.Row.Index - 1].Appearance.BackColor;
- }
- else
- {
- e.Row.Appearance.BackColor = ultraGrid3.Rows[e.Row.Index - 1].Appearance.BackColor == color1 ? color2 : color1;
- }
- }
- }
- private void txtLen_ValueChanged(object sender, EventArgs e)
- {
- if (!StringUtil.IsInt(this.txtLen.Text)) return;
- List<PortMchBatchSampleResultEntity> list1 = null;
- list1 = portMchBatchSampleResultEntityBindingSource.DataSource as List<PortMchBatchSampleResultEntity>;
- if (list1.Any())
- {
- if (this.cmbPostion.Value.ToString().Equals("401201"))//A端
- {
- list1.Where(p => p.MatNo == txtMatNo.Text).ToList().ForEach(p => p.SamplePipeLenA = txtLen.Text);
- }
- else if (this.cmbPostion.Value.ToString().Equals("401202"))
- {
- list1.Where(p => p.MatNo == txtMatNo.Text).ToList().ForEach(p => p.SamplePipeLenB = txtLen.Text);
- }
- else if (this.cmbPostion.Value.ToString().Equals("401217"))
- {
- list1.Where(p => p.MatNo == txtMatNo.Text).ToList().ForEach(p => p.SamplePipeLenC = txtLen.Text);
- }
- else if (this.cmbPostion.Value.ToString().Equals("401218"))
- {
- list1.Where(p => p.MatNo == txtMatNo.Text).ToList().ForEach(p => p.SamplePipeLenD = txtLen.Text);
- }
- else if (this.cmbPostion.Value.ToString().Equals("401219"))
- {
- list1.Where(p => p.MatNo == txtMatNo.Text).ToList().ForEach(p => p.SamplePipeLenM = txtLen.Text);
- }
- else if (this.cmbPostion.Value.ToString().Equals("401220"))
- {
- list1.Where(p => p.MatNo == txtMatNo.Text).ToList().ForEach(p => p.SamplePipeLenE = txtLen.Text);
- }
- else if (this.cmbPostion.Value.ToString().Equals("401221"))
- {
- list1.Where(p => p.MatNo == txtMatNo.Text).ToList().ForEach(p => p.SamplePipeLenF = txtLen.Text);
- }
- else if (this.cmbPostion.Value.ToString().Equals("401222"))
- {
- list1.Where(p => p.MatNo == txtMatNo.Text).ToList().ForEach(p => p.SamplePipeLenP = txtLen.Text);
- }
- else if (this.cmbPostion.Value.ToString().Equals("401223"))
- {
- list1.Where(p => p.MatNo == txtMatNo.Text).ToList().ForEach(p => p.SamplePipeLenQ = txtLen.Text);
- }
- }
- ultraGrid3_CellChange(null, null);
- GridHelper.RefreshAndAutoSize(ultraGrid3);
- }
- private void ultraGrid15_AfterRowActivate(object sender, EventArgs e)
- {
- this.ultraGrid15.UpdateData();
- UltraGridRow uRow = this.ultraGrid15.ActiveRow;
- if (uRow == null) return;
- List<PipeCheckconsignNoqualifiedEntity> listSource = EntityHelper.GetData<PipeCheckconsignNoqualifiedEntity>(
- "com.steering.mes.port.mil.FrmMilBatchSampleNew.doQueryRepeateInformation", new object[] { uRow.Cells["CheckNo"].Text, uRow.Cells["JudgeStoveNo"].Text }, this.ob);
- pipeCheckconsignNoqualifiedEntityBindingSource2.DataSource = listSource;
- List<PortMchBatchSampleResultEntity> listSource1 = EntityHelper.GetData<PortMchBatchSampleResultEntity>(
- "com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryRepeatRack", new object[] { uRow.Cells["JudgeStoveNo"].Text }, this.ob);
- portMchBatchSampleResultEntityBindingSource2.DataSource = listSource1;
- foreach (UltraGridRow row in this.ultraGrid17.Rows)
- {
- if (row.Cells["IsSamplePipe"].Text == "1")
- {
- row.RowSelectorAppearance.BackColor = Color.Red;
- }
- }
- }
- private void ultraGrid19_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow uRow = this.ultraGrid19.ActiveRow;
- if (uRow == null) return;
- List<PipeCheckconsignNoqualifiedEntity> listSource = EntityHelper.GetData<PipeCheckconsignNoqualifiedEntity>(
- "com.steering.mes.port.mil.FrmMilBatchSampleNew.doQueryRepeateInformation", new object[] { uRow.Cells["CheckNo"].Text, uRow.Cells["JudgeStoveNo"].Text }, this.ob);
- pipeCheckconsignNoqualifiedEntityBindingSource4.DataSource = listSource;
- doQueryResampleRck(uRow);
- doQueryChemPhy(uRow);
- doQueryResampleNo(uRow);//复取样委托信息
- }
- private void doQueryResampleNo(UltraGridRow uRow)
- {
- while (dataTable6.Columns.Count > 3)
- {
- dataTable6.Columns.RemoveAt(3);
- }
- DataTable dtSample = PublicServer.GetData("com.steering.mes.port.mil.FrmMilBatchSampleNew.doQueryReDetialSampleNo",
- new Object[] { uRow.Cells["CheckNo"].Text, "2", "F" }, ob);
- dataTable6.Rows.Clear();
- dtSample.AsEnumerable().GroupBy(p => new { BatchNo = p["BATCH_NO"].ToString(), Sample = p["HEAD_MAT_NO"].ToString() }).ToList()
- .ForEach(p =>
- {
- foreach (DataRow row in p)
- {
- if (!dataTable6.Columns.Contains(row["PHY_CODE_MAX"].ToString()))
- {
- DataColumn phyCloum = new DataColumn();
- phyCloum.ColumnName = row["PHY_CODE_MAX"].ToString();
- phyCloum.Caption = row["PHY_NAME_MAX"].ToString();
- dataTable6.Columns.Add(phyCloum);
- }
- }
- DataRow dr = dataTable6.NewRow();
- dr["PHY_BATCH_NO"] = p.Key.BatchNo;
- dr["HEAD_MAT_NO"] = p.Key.Sample;
- dr["SAMPLE_LEN"] = p.Max(q => q["SAMPLE_LEN"]);
- foreach (DataRow row in p)
- {
- dr[row["PHY_CODE_MAX"].ToString()] = row["SAMPLE_COUNT"].ToString();
- }
- dataTable6.Rows.Add(dr);
- });
- ultraGrid21.DataBind();
- GridHelper.RefreshAndAutoSize(ultraGrid21);
- }
- private void doQueryChemPhy(UltraGridRow uRow)
- {
- while (dataTable5.Columns.Count > 5)
- {
- dataTable5.Columns.RemoveAt(5);
- }
- dtPhy = PublicServer.GetData("com.steering.mes.port.mil.FrmMilBatchSampleNew.doQueryReChemPhy", new Object[] { uRow.Cells["LotNo"].Text, uRow.Cells["JudgeStoveNo"].Text, uRow.Cells["CheckNo"].Text }, ob);//查询复取样试样组
- List<string> list = new List<string>();
- if (dtPhy.Rows.Count > 0)
- {
- dtPhy.AsEnumerable().Select(p => new { Code = p["PHY_CODE_MAX"].ToString(), Name = p["PHY_NAME_MAX"].ToString() }).Distinct().ToList()
- .ForEach(p =>
- {
- DataColumn phyCloum = new DataColumn();
- phyCloum.ColumnName = p.Code;
- phyCloum.Caption = p.Name;
- dataTable5.Columns.Add(phyCloum);
- });
- }
- ultraGrid20.DataBind();
- GridHelper.RefreshAndAutoSize(ultraGrid20);
- }
- private void doQueryResampleRck(UltraGridRow uRow)
- {
- DataTable dtBatchNo = PublicServer.GetData("com.steering.mes.port.vrp.FrmHttBatchSaplmeNew.doQueryResampleInfo",
- new Object[] { uRow.Cells["JudgeStoveNo"].Text, "F" + uRow.Cells["CheckNo"].Text }, ob);
- dataTable5.Rows.Clear();
- foreach (DataRow row in dtBatchNo.Rows)
- {
- if (row["RESAMPLE_PIPE_LEN_A"] != null && row["RESAMPLE_PIPE_LEN_A"].ToString() != "")
- {
- DataRow newRowA = dataTable5.NewRow();
- newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString();
- newRowA["MAT_NO"] = row["MAT_NO"].ToString();
- newRowA["SAMPLE_PIPE_LEN"] = row["RESAMPLE_PIPE_LEN_A"].ToString();
- newRowA["SAMPLE_POSTION"] = "A端";
- newRowA["PHY_CODE_GROUP"] = "";
- dataTable5.Rows.Add(newRowA);
- }
- if (row["RESAMPLE_PIPE_LEN_B"] != null && row["RESAMPLE_PIPE_LEN_B"].ToString() != "")
- {
- DataRow newRowA = dataTable5.NewRow();
- newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString();
- newRowA["MAT_NO"] = row["MAT_NO"].ToString();
- newRowA["SAMPLE_PIPE_LEN"] = row["RESAMPLE_PIPE_LEN_B"].ToString();
- newRowA["SAMPLE_POSTION"] = "B端";
- newRowA["PHY_CODE_GROUP"] = "";
- dataTable5.Rows.Add(newRowA);
- }
- if (row["RESAMPLE_PIPE_LEN_C"] != null && row["RESAMPLE_PIPE_LEN_C"].ToString() != "")
- {
- DataRow newRowA = dataTable5.NewRow();
- newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString();
- newRowA["MAT_NO"] = row["MAT_NO"].ToString();
- newRowA["SAMPLE_PIPE_LEN"] = row["RESAMPLE_PIPE_LEN_C"].ToString();
- newRowA["SAMPLE_POSTION"] = "C端";
- newRowA["PHY_CODE_GROUP"] = "";
- dataTable5.Rows.Add(newRowA);
- }
- if (row["RESAMPLE_PIPE_LEN_D"] != null && row["RESAMPLE_PIPE_LEN_D"].ToString() != "")
- {
- DataRow newRowA = dataTable5.NewRow();
- newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString();
- newRowA["MAT_NO"] = row["MAT_NO"].ToString();
- newRowA["SAMPLE_PIPE_LEN"] = row["RESAMPLE_PIPE_LEN_D"].ToString();
- newRowA["SAMPLE_POSTION"] = "D端";
- newRowA["PHY_CODE_GROUP"] = "";
- dataTable5.Rows.Add(newRowA);
- }
- if (row["RESAMPLE_PIPE_LEN_E"] != null && row["RESAMPLE_PIPE_LEN_E"].ToString() != "")
- {
- DataRow newRowA = dataTable5.NewRow();
- newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString();
- newRowA["MAT_NO"] = row["MAT_NO"].ToString();
- newRowA["SAMPLE_PIPE_LEN"] = row["RESAMPLE_PIPE_LEN_E"].ToString();
- newRowA["SAMPLE_POSTION"] = "E端";
- newRowA["PHY_CODE_GROUP"] = "";
- dataTable5.Rows.Add(newRowA);
- }
- if (row["RESAMPLE_PIPE_LEN_F"] != null && row["RESAMPLE_PIPE_LEN_F"].ToString() != "")
- {
- DataRow newRowA = dataTable5.NewRow();
- newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString();
- newRowA["MAT_NO"] = row["MAT_NO"].ToString();
- newRowA["SAMPLE_PIPE_LEN"] = row["RESAMPLE_PIPE_LEN_F"].ToString();
- newRowA["SAMPLE_POSTION"] = "F端";
- newRowA["PHY_CODE_GROUP"] = "";
- dataTable5.Rows.Add(newRowA);
- }
- if (row["RESAMPLE_PIPE_LEN_P"] != null && row["RESAMPLE_PIPE_LEN_P"].ToString() != "")
- {
- DataRow newRowA = dataTable5.NewRow();
- newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString();
- newRowA["MAT_NO"] = row["MAT_NO"].ToString();
- newRowA["SAMPLE_PIPE_LEN"] = row["RESAMPLE_PIPE_LEN_P"].ToString();
- newRowA["SAMPLE_POSTION"] = "P端";
- newRowA["PHY_CODE_GROUP"] = "";
- dataTable5.Rows.Add(newRowA);
- }
- if (row["RESAMPLE_PIPE_LEN_Q"] != null && row["RESAMPLE_PIPE_LEN_Q"].ToString() != "")
- {
- DataRow newRowA = dataTable5.NewRow();
- newRowA["PHY_BATCH_NO"] = row["PHY_BATCH_NO"].ToString();
- newRowA["MAT_NO"] = row["MAT_NO"].ToString();
- newRowA["SAMPLE_PIPE_LEN"] = row["RESAMPLE_PIPE_LEN_Q"].ToString();
- newRowA["SAMPLE_POSTION"] = "Q端";
- newRowA["PHY_CODE_GROUP"] = "";
- dataTable5.Rows.Add(newRowA);
- }
- }
- GridHelper.RefreshAndAutoSize(ultraGrid20);
- }
- private void ultraGrid17_CellChange(object sender, CellEventArgs e)
- {
- this.ultraGrid17.UpdateData();
- ultraGrid17.Update();
- if (e.Cell.Column.Key == "Chk")
- {
- if (e.Cell.Value.ToString() == "True")
- {
- e.Cell.Row.RowSelectorAppearance.BackColor = Color.Red;
- txtMatNo1.Text = e.Cell.Row.Cells["MatNo"].Text;
- }
- else
- {
- e.Cell.Row.RowSelectorAppearance.BackColor = Color.Empty;
- }
- }
- }
- private void txtLen1_ValueChanged(object sender, EventArgs e)
- {
- if (!StringUtil.IsInt(this.txtLen1.Text)) return;
- List<PortMchBatchSampleResultEntity> list1 = null;
- list1 = portMchBatchSampleResultEntityBindingSource2.DataSource as List<PortMchBatchSampleResultEntity>;
- if (list1.Any())
- {
- if (this.cmbPostion1.Value.ToString().Equals("401201"))//A端
- {
- list1.Where(p => p.MatNo == txtMatNo1.Text).ToList().ForEach(p => p.ResamplePipeLenA = txtLen1.Text);
- }
- else if (this.cmbPostion1.Value.ToString().Equals("401202"))
- {
- list1.Where(p => p.MatNo == txtMatNo1.Text).ToList().ForEach(p => p.ResamplePipeLenB = txtLen1.Text);
- }
- else if (this.cmbPostion1.Value.ToString().Equals("401217"))
- {
- list1.Where(p => p.MatNo == txtMatNo1.Text).ToList().ForEach(p => p.ResamplePipeLenC = txtLen1.Text);
- }
- else if (this.cmbPostion1.Value.ToString().Equals("401218"))
- {
- list1.Where(p => p.MatNo == txtMatNo1.Text).ToList().ForEach(p => p.ResamplePipeLenD = txtLen1.Text);
- }
- else if (this.cmbPostion1.Value.ToString().Equals("401219"))
- {
- list1.Where(p => p.MatNo == txtMatNo1.Text).ToList().ForEach(p => p.ResamplePipeLenM = txtLen1.Text);
- }
- else if (this.cmbPostion1.Value.ToString().Equals("401220"))
- {
- list1.Where(p => p.MatNo == txtMatNo1.Text).ToList().ForEach(p => p.ResamplePipeLenE = txtLen1.Text);
- }
- else if (this.cmbPostion1.Value.ToString().Equals("401221"))
- {
- list1.Where(p => p.MatNo == txtMatNo1.Text).ToList().ForEach(p => p.ResamplePipeLenF = txtLen1.Text);
- }
- else if (this.cmbPostion1.Value.ToString().Equals("401222"))
- {
- list1.Where(p => p.MatNo == txtMatNo1.Text).ToList().ForEach(p => p.ResamplePipeLenP = txtLen1.Text);
- }
- else if (this.cmbPostion1.Value.ToString().Equals("401223"))
- {
- list1.Where(p => p.MatNo == txtMatNo1.Text).ToList().ForEach(p => p.ResamplePipeLenQ = txtLen1.Text);
- }
- }
- GridHelper.RefreshAndAutoSize(ultraGrid17);
- }
- private void ultraGrid21_ClickCell(object sender, ClickCellEventArgs e)
- {
- if (e.Cell.Column.Key != "PHY_BATCH_NO" && e.Cell.Column.Key != "MAT_NO" && e.Cell.Column.Key != "SAMPLE_PIPE_LEN" && e.Cell.Column.Key != "SAMPLE_POSTION")
- {
- if (e.Cell.Text.Trim() == "")
- {
- e.Cell.Value = "√";
- }
- else
- {
- e.Cell.Value = "";
- }
- }
- }
- private void ultraGrid18_ClickCell(object sender, ClickCellEventArgs e)
- {
- if (e.Cell.Column.Key != "PHY_BATCH_NO" && e.Cell.Column.Key != "MAT_NO" && e.Cell.Column.Key != "SAMPLE_PIPE_LEN" && e.Cell.Column.Key != "SAMPLE_POSTION")
- {
- if (e.Cell.Text.Trim() == "")
- {
- e.Cell.Value = "√";
- }
- else
- {
- e.Cell.Value = "";
- }
- }
- }
- private void ultraGrid8_AfterRowActivate(object sender, EventArgs e)
- {
- this.ultraGrid5.UpdateData();
- this.ultraGrid8.UpdateData();
- UltraGridRow uRow = this.ultraGrid5.ActiveRow;
- UltraGridRow row = this.ultraGrid8.ActiveRow;
- doQueryBatchRack(uRow,row);
- }
- /// <summary>
- /// 按批查管号队列
- /// </summary>
- /// <param name="uRow"></param>
- /// <param name="row"></param>
- private void doQueryBatchRack(UltraGridRow uRow, UltraGridRow row)
- {
- List<PortMchBatchSampleResultEntity> listSource = EntityHelper.GetData<PortMchBatchSampleResultEntity>(
- "com.steering.mes.port.vrp.FrmMchBatchSampleNew.doQueryBatchRack", new object[] { uRow.Cells["HeatPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, row.Cells["PHY_BATCH_NO"].Text }, this.ob);
- portMchBatchSampleResultEntityBindingSource1.DataSource = listSource;
- }
- private void ultraGrid23_ClickCell(object sender, ClickCellEventArgs e)
- {
- if (e.Cell.Column.Key != "PHY_BATCH_NO" && e.Cell.Column.Key != "MAT_NO" && e.Cell.Column.Key != "SAMPLE_PIPE_LEN" && e.Cell.Column.Key != "SAMPLE_POSTION")
- {
- if (e.Cell.Text.Trim() == "")
- {
- e.Cell.Value = "√";
- }
- else
- {
- e.Cell.Value = "";
- }
- }
- }
- }
- }
|