From b94097020bf79e3d5f046ac4fbd3c05efcda30b3 Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期二, 03 十二月 2024 15:16:27 +0800 Subject: [PATCH] 删除了用户空间的id --- DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs | 182 +++++++++++++++++++++++++++------------------ 1 files changed, 109 insertions(+), 73 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs index bc7044e..d71d3e9 100644 --- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs +++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs @@ -1,3 +1,6 @@ +using DevExpress.Utils.About; +using DevExpress.XtraGrid.Views.Grid.ViewInfo; +using DevExpress.XtraRichEdit.Model; using Gs.DevApp.Entity; using Gs.DevApp.ToolBox; using Gs.DevApp.UserControl; @@ -16,6 +19,7 @@ { public partial class Frm_MesQaItemsDetect01 : DevExpress.XtraEditors.XtraForm { + int _currentHandle5 =0; string _webServiceName = "MesQaItemsDetect01Manager/"; List<FilterEntity> _filterList = new List<FilterEntity>(); public Frm_MesQaItemsDetect01() @@ -41,6 +45,22 @@ e.Info.DisplayText = (e.RowHandle + 1).ToString(); } }; + this.gvMx1.IndicatorWidth = 50; + gvMx1.CustomDrawRowIndicator += (s, e) => + { + if (e.Info.IsRowIndicator && e.RowHandle >= 0) + { + e.Info.DisplayText = (e.RowHandle + 1).ToString(); + } + }; + this.gvMx2.IndicatorWidth = 50; + gvMx2.CustomDrawRowIndicator += (s, e) => + { + if (e.Info.IsRowIndicator && e.RowHandle >= 0) + { + e.Info.DisplayText = (e.RowHandle + 1).ToString(); + } + }; gridView1.CustomDrawEmptyForeground += (s, e) => { string str = "鏆傛湭鏌ユ壘鍒板尮閰嶇殑鏁版嵁!"; @@ -52,8 +72,6 @@ gvMx2.OptionsView.ShowGroupPanel = false; gvMx3.OptionsFind.ShowSearchNavButtons = false; gvMx3.OptionsView.ShowGroupPanel = false; - txt_itemId.KeyFile = "id"; - txt_suppId.KeyFile = "id"; txt_itemId.EditChanged += (s, e) => { txt_itemModel.Text = this.txt_itemId.GetModel(); @@ -63,6 +81,7 @@ this.btnLoad.Click += BtnLoad_Click; ucUpFile1.UpChanged += UcUpFile1_UpChanged; xtraTabControl2.SelectedPageChanged += XtraTabControl2_SelectedPageChanged; + } private void GcMx1_MouseClick(object sender, MouseEventArgs e) @@ -70,6 +89,8 @@ string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gvMx1, e, "guid"); if (string.IsNullOrEmpty(rowGuid)) return; + var info = gvMx1.CalcHitInfo(e.Location); + this._currentHandle5 = info.RowHandle; getList12(rowGuid); } @@ -96,29 +117,9 @@ { string strJson = UtilityHelper.HttpPost("", _webServiceName + "ReloadModel5", JsonConvert.SerializeObject(_obj)); ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); - Gs.DevApp.ToolBox.MsgHelper.ShowInformation(_rtn.rtnMsg); if (_rtn.rtnCode > 0) { - dynamic dy = _rtn.rtnData; - lbGuid.Text = strGuid; - 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()); - if (dt.Rows.Count > 0) - { - gcMx1.BindingContext = new BindingContext(); - gcMx1.DataSource = dt; - gcMx1.ForceInitialize(); - getList12(dt.Rows[0]["guid"].ToString()); - } - else - { - Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1); - } + getModel(lbGuid.Text.Trim(), false, 999); } } catch (Exception ex) @@ -145,57 +146,53 @@ string _strCmd = txtJianYan.Text.Trim().ToUpper(); string _strOK = "OK"; string _strNG = "NG"; - if (!(_strCmd.StartsWith(_strOK) || _strCmd.StartsWith(_strNG))) + int n = 0; + 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)) - { + if (!_strCmd.Contains("-")) + { + Gs.DevApp.ToolBox.MsgHelper.ShowError("鍛戒护杈撳叆閿欒锛氳姝g‘浣跨敤OK 鎴� NG 鍛戒护!"); + 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]; + if (int.TryParse(_str2, out n)) + { + } + else + { + Gs.DevApp.ToolBox.MsgHelper.ShowError("鍛戒护杈撳叆閿欒锛氳姝g‘浣跨敤OK 鎴� NG 鍛戒护!"); + return; + } } else { - Gs.DevApp.ToolBox.MsgHelper.ShowError("鍛戒护杈撳叆閿欒锛氳姝g‘浣跨敤OK 鎴� NG 鍛戒护!"); - return; + if (int.TryParse(_strCmd, out n)) + { + } + else + { + Gs.DevApp.ToolBox.MsgHelper.ShowError("鍛戒护杈撳叆閿欒锛氳姝g‘浣跨敤OK 鎴� NG 鍛戒护!"); + return; + } } - for (int i = 0; i < gvMx2.DataRowCount; i++) + var _obj = new { - gvMx2.SetRowCellValue(i, "fcheckResu", _str1); - gvMx2.SetRowCellValue(i, "fstand", _str1); - } - List<MesQaItemsDetectDetail12> lst = new List<MesQaItemsDetectDetail12>(); - for (var i = 0; i < gvMx2.DataRowCount; i++) - { - var row = gvMx2.GetDataRow(i); - if (row != null) - lst.Add(new MesQaItemsDetectDetail12() - { - ParentGuid = UtilityHelper.ToGuid(guid5), - Guid = UtilityHelper.ToGuid(row["guid"].ToString()), - FcheckResu = row["fcheckResu"].ToString(), - GrandpaGuid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), - }); - } - var _obj = lst; + inOrderGuid1 = UtilityHelper.ToGuid(lbGuid.Text.Trim()), ////杩欐槸妫�楠屽崟guid + inOrderGuid5 = guid5,//杩欐槸鎶芥牱鐨刧uid + inP1 = _strCmd,//杩欐槸9锛屾湁鍙兘鏄�19锛屾垨鑰�0k-19,鎴栬�卬g-19 + }; try { var strJson = UtilityHelper.HttpPost("", @@ -205,6 +202,8 @@ MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); if (_rtn.rtnCode > 0) { + txtJianYan.Text = ""; + getModel(lbGuid.Text.Trim(), false, 999); } } catch (Exception ex) @@ -269,18 +268,50 @@ toolBarMenu1.guidKey = rowGuid; } /// <summary> - ///妫�楠屼簨浠� + ///鎻愪氦妫�楠屼簨浠� /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <exception cref="NotImplementedException"></exception> - private void ToolBarMenu1_btnJianYanClick(object sender, EventArgs e) + private async void ToolBarMenu1_btnJianYanClick(object sender, EventArgs e) { toolBarMenu1.guidKey = ""; string rowGuid, rowName; (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_releaseNo, gridView1); toolBarMenu1.guidKey = rowGuid; + if (string.IsNullOrEmpty(rowGuid)) + { + MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); + return; + } + if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鎻愪氦妫�楠屽悧锛�")) + return; + UcLoading _loading = new UcLoading(); + var _obj = new + { + guid = rowGuid, + }; + try + { + var strJson = await UtilityHelper.HttpPostAsync("", + _webServiceName + "EditModelSubmit", + JsonConvert.SerializeObject(_obj)); + var _rtn = UtilityHelper.ReturnToDynamic(strJson); + MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnData.outMsg); + if (_rtn.rtnCode > 0) + { + if (xtraTabControl1.SelectedTabPageIndex == 1) + getModel(lbGuid.Text.Trim(), false, 999); + else + getPageList(1, UtilityHelper.GetPageSize()); + } + } + catch (Exception ex) + { + MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + } + _loading.Stop(); } /// <summary> @@ -495,8 +526,14 @@ gcMx1.BindingContext = new BindingContext(); gcMx1.DataSource = dt; gcMx1.ForceInitialize(); + gvMx1.FocusedRowHandle = _currentHandle5; ucUpFile1.parentGuid = lbGuid.Text.Trim(); - getList12(dt.Rows[0]["guid"].ToString()); + var row = gvMx1.GetDataRow(_currentHandle5); + if (row != null) + { + var rowGuid = row["guid"].ToString(); + getList12(rowGuid); + } } else { @@ -510,7 +547,6 @@ { ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } - _loading.Stop(); } @@ -638,7 +674,7 @@ { Gs.DevApp.ToolBox.MsgHelper.ShowError(ex.Message); } - + } } -- Gitblit v1.9.3