From fdf29b90b20454c0328fbeb2e122c5f2dfbb5698 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期六, 02 十一月 2024 17:44:28 +0800
Subject: [PATCH] 加了guid
---
DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs | 128 ++++++++++++++++++++++++++++--------------
1 files changed, 85 insertions(+), 43 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs
index 24dd2ee..c37f659 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs
@@ -1,3 +1,4 @@
+using DevExpress.DataAccess.Wizard.Model;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
using Gs.DevApp.Entity;
@@ -13,6 +14,7 @@
using System.IO;
using System.Net.Http;
using System.Threading.Tasks;
+using System.Windows.Controls;
using System.Windows.Forms;
namespace Gs.DevApp.DevFrm
@@ -31,6 +33,7 @@
this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
+ this.toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
gcMain.MouseDoubleClick += GcMain_MouseDoubleClick;
gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged;
getPageList(1, UtilityHelper.GetPageSize());
@@ -49,16 +52,63 @@
Rectangle r = new Rectangle(gridView1.GridControl.Width / 2 - 100, e.Bounds.Top + 45, e.Bounds.Right - 5, e.Bounds.Height - 5);
e.Graphics.DrawString(str, f, Brushes.Gray, r);
};
-
+ //涓婁紶闄勪欢
btnUpSelect.Click += BtnUpSelect_Click;
btnUp.Click += BtnUp_Click;
-
//鍒濆鍖栫墿鏂欓�夋嫨鍜屽悇绉嶄笅鎷�
+ gvMx2.OptionsFind.ShowSearchNavButtons = false;
+ gvMx2.OptionsView.ShowGroupPanel = false;
_setIno();
+ txtJianYan.KeyDown += TxtJianYan_KeyDown;
}
-
+ private void TxtJianYan_KeyDown(object sender, KeyEventArgs e)
+ {
+ if (e.KeyCode == Keys.Enter)
+ {
+ string _strCmd = txtJianYan.Text.Trim().ToUpper();
+ string _strOK = "OK";
+ string _strNG = "NG";
+ if (!(_strCmd.StartsWith(_strOK) || _strCmd.StartsWith(_strNG)))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("鍛戒护杈撳叆閿欒锛氳姝g‘浣跨敤OK 鎴� NG 鍛戒护!");
+ return;
+ }
+ if (!_strCmd.Contains("-"))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("鍛戒护杈撳叆閿欒锛氱己灏� 涓敾绾�!");
+ return;
+ }
+ string[] _ary = _strCmd.Split('-');
+ if (_ary.Length != 2)
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("鍛戒护杈撳叆閿欒锛氾細璇锋纭娇鐢∣K 鎴� NG 鍛戒护!");
+ return;
+ }
+ string _str1 = _ary[0];
+ if (!(_str1 == _strOK || _str1 == _strNG))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("鍛戒护杈撳叆閿欒锛氳姝g‘浣跨敤OK 鎴� NG 鍛戒护!");
+ return;
+ }
+ string _str2 = _ary[1];
+ int n;
+ if (int.TryParse(_str2, out n))
+ {
+ }
+ else
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("鍛戒护杈撳叆閿欒锛氳姝g‘浣跨敤OK 鎴� NG 鍛戒护!");
+ return;
+ }
+ for (int i = 0; i < gvMx2.DataRowCount; i++)
+ {
+ gvMx2.SetRowCellValue(i, "fcheckResu", _str1);
+ gvMx2.SetRowCellValue(i, "fstand", _str1);
+ }
+ }
+ }
/// <summary>
/// 鍙屽嚮浜嬩欢
@@ -101,7 +151,14 @@
_filterList = e.FilterList;
getPageList(1, pageBar1.RowsCount);
}
-
+ private void ToolBarMenu1_btnChkClick(object sender, EventArgs e)
+ {
+ toolBarMenu1.guidKey = "";
+ string rowGuid, rowName;
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+ lbGuid, txt_releaseNo, gridView1);
+ toolBarMenu1.guidKey = rowGuid;
+ }
/// <summary>
/// 鍙栨秷浜嬩欢
/// </summary>
@@ -120,7 +177,7 @@
private void ToolBarMenu1_btnDelClick1(object sender, EventArgs e)
{
string rowGuid = "", rowName = "";
- // (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1);
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_releaseNo, gridView1);
if (string.IsNullOrEmpty(rowGuid))
{
ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
@@ -166,7 +223,7 @@
private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e)
{
string rowGuid = "", rowName = "";
- // (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1);
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_releaseNo, gridView1);
if (string.IsNullOrEmpty(rowGuid))
{
ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
@@ -185,6 +242,7 @@
lbGuid.Text = "";
List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
gridViews.Add(gvMx1);
+ gridViews.Add(gvMx2);
UtilityHelper.CleanValueByControl(this.panel1.Controls, true, gridViews);
Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
}
@@ -289,14 +347,14 @@
lbGuid.Text = strGuid;
List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
gvList.Add(gvMx1);
- UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit, gvList);
- JObject _job = JObject.Parse(strJson);
- JArray array = new JArray();
- foreach (var a in _job["rtnData"]["list"])
+ UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit, gvList);
+ JObject _job = JObject.Parse(strJson);
+ JArray array = new JArray();
+ foreach (var a in _job["rtnData"]["list5"])
{
array.Add(a);
}
- DataTable dt = JsonConvert.DeserializeObject<DataTable>(array.ToString());
+ DataTable dt = JsonConvert.DeserializeObject<DataTable>(array.ToString());
if (dt.Rows.Count > 0)
{
gcMx1.BindingContext = new BindingContext();
@@ -384,7 +442,6 @@
#endregion
-
private void _setIno()
{
txt_itemId.KeyFile = "id";
@@ -393,43 +450,28 @@
txt_itemModel.Text = this.txt_itemId.GetModel();
txt_itemNo.Text = this.txt_itemId.GetCode();
};
- _getListCyxx();
}
- private void _getListCyxx()
- {
- //var pgq = new PageQueryModel(1, 999999, "CREATE_DATE", "asc", "",
- // " and 1=1");
- //var json = JsonConvert.SerializeObject(pgq);
- //try
- //{
- // var strReturn = UtilityHelper.HttpPost("",
- // "MesQmAql1Manager/GetListPage", json);
- // var rtn = UtilityHelper.ReturnToTablePage(strReturn);
- // var dt = rtn.rtnData.list;
- // foreach (DataRow dr in dt.Rows)
- // {
- // rptJYBZ.Items.Add((new CboItemEntity(dr["SampleSizeNo"].ToString(), dr["SampleSizeName"].ToString())));
- // //string ddddd = dr["SampleSizeName"].ToString();
- // }
- //}
- //catch (Exception ex)
- //{
- // MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
- // Close();
- // Application.Exit();
- //}
- }
+ /// <summary>
+ /// 璇诲彇妫�楠岀粨鏋�
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
{
- var rowGuid = "";
- var myDataRow = gridView1.GetDataRow(e.FocusedRowHandle);
+ var myDataRow = gvMx1.GetDataRow(e.FocusedRowHandle);
if (myDataRow == null) return;
- rowGuid = myDataRow["guid"].ToString();
- MessageBox.Show(rowGuid);
- var json = JsonConvert.SerializeObject(rowGuid);
+ var _obj = new
+ {
+ parentGuid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
+ guid = UtilityHelper.ToGuid(myDataRow["guid"].ToString()), //涓诲缓
+ //id = myDataRow["id"].ToString(),
+ id = -1,
+ checkQyt = myDataRow["checkQyt"].ToString(),
+ chkItem = myDataRow["fcheckItem"].ToString()
+ };
try
{
- var strReturn = UtilityHelper.HttpPost("", _webServiceName+ "GetCheckResultList", json);
+ var strReturn = UtilityHelper.HttpPost("", _webServiceName + "GetCheckResultList12", JsonConvert.SerializeObject(_obj));
var dd = UtilityHelper.ReturnToList(strReturn);
var dt = dd.rtnData;
gcMx2.BindingContext = new BindingContext();
--
Gitblit v1.9.3