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 | 234 +++++++++++++++++++++++++++++++++++++++------------------ 1 files changed, 159 insertions(+), 75 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs index 3d7cfae..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; @@ -6,14 +9,17 @@ using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; +using System.Configuration; using System.Data; using System.Drawing; +using System.Net; using System.Windows.Forms; namespace Gs.DevApp.DevFrm { public partial class Frm_MesQaItemsDetect01 : DevExpress.XtraEditors.XtraForm { + int _currentHandle5 =0; string _webServiceName = "MesQaItemsDetect01Manager/"; List<FilterEntity> _filterList = new List<FilterEntity>(); public Frm_MesQaItemsDetect01() @@ -39,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 = "鏆傛湭鏌ユ壘鍒板尮閰嶇殑鏁版嵁!"; @@ -50,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(); @@ -61,6 +81,7 @@ this.btnLoad.Click += BtnLoad_Click; ucUpFile1.UpChanged += UcUpFile1_UpChanged; xtraTabControl2.SelectedPageChanged += XtraTabControl2_SelectedPageChanged; + } private void GcMx1_MouseClick(object sender, MouseEventArgs e) @@ -68,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); } @@ -94,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) @@ -143,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("", @@ -203,6 +202,8 @@ MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); if (_rtn.rtnCode > 0) { + txtJianYan.Text = ""; + getModel(lbGuid.Text.Trim(), false, 999); } } catch (Exception ex) @@ -267,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> @@ -393,8 +426,8 @@ var _obj = new { guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓 - fngDesc=txt_fngDesc.Text.Trim(), - lotNo1=txt_lotNo1.Text.Trim(), + fngDesc = txt_fngDesc.Text.Trim(), + lotNo1 = txt_lotNo1.Text.Trim(), }; try { @@ -493,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 { @@ -508,7 +547,6 @@ { ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } - _loading.Stop(); } @@ -625,7 +663,53 @@ return; if (e.Button.Index == 0) { - MsgHelper.Warning("鎻愮ず锛�" + "寮�鍙戜腑"); + try + { + var dr = gvMx3.GetDataRow(rowhandle); + var urlPath = dr["urlPath"].ToString(); + Gs.DevApp.UserControl.ShowFile frm = new ShowFile(urlPath); + frm.ShowDialog(); + } + catch (Exception ex) + { + Gs.DevApp.ToolBox.MsgHelper.ShowError(ex.Message); + } + + } + } + + private void repositoryItemButtonEdit3_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) + { + var rowhandle = gvMx3.FocusedRowHandle; + if (rowhandle < 0) + return; + if (e.Button.Index == 0) + { + try + { + var dr = gvMx3.GetDataRow(rowhandle); + var urlPath = dr["urlPath"].ToString(); + using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog()) + { + folderBrowserDialog.Description = "閫夋嫨瀵煎嚭鏂囦欢鐨勪繚瀛樿矾寰�"; + DialogResult dialogResult = folderBrowserDialog.ShowDialog(); + if (dialogResult == DialogResult.OK) + { + string _folder = folderBrowserDialog.SelectedPath; + string _folderName = _folder + "\\" + urlPath; + string _url = ConfigurationManager.AppSettings["WebApiUrl"].ToString() + "upload/" + urlPath; + using (WebClient client = new WebClient()) + { + client.DownloadFile(_url, _folderName); + } + ToolBox.MsgHelper.ShowInformation("涓嬭浇鎴愬姛锛�"); + } + } + } + catch (Exception ex) + { + Gs.DevApp.ToolBox.MsgHelper.ShowError(ex.Message); + } } } } -- Gitblit v1.9.3