| | |
| | | using DevExpress.Utils.DirectXPaint; |
| | | using DevExpress.XtraEditors; |
| | | using Gs.DevApp.ToolBox; |
| | | using Gs.DevApp.ToolBox; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Data; |
| | | using System.Drawing; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using System.Windows.Forms; |
| | | |
| | | namespace Gs.DevApp.DevFrm.FQC |
| | |
| | | { |
| | | InitializeComponent(); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx14); |
| | | txtChouJian.KeyDown += TxtChouJian_KeyDown; |
| | | } |
| | | private string _val; |
| | | |
| | | private void TxtChouJian_KeyDown(object sender, KeyEventArgs e) |
| | | { |
| | | string _strCmd = txtChouJian.Text.Trim(); |
| | | if (e.KeyCode == Keys.Enter) |
| | | { |
| | | if (string.IsNullOrEmpty(_strCmd)) |
| | | { |
| | | ToolBox.MsgHelper.Warning("提示:请先录入条码!"); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(pGuid)) |
| | | { |
| | | ToolBox.MsgHelper.Warning("提示:请先完善检验单!"); |
| | | return; |
| | | } |
| | | if (e.KeyCode == Keys.Enter) |
| | | { |
| | | var _obj = new |
| | | { |
| | | pGuid = pGuid, //这是检验单guid |
| | | itemBarCode = _strCmd,//或者0k-19,或者ng-19 |
| | | }; |
| | | try |
| | | { |
| | | var strJson = UtilityHelper.HttpPost("", |
| | | _webServiceName + "EdtModel14", |
| | | JsonConvert.SerializeObject(_obj)); |
| | | var _rtn = UtilityHelper.ReturnToDynamic(strJson); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | JObject _job = JObject.Parse(strJson); |
| | | JArray array = new JArray(); |
| | | foreach (var a in _job["rtnData"]["list"]) |
| | | { |
| | | array.Add(a); |
| | | } |
| | | DataTable dt = JsonConvert.DeserializeObject<DataTable>(array.ToString()); |
| | | gcMx14.BindingContext = new BindingContext(); |
| | | gcMx14.DataSource = dt; |
| | | gcMx14.ForceInitialize(); |
| | | gvMx14.BestFitColumns(); |
| | | } |
| | | else |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowInformation(_rtn.rtnMsg); |
| | | } |
| | | txtChouJian.Text = ""; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 主键 |
| | | /// </summary> |
| | | public string pGuid |
| | | { |
| | | get; |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 是否可录入 |
| | | /// </summary> |
| | | public void IsReadOnly(bool bl) |
| | | { |
| | | this.txtChouJian.ReadOnly =bl; |
| | | } |
| | | /// <summary> |
| | | /// 这是记录表 |
| | | /// </summary> |
| | | public void getList14() |