| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219 |
- using com.steering.mes.zgmil.entity;
- 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 Core.StlMes.Client.ZGMil.Entity;
- using Core.StlMes.Client.ZGMil.NodeResultQuery;
- using Core.StlMes.Client.ZGMil.Popup;
- using Core.StlMes.Client.ZGMil.Report;
- using Core.StlMes.Client.ZGMil.ResultConrtrol;
- 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.ZGMil.Signature
- {
- public partial class FrmApplyInputUpdate : FrmBase
- {
- private string Process = "";//参数
- private string[] arrId;//数据权限
- private DataTable _dtPline = null;
- public FrmApplyInputUpdate()
- {
- InitializeComponent();
- }
- private void FrmApplyInputUpdate_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<QcmZgJugdeApplyEntity2>(ultraGrid1.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<QcmZgJudgeInputRecordEntity>(ultraGrid2.DisplayLayout.Bands[0]);
- Process = this.CustomInfo.ToString();//参数
- _dtPline = ServerHelper.GetData("com.steering.mes.zgmil.report.FrmMilDateStatistics.JudgeBaseInfo", new object[] { Process }, ob);
- //_dtPline.AcceptChanges();
- string strPlineNames = string.Join(",", _dtPline.Rows.Cast<DataRow>().Select(a => a["plineName"].ToString()).ToArray());
- string strPineCodes = string.Join(",", _dtPline.Rows.Cast<DataRow>().Select(a => a["plineCode"].ToString()).ToArray());
- ultraTextEditor1.Text = strPlineNames;
- ultraTextEditor1.Tag = strPineCodes;
- InitBindColumn();
-
- }
-
-
- private void InitBindColumn()
- {
-
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "DoQuery":
- QueryZgJugdeApply();
- break;
- case "updateInputWt":
- updateInputWt();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
-
-
-
-
- /// <summary>
- /// 调整设料量
- /// </summary>
- private void updateInputWt()
- {
- this.ultraGrid1.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- //string departMentid = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob);
- string departMentid = UserInfo.GetDeptid();
- if (uRow == null)
- {
- MessageUtil.ShowTips("请选择需要调整的炉信息!");
- return;
- }
- if (Double.Parse(uRow.Cells["InputCount"].Value.ToString3()) < 0)
- {
- MessageUtil.ShowTips("请输入正确的数字!");
- return;
- }
- if (Double.Parse(uRow.Cells["InputWeight"].Value.ToString3()) < 0)
- {
- MessageUtil.ShowTips("请输入正确的数字 !");
- return;
- }
- ArrayList list = new ArrayList();
- list.Add(uRow.Cells["JugdeApplyCode"].Value.ToString());
- list.Add(uRow.Cells["JugdeApplySequeno"].Value.ToString());
- list.Add(uRow.Cells["JudgeStoveNo"].Value.ToString());
- list.Add(uRow.Cells["BatchNo"].Value.ToString());
- list.Add(uRow.Cells["BatchGroudNo"].Value.ToString());
- list.Add(uRow.Cells["InputCount"].Text.ToString3());
- list.Add(uRow.Cells["InputWeight"].Text.ToString3());
- list.Add(UserInfo.GetUserName());
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
- ccp.MethodName = "updateInputWt";
- ccp.ServerParams = new object[] { list };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("调整成功!"))
- {
- QueryZgJugdeApply();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
-
-
- /// <summary>
- /// 查询送判数据
- /// </summary>
- private void QueryZgJugdeApply()
- {
-
- string plinCode = "";
- string jugeNo = "";
- string startTim = "";
- string endTim = "";
- string departMentid = UserInfo.GetDeptid();
- if (this.chkHeatNo2.Checked && this.txtHeatNo2.Text.Trim() != "")
- {
- jugeNo = this.txtHeatNo2.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");
- }
- }
- if (chkPlineCode.Checked)
- {
- plinCode = ultraTextEditor1.Tag.ToString().Replace(",", "', '");
- }
- List<QcmZgJugdeApplyEntity2> listSource = EntityHelper.GetData<QcmZgJugdeApplyEntity2>(
- "com.steering.mes.signature.FrmInOnlineStore.QueryZgJugdeApply", new object[] { jugeNo, startTim, endTim, plinCode }, this.ob);
- qcmZgJugdeApplyEntityBindingSource.DataSource = listSource;
- GridHelper.RefreshAndAutoSize(ultraGrid1);
- }
-
- private void chkTim2_CheckedChanged(object sender, EventArgs e)
- {
- this.StartTime2.Enabled = this.EndTime2.Enabled = this.chkTim2.Checked;
- }
- private void chkHeatNo2_CheckedChanged(object sender, EventArgs e)
- {
- this.txtHeatNo2.Enabled = this.chkHeatNo2.Checked;
- }
- private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- ChoicePlineFrm frm = new ChoicePlineFrm(_dtPline, ultraTextEditor1.Tag.ToString2(), this.ob);
- if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- ultraTextEditor1.Text = frm.ChoicePlineName;
- ultraTextEditor1.Tag = frm.ChoicePlineCode;
- }
- }
- private void chkPlineCode_CheckedChanged(object sender, EventArgs e)
- {
- this.ultraTextEditor1.Enabled = this.chkPlineCode.Checked;
- }
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- List<QcmZgJudgeInputRecordEntity> listSource = EntityHelper.GetData<QcmZgJudgeInputRecordEntity>(
- "com.steering.mes.signature.FrmInOnlineStore.QueryZgApplyInputRecord", new object[] { uRow.Cells["JugdeApplyCode"].Value.ToString(), uRow.Cells["JugdeApplySequeno"].Value.ToString(), uRow.Cells["JudgeStoveNo"].Value.ToString(), uRow.Cells["BatchNo"].Value.ToString(), uRow.Cells["BatchGroudNo"].Value.ToString() }, this.ob);
- bindingSource1.DataSource = listSource;
- }
-
-
- }
- }
|