| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- 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;
- using CoreFS.CA06;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Control;
- using Infragistics.Win.UltraWinGrid;
- using Infragistics.Win;
- using System.Collections;
- using Core.Mes.Client.Comm.Tool;
- using Core.Mes.Client.Comm.Format;
- using Core.StlMes.Client.Mcp.Entity;
- namespace Core.StlMes.Client.Mcp.Coupling
- {
- public partial class FrmQcmJgWt : FrmBase
- {
- private string _JugdeApplyCode = "";
- private string User = "";
- private DataTable _dtMatList = null;
- private OpeBase _ob = null;
- private ComMscJgEntity slmEntity = null;
- private string _woid;
- internal ComMscJgEntity SlmEntity
- {
- get { return slmEntity; }
- set { slmEntity = value; }
- }
- public FrmQcmJgWt(string jugdeApplyCode,string woid, OpeBase ob)
- {
- InitializeComponent();
- _JugdeApplyCode = jugdeApplyCode;
- _woid = woid;
- _ob = ob;
- InitCol();
-
- }
-
- /// <summary>
- /// 初始化控件
- /// </summary>
- private void InitCol()
- {
- QueryQcmAddAsk();
- }
- /// <summary>
- /// 查询接箍单个重
- /// </summary>
- /// <param name="JudgeStoveNo"></param>
- private void QueryQcmAddAsk()
- {
- List<ComMscJgEntity> listSource = null;
- DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.FrmCouplingAppl.doQueryJgWt", new object[] { _JugdeApplyCode }, this._ob);
- if (dt.Rows.Count > 0 && dt != null)
- {
- listSource = EntityHelper.GetData<ComMscJgEntity>(
- "com.steering.mes.mcp.coup.FrmCouplingAppl.doQueryJgWt", new object[] { _JugdeApplyCode }, this._ob);
- qcmAddAskEntityBindingSource.DataSource = listSource;
- }
- }
- /// <summary>
- /// 确认
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnOK_Click(object sender, EventArgs e)
- {
- this.ultraGrid3.UpdateData();
- UltraGridRow ugrP = this.ultraGrid3.ActiveRow;
- if (ugrP == null)
- {
- MessageUtil.ShowTips("请选择相应合同信息!");
- return;
- }
- ArrayList arrayList = new ArrayList();
- for (int i = 0; i < ultraGrid3.Rows.Count; i++)
- {
- ComMscJgEntity ParmEntity = new ComMscJgEntity();
- ParmEntity = (ComMscJgEntity)this.ultraGrid3.Rows[i].ListObject;
- ParmEntity.CodeJg = _JugdeApplyCode;
- arrayList.Add(JSONFormat.Format(ParmEntity));
- }
- int count2 = ServerHelper.SetData("com.steering.mes.mcp.coup.FrmCouplingAppl.doUpdateJgWt", new object[] { arrayList,_woid }, this._ob);
- if (count2 > 0)
- {
- slmEntity = (ComMscJgEntity)ugrP.ListObject;
- this.DialogResult = System.Windows.Forms.DialogResult.OK;
- }
- MessageUtil.ShowTips("确认成功!");
- this.Close();
- }
-
- /// <summary>
- /// 取消
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnCancel_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- private void FrmQcmJgWt_Load(object sender, EventArgs e)
- {
- EntityHelper.ShowGridCaption<ComMscJgEntity>(ultraGrid3.DisplayLayout.Bands[0]);
- }
- private void ultraGrid3_CellChange(object sender, CellEventArgs e)
- {
- string minD = "";//接箍坯料外径
- string minH = "";//壁厚
- string weightJg = "";//接箍单重
- UltraGridRow urg = ultraGrid3.ActiveRow;
- if (urg == null)
- {
- return;
- }
- else
- {
- minD = urg.Cells["MinD"].Value.ToString();
- minH = urg.Cells["MinH"].Value.ToString();
- weightJg = urg.Cells["WeightJg"].Value.ToString();
- }
- ultraGrid3.UpdateData();
- if (e.Cell.Column.Key.Equals("WeightJg") && urg.Cells["WeightJg"].Text != "")
- {
- if(0.02466*(Convert.ToDouble(minD) - Convert.ToDouble(minH))*Convert.ToDouble(minH)*0.95<Convert.ToDouble(weightJg))
- {
- MessageUtil.ShowTips("输入重量不能大于接箍码重!");
- return;
- }
- }
- }
- }
- }
|