| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- 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 Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.Mcp.Mch.Mcms.entity;
- using CoreFS.CA06;
- using Newtonsoft.Json;
- using Newtonsoft.Json.Serialization;
- namespace Core.StlMes.Client.Mcp.Mch.Mcms
- {
- public partial class FrmUpdate : FrmBase
- {
- public FrmUpdate(OpeBase _ob, string _resultNo,string _recordNo )
- {
- InitializeComponent();
- this.ob = _ob;
- resultNo = _resultNo;
- recordNo = _recordNo;
- }
- public string tabString
- {
- get { return tbOther.Tabs[0].Text; }
- set { tbOther.Tabs[0].Text = value; }
- }
- public string ColumnsM
- {
- get { return matInfo1.ColumnsM; }
- set { matInfo1.ColumnsM = value; }
- }
- public string ColumnsC
- {
- get { return matInfo1.ColumnsC; }
- set { matInfo1.ColumnsC = value; }
- }
- private string resultNo;
- private string recordNo;
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad(e);
- matInfo1.ini(ob);
-
- Dictionary<string,object> dic = new Dictionary<string, object>();
- dic.Add("recordNo", recordNo);
- List<CmmWeightRecordEntityFull> datas = EntityHelper.GetData<CmmWeightRecordEntityFull>(
- "com.steering.Mcms.RecordServer.doQueryRecord",
- new object[] { dic },
- ob);
- if (datas != null && datas.Any())
- {
- CmmWeightRecordEntityFull data = datas[0];
- data.MatInfos = EntityHelper.GetData<CmmWeightMatEntity>(
- "com.steering.Mcms.PoundMatServer.doQuery",
- new object[] { dic },
- ob);
- matInfo1.SetDefault(data);
- }
-
-
- }
- private void ubtOK_Click(object sender, EventArgs e)
- {
- CmmWeightRecordEntityFull data = matInfo1.GetData();
- if (data.MatInfos != null && data.MatInfos.Any())
- {
- data.MatInfos.ForEach(p=>p.ResultNo = resultNo);
- }
- var json = JsonConvert.SerializeObject(data, Formatting.None,
- new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() });
- var ccp = new CoreClientParam
- {
- ServerName = "com.steering.Mcms.LocalTruckScale",
- MethodName = "DoUpdate",
- ServerParams = new object[]
- {
- resultNo,
- json
-
- }
- };
- ccp = ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
-
- if (ccp.ReturnInfo.ToString2().Contains("操作成功"))
- {
- MessageUtil.ShowTips("修改成功");
- this.DialogResult = DialogResult.OK;
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
-
- }
- }
- }
|