| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
-
- using com.steering.pss.ydm.entity;
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Format;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.PipeLeaveFactory.YdmObject;
- using CoreFS.CA06;
- using Infragistics.Win.UltraWinGrid;
- using System;
- 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.PipeLeaveFactory
- {
- public partial class FrmMatNo : FrmBase
- {
- public FrmMatNo(UltraGridRow uRow,OpeBase ob)
- {
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
- InitializeComponent();
- row = uRow;
- _ob = ob;
- }
- public string flag = "";
- private UltraGridRow row = null;
- private OpeBase _ob;
- public string matNo = "";
- public string mesNo = "";//喷印管号
- public int acount = 0;
- public double wgt = 0.0;
- public double sumlength = 0.0;
- private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
- {
- switch (e.Tool.Key)
- {
- case "DoFrim":
- doFrim();
- break;
- case "Export":
- GridHelper.ulGridToExcel(ultraGrid1, "资源信息");
- break;
- case "DoClose":
- closeFrom();
- break;
- }
- }
- private void doQuer(UltraGridRow row)
- {
- MatInfoEntity matZcEntity = (MatInfoEntity)row.ListObject;
- string matZcTity = JSONFormat.Format(matZcEntity);
- List<MatZcMEntity5> listSource = EntityHelper.GetData<MatZcMEntity5>("com.steering.pss.ydm.pipeleavefactory.CorePipeCarBill.doQueryDataMat", new object[] { matZcTity }, _ob);
- matZcMEntityBindingSource1.DataSource = listSource;
- }
- //确认
- private void doFrim()
- {
- this.ultraGrid1.UpdateData();
- IQueryable<UltraGridRow> checkMagRows = this.ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'");
- foreach(UltraGridRow mRow in checkMagRows)
- {
- MatZcMEntity5 matBTity = (MatZcMEntity5)mRow.ListObject;
- matNo = matNo + matBTity.MatNo + ",";
- mesNo = mesNo + matBTity.MeasuringSeq + ",";
- acount = acount + 1;
- wgt = wgt + double.Parse(matBTity.ActWeight.ToString());
- sumlength = sumlength + double.Parse(matBTity.ActLen.ToString());
- }
- flag = "1";
- this.Close();
- }
- private void closeFrom()
- {
- flag = "0";
- this.Close();
- }
- private void FrmMatNo_Load(object sender, EventArgs e)
- {
- EntityHelper.ShowGridCaption<MatZcMEntity5>(ultraGrid1.DisplayLayout.Bands[0]);
- doQuer(row);
- }
- private void ultraGrid1_CellChange(object sender, CellEventArgs e)
- {
- this.ultraGrid1.UpdateData();
- if (e.Cell.Column.Key == "CHK")
- {
- IQueryable<UltraGridRow> checkMagRows = this.ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'");
- if (checkMagRows.Count() == 0)
- {
- this.ultraLabel1.Text = "";
- return;
- }
- int acount = 0;
- double len = 0.0;
- double lenY = 0.0;
- double wgt = 0.0;
- foreach (UltraGridRow row in checkMagRows)
- {
- acount = acount + 1;
- wgt = wgt + double.Parse(row.Cells["ActWeight"].Text);
- len = len + double.Parse(row.Cells["ActLen"].Text);
- lenY = lenY + double.Parse(row.Cells["ActLenY"].Text);
- }
- this.ultraLabel1.Text = "已选信息:" + acount.ToString3() + "支" + " " + wgt.ToString3() + "吨" + " " + len.ToString3() + "米" +" "+ lenY + "英尺";
- }
- }
-
- }
- }
|