From d35bb711f8d3d267b44b4a80c20e31dabf309ae7 Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期二, 14 一月 2025 08:17:18 +0800 Subject: [PATCH] 其它入库 --- DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.cs | 532 ++++++++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 379 insertions(+), 153 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.cs index 3b95868..5f2c13c 100644 --- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.cs +++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.cs @@ -7,9 +7,7 @@ using System.Collections.Generic; using System.Configuration; using System.Data; -using System.Drawing; -using System.IO; -using System.Net.Http; +using System.Net; using System.Threading.Tasks; using System.Windows.Forms; @@ -22,51 +20,61 @@ public Frm_MesQaItemsDetect01Check() { InitializeComponent(); + this.toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick; + this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick; + this.toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick; this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick; this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; - this.toolBarMenu1.btnZhiLiangChkClick += ToolBarMenu1_btnZhiLiangChkClick; - this.toolBarMenu1.btnZhiLiangFchkClick += ToolBarMenu1_btnZhiLiangFchkClick; - this.toolBarMenu1.btnCaiGouChkClick += ToolBarMenu1_btnCaiGouChkClick; - this.toolBarMenu1.btnCaiGouFchkClick += ToolBarMenu1_btnCaiGouFchkClick; + this.toolBarMenu1.btnChkClick += ToolBarMenu1_btnZhiLiangChkClick; + this.toolBarMenu1.btnFChkClick += ToolBarMenu1_btnZhiLiangFchkClick; + this.toolBarMenu1.btnBoHuiClick += ToolBarMenu1_btnBoHuiClick; + toolBarMenu1.btnReportClick += ToolBarMenu1_btnReportClick; + toolBarMenu1.btnDesignClick += ToolBarMenu1_btnDesignClick; toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick; - gcMain.MouseDoubleClick += GcMain_MouseDoubleClick; - gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged; - getPageList(1, UtilityHelper.GetPageSize()); + Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1); + Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1); + Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2); + Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx3); + Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "modifyFlagTxt", "", (value) => + { + Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0); + }); + Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) => + { + getModel(value); + }, (value) => + { + getPageList(this.pageBar1.CurrentPage); + }); + getPageList(1); pageBar1.PagerEvent += PageBar1_PagerEvent; - gridView1.CustomDrawRowIndicator += (s, e) => - { - if (e.Info.IsRowIndicator && e.RowHandle >= 0) - { - e.Info.DisplayText = (e.RowHandle + 1).ToString(); - } - }; - gridView1.CustomDrawEmptyForeground += (s, e) => - { - string str = "鏆傛湭鏌ユ壘鍒板尮閰嶇殑鏁版嵁!"; - Font f = new Font("寰蒋闆呴粦", 16); - 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(); + ucUpFile1.UpChanged += UcUpFile1_UpChanged; + xtraTabControl2.SelectedPageChanged += XtraTabControl2_SelectedPageChanged; + gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged; } - - - /// <summary> - /// 鍙屽嚮浜嬩欢 - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - private void GcMain_MouseDoubleClick(object sender, MouseEventArgs e) + private void GridView1_ColumnFilterChanged(object sender, EventArgs e) { - string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gridView1, e, "guid"); - if (!string.IsNullOrEmpty(rowGuid)) - getModel(rowGuid, false, 999); + _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns); + Task.Delay(100); + getPageList(1); + } + private void GcMx1_MouseClick(object sender, MouseEventArgs e) + { + string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gvMx1, e, "guid"); + if (string.IsNullOrEmpty(rowGuid)) + return; + getList12(rowGuid); + } + private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) + { + if (e.FocusedRowHandle >= 0) + { + DataRow row = gvMx1.GetDataRow(e.FocusedRowHandle); + string rowGuid = row["guid"].ToString(); + if (string.IsNullOrEmpty(rowGuid)) + return; + getList12(rowGuid); + } } /// <summary> /// 鍒嗛〉浜嬩欢 @@ -75,7 +83,7 @@ /// <param name="pageSize"></param> private void PageBar1_PagerEvent(int curPage, int pageSize) { - getPageList(curPage, pageSize); + getPageList(curPage); } /// <summary> /// 鏌ヨ浜嬩欢 @@ -84,7 +92,10 @@ /// <param name="e"></param> private void ToolBarMenu1_btnQueryClick(object sender, EventArgs e) { - Gs.DevApp.UserControl.ShowFilter frm = new Gs.DevApp.UserControl.ShowFilter(gridView1.Columns, _filterList); + gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; + gridView1.ActiveFilter.Clear(); + gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; + var frm = new ShowFilter(gridView1.Columns, _filterList); frm.UpdateParent += Frm_UpdateParent; frm.ShowDialog(); } @@ -96,7 +107,7 @@ private void Frm_UpdateParent(object sender, UpdateParentEventArgs e) { _filterList = e.FilterList; - getPageList(1, pageBar1.RowsCount); + getPageList(1); } private void ToolBarMenu1_btnLogClick(object sender, EventArgs e) { @@ -106,40 +117,125 @@ lbGuid, txt_releaseNo, gridView1); toolBarMenu1.guidKey = rowGuid; } - private void ToolBarMenu1_btnCaiGouFchkClick(object sender, EventArgs e) + /// <summary> + /// 鍙栨秷浜嬩欢 + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void ToolBarMenu1_btnEscClick(object sender, EventArgs e) { - toolBarMenu1.guidKey = ""; - string rowGuid, rowName; - (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, - lbGuid, txt_releaseNo, gridView1); - toolBarMenu1.guidKey = rowGuid; + Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1); + } + /// <summary> + /// 淇濆瓨浜嬩欢 + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e) + { + toolBarMenu1.isSetBtn = false; + if (string.IsNullOrEmpty(txt_fngHandle.Text.Trim())) + { + Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨澶勭悊鏂瑰紡锛�"); + txt_fngDesc.Focus(); + return; + } + if (string.IsNullOrEmpty(txt_fmrmode.Text.Trim())) + { + Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨閫�鏂欐柟寮忥紒"); + txt_fmrmode.Focus(); + return; + } + var _obj = new + { + guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓 + fngHandle = txt_fngHandle.Text.Trim(), + fmrmode = txt_fmrmode.Text.Trim(), + }; + try + { + string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj)); + ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); + ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); + if (_rtn.rtnCode > 0) + { + lbGuid.Text = _rtn.rtnData; + toolBarMenu1.isSetBtn = true; + UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false); + } + } + catch (Exception ex) + { + ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + } } - private void ToolBarMenu1_btnCaiGouChkClick(object sender, EventArgs e) + /// <summary> + /// 淇敼浜嬩欢 + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e) { - toolBarMenu1.guidKey = ""; + string rowGuid = "", rowName = ""; + (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_releaseNo, gridView1); + if (string.IsNullOrEmpty(rowGuid)) + { + ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); + return; + } + Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3); + UtilityHelper.ChangeEnableByControl(panel1.Controls, true); + } + private void ToolBarMenu1_btnDesignClick(object sender, EventArgs e) + { string rowGuid, rowName; (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, - lbGuid, txt_releaseNo, gridView1); + lbGuid, txt_itemName, gridView1); toolBarMenu1.guidKey = rowGuid; + toolBarMenu1.rptParameter = "rpt_Detect01{}"; + } + private void ToolBarMenu1_btnReportClick(object sender, EventArgs e) + { + string rowGuid, rowName; + (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, + lbGuid, txt_itemName, gridView1); + toolBarMenu1.guidKey = rowGuid; + this.toolBarMenu1.rptParameter = "rpt_Detect01{" + "1" + + "," + "1" + + "," + "1" + + "," + "1" + + "," + "1" + + "}"; } + /// <summary> + /// 椹冲洖 + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void ToolBarMenu1_btnBoHuiClick(object sender, EventArgs e) + { + toolBarMenu1.guidKey = ""; + _toolCk(-1); + } + /// <summary> + /// 璐ㄩ噺鍙嶅鏍� + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> private void ToolBarMenu1_btnZhiLiangFchkClick(object sender, EventArgs e) { - toolBarMenu1.guidKey = ""; - string rowGuid, rowName; - (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, - lbGuid, txt_releaseNo, gridView1); - toolBarMenu1.guidKey = rowGuid; + _toolCk(0); } - + /// <summary> + /// 璐ㄩ噺瀹℃牳 + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> private void ToolBarMenu1_btnZhiLiangChkClick(object sender, EventArgs e) { - toolBarMenu1.guidKey = ""; - string rowGuid, rowName; - (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, - lbGuid, txt_releaseNo, gridView1); - toolBarMenu1.guidKey = rowGuid; + _toolCk(1); } /// <summary> @@ -149,41 +245,52 @@ /// <param name="e"></param> private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e) { - UtilityHelper.JumpToTab(xtraTabControl1, 0); - getPageList(1, UtilityHelper.GetPageSize()); + if (xtraTabControl1.SelectedTabPageIndex == 1) + getModel(lbGuid.Text.Trim()); + else + { + _filterList.Clear(); + if (gridView1.ActiveFilter.Count > 0) + { + gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; + gridView1.ActiveFilter.Clear(); + gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; + } + getPageList(1); + } } - + /// <summary> /// /// </summary> /// <param name="curPage">绗嚑椤�</param> /// <param name="pageSize">姣忛〉鍑犳潯</param> - private async void getPageList(int curPage, int pageSize) + private void getPageList(int curPage) { - UcLoading _loading = new UcLoading(); - System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder(); - foreach (FilterEntity itm in _filterList) - { - _sbSqlWhere.Append(" and " + itm.fileId + itm.fileOper + "'" + itm.fileValue + "'"); - } - PageQueryModel pgq = new PageQueryModel(curPage, pageSize, "create_date", "asc", "", _sbSqlWhere.ToString()); + var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); + _sbSqlWhere += " and isnull(fsubmit,0)=1"; + PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString()); string json = JsonConvert.SerializeObject(pgq); try { - string strReturn = await UtilityHelper.HttpPostAsync("", _webServiceName + "GetListPage", json); + string strReturn = UtilityHelper.HttpPost("", _webServiceName + "GetListPage", json); ReturnModel<PageListModel> dd = UtilityHelper.ReturnToTablePage(strReturn); if (dd.rtnCode > 0) { DataTable dt = dd.rtnData.list; gcMain.BindingContext = new BindingContext(); - gcMain.DataSource = dt; - gcMain.ForceInitialize(); - int dddd = dd.rtnData.pages;//鎬婚〉 - pageBar1.TotalPages = dddd; - pageBar1.RecordCount = dd.rtnData.total;//璁板綍鎬绘暟 + gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; + if (dt.Rows.Count > 0) + { + gcMain.DataSource = dt; + gcMain.ForceInitialize(); + } + else + UtilityHelper.SetDefaultTable(gcMain, gridView1); + gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; + pageBar1.TotalPages = dd.rtnData.pages;//鎬婚〉 pageBar1.CurrentPage = curPage;//褰撳墠椤� - pageBar1.RowsCount = pageSize;//姣忛〉鏄剧ず - pageBar1.setTxt(); + pageBar1.RecordCount = dd.rtnData.total;//鎬昏褰曟暟 } else { @@ -194,16 +301,18 @@ { ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } - _loading.Stop(); + } - private void getModel(string strGuid, bool isEdit, int tabIdx) + private void getModel(string strGuid) { + bool isEdit = false; + if (toolBarMenu1.currentAction == "add") return; + if (toolBarMenu1.currentAction == "edit") isEdit = true; if (string.IsNullOrEmpty(strGuid)) { ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); return; } - UtilityHelper.JumpToTab(xtraTabControl1, tabIdx); var _obj = new { guid = strGuid,//涓诲缓 @@ -231,6 +340,8 @@ gcMx1.BindingContext = new BindingContext(); gcMx1.DataSource = dt; gcMx1.ForceInitialize(); + ucUpFile1.parentGuid = lbGuid.Text.Trim(); + getList12(dt.Rows[0]["guid"].ToString()); } else { @@ -244,103 +355,70 @@ { ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } + } - - - - #region 鏂囦欢涓婁紶 - /// <summary> - /// 閫夋嫨涓婁紶鏂囦欢 + /// 閫夐」鍗″垏鎹� /// </summary> /// <param name="sender"></param> /// <param name="e"></param> - private void BtnUpSelect_Click(object sender, EventArgs e) + private void XtraTabControl2_SelectedPageChanged(object sender, DevExpress.XtraTab.TabPageChangedEventArgs e) { - var openFileDialog = new OpenFileDialog(); - // 璁剧疆鍒濆鐩綍 - openFileDialog.InitialDirectory = "c:\\"; - // 璁剧疆鏂囦欢杩囨护閫夐」锛屽锛�"鏂囨湰鏂囦欢 (*.txt)|*.txt|鎵�鏈夋枃浠� (*.*)|*.*" - openFileDialog.Filter = "鏂囨湰鏂囦欢 (*.txt)|*.txt|鎵�鏈夋枃浠� (*.*)|*.*"; - // 璁剧疆鏍囬 - openFileDialog.Title = "閫夋嫨鏂囦欢"; - // 鏄剧ず瀵硅瘽妗� - var result = openFileDialog.ShowDialog(); - // 纭鐢ㄦ埛娌℃湁鍙栨秷鎿嶄綔 - if (result == DialogResult.OK) + if (e.Page.Name == "tabMxPage3") { - // 鑾峰彇閫変腑鐨勬枃浠惰矾寰� - var filePath = openFileDialog.FileName; - Console.WriteLine($"閫変腑鐨勬枃浠�: {filePath}"); - txtUpUrl.Text = filePath; + getFileList(); } } - /// <summary> - /// 纭畾涓婁紶 + /// 涓婁紶鍚庡埛鏂版枃浠跺垪琛� /// </summary> /// <param name="sender"></param> /// <param name="e"></param> - private async void BtnUp_Click(object sender, EventArgs e) + private void UcUpFile1_UpChanged(object sender, EventArgs e) { - var WebApiUrl = ConfigurationSettings.AppSettings.Get("WebApiUrl"); - var address = WebApiUrl + "Upload/UploadFile"; - var filePath = txtUpUrl.Text.Trim(); - var apiUrl = address; // 鏇挎崲涓轰綘鐨凙PI鍦板潃 - await UploadFileAsync(apiUrl, filePath); + getFileList(); } - - private async Task UploadFileAsync(string url, string filePath) + private void getFileList() { - UcLoading _loading = new UcLoading(); - using (var httpClient = new HttpClient()) - using (var form = new MultipartFormDataContent()) + System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder(); + _sbSqlWhere.Append(" and parent_Guid='" + lbGuid.Text.Trim() + "'"); + PageQueryModel pgq = new PageQueryModel(1, 100, "create_date", "asc", "", _sbSqlWhere.ToString()); + string json = JsonConvert.SerializeObject(pgq); + try { - httpClient.DefaultRequestHeaders.Add("token", - UtilityHelper.GetBasicAuthTicket()); - using (var fs = File.OpenRead(filePath)) - using (var streamContent = new StreamContent(fs)) + string strReturn = UtilityHelper.HttpPost("", "MesFile/GetListPage", json); + ReturnModel<PageListModel> dd = UtilityHelper.ReturnToTablePage(strReturn); + if (dd.rtnCode > 0) { - form.Add(streamContent, "file", Path.GetFileName(filePath)); - var response = await httpClient.PostAsync(url, form); - var responseString = - await response.Content.ReadAsStringAsync(); - MessageBox.Show(responseString); + DataTable dt = dd.rtnData.list; + gcMx3.BindingContext = new BindingContext(); + gcMx3.DataSource = dt; + gcMx3.ForceInitialize(); + } + else + { + ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + dd.rtnMsg); } } - _loading.Close(); - } - - #endregion - - private void _setIno() - { - txt_itemId.KeyFile = "id"; - txt_itemId.EditChanged += (s, e) => + catch (Exception ex) { - txt_itemModel.Text = this.txt_itemId.GetModel(); - txt_itemNo.Text = this.txt_itemId.GetCode(); - }; + ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + } } /// <summary> - /// 璇诲彇妫�楠岀粨鏋� + /// 鏍规嵁妫�楠岄」鐩鍙栨娊鏍风粨鏋� /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) + /// <param name="guid5"></param> + private void getList12(string guid5) { - var myDataRow = gvMx1.GetDataRow(e.FocusedRowHandle); - if (myDataRow == null) return; var _obj = new { parentGuid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓 - guid = UtilityHelper.ToGuid(myDataRow["guid"].ToString()), //涓诲缓 - checkQyt = myDataRow["checkQyt"].ToString(), - chkItem = myDataRow["fcheckItem"].ToString() + guid = UtilityHelper.ToGuid(guid5), //涓诲缓 }; try { - var strReturn = UtilityHelper.HttpPost("", _webServiceName + "GetCheckResultList12", JsonConvert.SerializeObject(_obj)); + var strReturn = UtilityHelper.HttpPost("", _webServiceName + "GetModel12", JsonConvert.SerializeObject(_obj)); var dd = UtilityHelper.ReturnToList(strReturn); var dt = dd.rtnData; gcMx2.BindingContext = new BindingContext(); @@ -352,6 +430,154 @@ MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } } + private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) + { + var rowhandle = gvMx3.FocusedRowHandle; + if (rowhandle < 0) + return; + if (e.Button.Index == 0) + { + var dr = gvMx3.GetDataRow(rowhandle); + var mxGuid = dr["guid"].ToString(); + if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾鍒犻櫎鍚楋紵")) + return; + var strJson = ""; + var lst = new List<string>(); + lst.Add(mxGuid); + try + { + strJson = UtilityHelper.HttpPost("", "MesFile/DeleteModel", + JsonConvert.SerializeObject(lst)); + var _rtn = UtilityHelper.ReturnToDynamic(strJson); + if (_rtn.rtnCode > 0) gvMx3.DeleteRow(rowhandle); + MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); + } + catch (Exception ex) + { + MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + } + } + } + private void repositoryItemButtonEdit2_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(); + 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); + } + } + } + + /// <summary> + /// 宸ュ叿鏉′簨浠� + /// </summary> + /// <param name="inFieldValue"></param> + private void _toolCk(int _inFieldValue) + { + string strMsg = ""; + switch (_inFieldValue) + { + case 1: + strMsg = "瀹℃牳"; + break; + case 0: + strMsg = "鍙嶅鏍�"; + break; + case -1: + strMsg = "椹冲洖"; + break; + }; + toolBarMenu1.guidKey = ""; + string rowGuid, rowName; + (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_releaseNo, gridView1, "releaseNo"); + if (string.IsNullOrEmpty(rowGuid)) + { + MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); + return; + } + if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾" + strMsg + "鍚楋紵")) + return; + if (_inFieldValue == 1) + { + if (txt_fcheckResu.Text == "涓嶅悎鏍�") + { + if (txt_fngHandle.Text.Trim().Length == 0) { + MsgHelper.Warning("鍗曟嵁涓轰笉鍚堟牸鏃惰閫夋嫨澶勭悊鏂瑰紡锛�"); + return; + } + } + } + var _obj = new + { + guid = rowGuid, + inFieldValue = _inFieldValue, + }; + try + { + var strJson = UtilityHelper.HttpPost("", + _webServiceName + "EditModelSubmitZhiLiang", + JsonConvert.SerializeObject(_obj)); + var _rtn = UtilityHelper.ReturnToDynamic(strJson); + MsgHelper.Warning(_rtn.rtnData.outMsg.ToString()); + if (_rtn.rtnCode > 0) + { + if (xtraTabControl1.SelectedTabPageIndex == 1) + getModel(lbGuid.Text.Trim()); + else + getPageList(this.pageBar1.CurrentPage); + } + } + catch (Exception ex) + { + MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + } + } } } \ No newline at end of file -- Gitblit v1.9.3