| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.Mcp.Mch.Entity;
- using CoreFS.CA06;
- 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.Mcp.Mch.MchResult
- {
- public partial class FrmMchBale : FrmBase
- {
- private string[] plineCode = null;
- public FrmMchBale()
- {
- InitializeComponent();
- }
- private void chkHeatNo2_CheckedChanged(object sender, EventArgs e)
- {
- this.txtHeatNo2.Enabled = this.chkHeatNo2.Checked;
- }
- private void chkOrderNo_CheckedChanged(object sender, EventArgs e)
- {
- this.txtOrderNo.Enabled = this.chkOrderNo.Checked;
- }
- private void FrmMchBale_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.StartTime2.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
- //this.EndTime2.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
- EntityHelper.ShowGridCaption<RtdMeasurePosdataEntityJG>(ultraGrid1.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<RtdMeasurePosdataEntityJG>(ultraGrid2.DisplayLayout.Bands[0]);
- plineCode = comm.GetPlineCode(this.ValidDataPurviewIds, "G", this.CustomInfo, ob);
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "DoQuery":
- QueryRtdMeasurePosdata();
- break;
- case "updateBale":
- updateBale();
- break;
- case "DoPrint":
- PrintResult();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 查询
- /// </summary>
- private void QueryRtdMeasurePosdata()
- {
- string orderNo = "";
- string jugeNo = "";
- string startTim = "";
- string endTim = "";
-
- if (this.chkHeatNo2.Checked && this.txtHeatNo2.Text.Trim() != "")
- {
- jugeNo = this.txtHeatNo2.Text.Trim();
- }
- if (this.chkOrderNo.Checked && this.txtOrderNo.Text.Trim() != "")
- {
- orderNo = this.txtOrderNo.Text.Trim();
- }
- if (chkTim2.Checked)
- {
- if (DateTime.Parse(StartTime2.Value.ToString()) > DateTime.Parse(EndTime2.Value.ToString()))
- {
- MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!");
- return;
- }
- else
- {
- startTim = this.StartTime2.Value.ToString("yyyy-MM-dd HH:mm:ss");
- endTim = this.EndTime2.Value.ToString("yyyy-MM-dd HH:mm:ss");
- }
- }
- List<RtdMeasurePosdataEntityJG> listSource = EntityHelper.GetData<RtdMeasurePosdataEntityJG>(
- "com.steering.mes.mcp.Mch.FrmMeasureResult.QueryZgJugdeApply", new object[] { jugeNo, startTim, endTim, orderNo, plineCode }, this.ob);
- bindingSource1.DataSource = listSource;
- GridHelper.RefreshAndAutoSize(ultraGrid1);
- }
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- List<RtdMeasurePosdataEntityJG> listSource = EntityHelper.GetData<RtdMeasurePosdataEntityJG>(
- "com.steering.mes.mcp.Mch.FrmMeasureResult.QueryBaleRecord", new object[] { uRow.Cells["JudgeStoveNo"].Value.ToString(), uRow.Cells["BatchNo"].Value.ToString(), uRow.Cells["PlineCode"].Value.ToString(), uRow.Cells["ProOrderNo"].Value.ToString() }, this.ob);
- bindingSource2.DataSource = listSource;
- }
- /// <summary>
- /// 打捆
- /// </summary>
- private void updateBale()
- {
- this.ultraGrid1.UpdateData();
- this.ultraGrid2.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- if (uRow == null)
- {
- MessageUtil.ShowTips("请选择需要调整的炉信息!");
- return;
- }
- ArrayList listAll = new ArrayList();
- if (ultraGrid2.Rows.Count > 0)
- {
- foreach (UltraGridRow ugr in ultraGrid2.Rows)
- {
- if (Double.Parse(ugr.Cells["BaleNo"].Value.ToString3()) < 0)
- {
- MessageUtil.ShowTips("请输入正确的数字!");
- return;
- }
- ArrayList list = new ArrayList();
- list.Add(ugr.Cells["BaleNo"].Value.ToString());
- list.Add(ugr.Cells["KeyId"].Value.ToString());
- listAll.Add(list);
- }
- }
-
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.Mch.FrmMeasureResult";
- ccp.MethodName = "updateBale";
- ccp.ServerParams = new object[] { listAll };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("打捆成功!"))
- {
- QueryRtdMeasurePosdata();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 打捆标签
- /// </summary>
- private void PrintResult()
- {
- this.ultraGrid2.UpdateData();
- UltraGridRow uRow = this.ultraGrid2.ActiveRow;
- String JudgeStoveNo = uRow.Cells["JudgeStoveNo"].Value.ToString();
- String BatchNo = uRow.Cells["BatchNo"].Value.ToString();
- String PlineCode = uRow.Cells["PlineCode"].Value.ToString();
- String ProOrderNo = uRow.Cells["ProOrderNo"].Value.ToString();
- String BaleNo = uRow.Cells["BaleNo"].Value.ToString();
- string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMchBale.cpt&JUDGE_STOVE_NO=" + JudgeStoveNo + "&BATCH_NO=" + BatchNo + "&PLINE_CODE=" + PlineCode + "&PRO_ORDER_NO=" + ProOrderNo + "&BALE_NO=" + BaleNo;
- FrmRepExcel fre = new FrmRepExcel(ob, strurl);
- fre.AutoSize = true;
- fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fre.WindowState = FormWindowState.Maximized;
- fre.Show();
- }
- }
- }
|