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_MesQaItemsDetect01.cs |  590 ++++++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 508 insertions(+), 82 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs
index 446ddec..dd68677 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs
@@ -1,58 +1,202 @@
 using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
+using Gs.DevApp.UserControl;
 using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
 using System;
 using System.Collections.Generic;
+using System.Configuration;
 using System.Data;
-using System.Drawing;
+using System.Net;
+using System.Threading.Tasks;
 using System.Windows.Forms;
 
 namespace Gs.DevApp.DevFrm
 {
-    public partial class Frm_MesQaItemsDetect01  : DevExpress.XtraEditors.XtraForm
+    public partial class Frm_MesQaItemsDetect01 : DevExpress.XtraEditors.XtraForm
     {
-        string _webServiceName = "User/";
+        int _currentHandle5 = 0;
+        string _webServiceName = "MesQaItemsDetect01Manager/";
         List<FilterEntity> _filterList = new List<FilterEntity>();
-        public Frm_MesQaItemsDetect01 ()
+        public Frm_MesQaItemsDetect01()
         {
             InitializeComponent();
             this.toolBarMenu1.btnAddClick += ToolBarMenu1_btnAddClick;
             this.toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick;
             this.toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick;
             this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
-            this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
+            //  this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
             this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
             this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
-            gcMain.MouseDoubleClick += GcMain_MouseDoubleClick;
-            getPageList(1, UtilityHelper.GetPageSize());
+            toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
+            toolBarMenu1.btnJianYanClick += ToolBarMenu1_btnJianYanClick;
+            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, "fsubmitTxt", "", (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);
-            };
+            txtJianYan.KeyDown += TxtJianYan_KeyDown;
+            this.btnLoad.Click += BtnLoad_Click;
+            ucUpFile1.UpChanged += UcUpFile1_UpChanged;
+            xtraTabControl2.SelectedPageChanged += XtraTabControl2_SelectedPageChanged;
+            gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged;
         }
-
+        private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
+        {
+            _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns);
+            Task.Delay(100);
+            getPageList(1);
+        }
+        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>
-        /// 鍙屽嚮浜嬩欢
+        ///  閲嶆柊鍔犺浇妫�楠�
         /// </summary>
         /// <param name="sender"></param>
         /// <param name="e"></param>
-        private void GcMain_MouseDoubleClick(object sender, MouseEventArgs e)
+        private void BtnLoad_Click(object sender, EventArgs e)
         {
-            string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gridView1, e, "guid");
-            if (!string.IsNullOrEmpty(rowGuid))
-                getModel(rowGuid, false, 999);
+            if (!MsgHelper.AskQuestion("纭畾閲嶆柊鍔犺浇妫�楠岄」鐩悧锛岃鎿嶄綔灏嗕細娓呯┖涔嬪墠鐨勬楠岃褰曪紵"))
+                return;
+            string strGuid = lbGuid.Text.Trim();
+            if (string.IsNullOrEmpty(strGuid))
+            {
+                ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                return;
+            }
+            var _obj = new
+            {
+                guid = strGuid,
+            };
+            try
+            {
+                string strJson = UtilityHelper.HttpPost("", _webServiceName + "ReloadModel5", JsonConvert.SerializeObject(_obj));
+                ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
+                if (_rtn.rtnCode > 0)
+                {
+                    getModel(lbGuid.Text.Trim());
+                }
+                else
+                {
+                    Gs.DevApp.ToolBox.MsgHelper.ShowInformation(_rtn.rtnMsg);
+                }
+            }
+            catch (Exception ex)
+            {
+                ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+            }
         }
+        /// <summary>
+        /// 杈撳叆妫�楠屼簨浠�
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void TxtJianYan_KeyDown(object sender, KeyEventArgs e)
+        {
+            int intHandle = this.gvMx1.FocusedRowHandle;
+            this._currentHandle5 = intHandle;
+            if (intHandle < 0)
+            {
+                ToolBox.MsgHelper.Warning("鎻愮ず锛氳閫夋嫨妫�楠岄」鐩紒");
+                return;
+            }
+            if (e.KeyCode == Keys.Enter)
+            {
+                string guid5 = this.gvMx1.GetDataRow(intHandle)["guid"].ToString();
+                string _strCmd = txtJianYan.Text.Trim().ToUpper();
+                string _strOK = "OK";
+                string _strNG = "NG";
+                int n = 0;
+                if ((_strCmd.StartsWith(_strOK) || _strCmd.StartsWith(_strNG)))
+                {
+                    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
+                {
+                    if (int.TryParse(_strCmd, out n))
+                    {
+                    }
+                    else
+                    {
+                        Gs.DevApp.ToolBox.MsgHelper.ShowError("鍛戒护杈撳叆閿欒锛氳姝g‘浣跨敤OK 鎴�  NG 鍛戒护!");
+                        return;
+                    }
+                }
+                var _obj = new
+                {
+                    inOrderGuid1 = UtilityHelper.ToGuid(lbGuid.Text.Trim()), ////杩欐槸妫�楠屽崟guid
+                    inOrderGuid5 = guid5,//杩欐槸鎶芥牱鐨刧uid
+                    inP1 = _strCmd,//杩欐槸9锛屾湁鍙兘鏄�19锛屾垨鑰�0k-19,鎴栬�卬g-19
+                };
+                try
+                {
+                    var strJson = UtilityHelper.HttpPost("",
+                        _webServiceName + "EdtModel12",
+                        JsonConvert.SerializeObject(_obj));
+                    var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+                    if (_rtn.rtnCode > 0)
+                    {
+                        getModel(lbGuid.Text.Trim());
+                    }
+                    else
+                    {
+                        Gs.DevApp.ToolBox.MsgHelper.ShowInformation(_rtn.rtnMsg);
+                    }
+                    txtJianYan.Text = "";
+                }
+                catch (Exception ex)
+                {
+                    MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                }
+            }
+        }
+
         /// <summary>
         /// 鍒嗛〉浜嬩欢
         /// </summary>
@@ -60,7 +204,7 @@
         /// <param name="pageSize"></param>
         private void PageBar1_PagerEvent(int curPage, int pageSize)
         {
-            getPageList(curPage, pageSize);
+            getPageList(curPage);
         }
         /// <summary>
         /// 鏌ヨ浜嬩欢
@@ -69,7 +213,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();
         }
@@ -81,7 +228,75 @@
         private void Frm_UpdateParent(object sender, UpdateParentEventArgs e)
         {
             _filterList = e.FilterList;
-            getPageList(1, pageBar1.RowsCount);
+            getPageList(1);
+        }
+        /// <summary>
+        /// 鏃ュ織浜嬩欢
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ToolBarMenu1_btnLogClick(object sender, EventArgs e)
+        {
+            toolBarMenu1.guidKey = "";
+            string rowGuid, rowName;
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+                lbGuid, txt_releaseNo, gridView1);
+            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)
+        {
+            toolBarMenu1.guidKey = "";
+            string rowGuid, rowName;
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+                lbGuid, txt_releaseNo, gridView1, "lotNo");
+            toolBarMenu1.guidKey = rowGuid;
+            if (string.IsNullOrEmpty(rowGuid))
+            {
+                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                return;
+            }
+            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鎻愪氦妫�楠屽悧锛�"))
+                return;
+            if (txt_fcheckResu.Text.Trim() == "涓嶅悎鏍�")
+            {
+                if (string.IsNullOrEmpty(txt_lotNo1.Text.Trim())|| string.IsNullOrEmpty(txt_fngDesc.Text.Trim()))
+                {
+                    MsgHelper.Warning("鍗曟嵁涓轰笉鍚堟牸鏃讹紝璇峰~鍐欏娉ㄤ俊鎭拰涓嶈壇鎻忚堪锛�");
+                    return;
+                }
+            };
+            var _obj = new
+            {
+                guid = rowGuid,
+            };
+            try
+            {
+                var strJson = UtilityHelper.HttpPost("",
+                    _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());
+                    }
+                    else
+                        getPageList(this.pageBar1.CurrentPage);
+                }
+            }
+            catch (Exception ex)
+            {
+                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+            }
+
         }
 
         /// <summary>
@@ -91,7 +306,7 @@
         /// <param name="e"></param>
         private void ToolBarMenu1_btnEscClick(object sender, EventArgs e)
         {
-            UtilityHelper.JumpToTab(xtraTabControl1, 0);
+            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1);
         }
 
         /// <summary>
@@ -102,7 +317,7 @@
         private void ToolBarMenu1_btnDelClick1(object sender, EventArgs e)
         {
             string rowGuid = "", rowName = "";
-            //  (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_userName, gridView1);
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_releaseNo, gridView1, "releaseNo");
             if (string.IsNullOrEmpty(rowGuid))
             {
                 ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
@@ -111,16 +326,18 @@
             if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鍒犻櫎鍚楋紵"))
                 return;
             List<dynamic> lst = new List<dynamic>();
-          lst.Add(rowGuid);
-          var _obj = lst;
+            lst.Add(rowGuid);
+            var _obj = lst;
             try
             {
                 string strJson = UtilityHelper.HttpPost("", _webServiceName + "DeleteModel", JsonConvert.SerializeObject(_obj));
                 ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
                 if (_rtn.rtnCode > 0)
                 {
-                    UtilityHelper.JumpToTab(xtraTabControl1, 0);
-                    getPageList(1, UtilityHelper.GetPageSize());
+                    if (xtraTabControl1.SelectedTabPageIndex == 0)
+                        getPageList(this.pageBar1.CurrentPage);
+                    else
+                        Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
                 }
                 ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
             }
@@ -137,8 +354,19 @@
         /// <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>
         /// 淇敼浜嬩欢
@@ -148,13 +376,14 @@
         private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e)
         {
             string rowGuid = "", rowName = "";
-            // (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_userName, gridView1);
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_releaseNo, gridView1, "releaseNo");
             if (string.IsNullOrEmpty(rowGuid))
             {
                 ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
-            getModel(rowGuid, true, 1);
+            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
+            UtilityHelper.ChangeEnableByControl(panel1.Controls, true);
         }
         /// <summary>
         /// 鏂板浜嬩欢
@@ -163,10 +392,13 @@
         /// <param name="e"></param>
         private void ToolBarMenu1_btnAddClick(object sender, EventArgs e)
         {
-            UtilityHelper.JumpToTab(xtraTabControl1, 1);
             lbGuid.Text = "";
-            UtilityHelper.CleanValueByControl(this.panel1.Controls, true);
-
+            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4);
+            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);
         }
         /// <summary>
         /// 淇濆瓨浜嬩欢
@@ -176,16 +408,23 @@
         private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
         {
             toolBarMenu1.isSetBtn = false;
-            //if (string.IsNullOrEmpty(txt_account.Text.Trim()))
+            if (string.IsNullOrEmpty(txt_fngDesc.Text.Trim()))
             {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("鐧诲綍璐﹀彿涓嶈兘涓虹┖锛�");
-                // txt_account.Focus();
+                Gs.DevApp.ToolBox.MsgHelper.Warning("涓嶈壇鎻忚堪涓嶈兘涓虹┖锛�");
+                txt_fngDesc.Focus();
+                return;
+            }
+            if (string.IsNullOrEmpty(txt_lotNo1.Text.Trim()))
+            {
+                Gs.DevApp.ToolBox.MsgHelper.Warning("澶囨敞鑳戒负绌猴紒");
+                txt_fngDesc.Focus();
                 return;
             }
             var _obj = new
             {
-                guid = lbGuid.Text.Trim(),//涓诲缓
-
+                guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
+                fngDesc = txt_fngDesc.Text.Trim(),
+                lotNo1 = txt_lotNo1.Text.Trim(),
             };
             try
             {
@@ -210,56 +449,54 @@
         /// </summary>
         /// <param name="curPage">绗嚑椤�</param>
         /// <param name="pageSize">姣忛〉鍑犳潯</param>
-        private void getPageList(int curPage, int pageSize)
+        private void getPageList(int curPage)
         {
-            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)=0";
+            PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "release_no", "asc", "", _sbSqlWhere.ToString());
             string json = JsonConvert.SerializeObject(pgq);
             try
             {
                 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;//璁板綍鎬绘暟
-     	pageBar1.CurrentPage = curPage;//褰撳墠椤�
-     	pageBar1.RowsCount = pageSize;//姣忛〉鏄剧ず
-    	 pageBar1.setTxt();
-	 }
-	 else
- 	{
-     	ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + dd.rtnMsg);
- 	}
+                if (dd.rtnCode > 0)
+                {
+                    DataTable dt = dd.rtnData.list;
+                    gcMain.BindingContext = new BindingContext();
+                    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.RecordCount = dd.rtnData.total;//鎬昏褰曟暟
+                }
+                else
+                {
+                    ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + dd.rtnMsg);
+                }
             }
             catch (Exception ex)
             {
                 ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
+
         }
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="strGuid">涓婚敭</param>
-        /// <param name="isEdit">鏄惁鍙紪杈�</param>
-        /// <param name="tabIdx">閫夐」鍗″簭鍙�</param>
-        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,//涓诲缓
@@ -272,8 +509,34 @@
                 {
                     dynamic dy = _rtn.rtnData;
                     lbGuid.Text = strGuid;
-                    UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit);
-
+                    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"]["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();
+                        gvMx1.FocusedRowHandle = _currentHandle5;
+                        ucUpFile1.parentGuid = lbGuid.Text.Trim();
+                        var row = gvMx1.GetDataRow(_currentHandle5);
+                        if (row != null)
+                        {
+                            var rowGuid = row["guid"].ToString();
+                            getList12(rowGuid);
+                        }
+                    }
+                    else
+                    {
+                        Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
+                    }
                 }
                 else
                     ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
@@ -282,6 +545,169 @@
             {
                 ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
+
+        }
+
+
+        /// <summary>
+        /// 閫夐」鍗″垏鎹�
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void XtraTabControl2_SelectedPageChanged(object sender, DevExpress.XtraTab.TabPageChangedEventArgs e)
+        {
+            if (e.Page.Name == "xtraTabPage3")
+            {
+                getFileList();
+            }
+        }
+        /// <summary>
+        /// 涓婁紶鍚庡埛鏂版枃浠跺垪琛�
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void UcUpFile1_UpChanged(object sender, EventArgs e)
+        {
+            getFileList();
+        }
+        private void getFileList()
+        {
+            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
+            {
+                string strReturn = UtilityHelper.HttpPost("", "MesFile/GetListPage", json);
+                ReturnModel<PageListModel> dd = UtilityHelper.ReturnToTablePage(strReturn);
+                if (dd.rtnCode > 0)
+                {
+                    DataTable dt = dd.rtnData.list;
+                    gcMx3.BindingContext = new BindingContext();
+                    gcMx3.DataSource = dt;
+                    gcMx3.ForceInitialize();
+                }
+                else
+                {
+                    ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + dd.rtnMsg);
+                }
+            }
+            catch (Exception ex)
+            {
+                ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+            }
+        }
+        /// <summary>
+        /// 鏍规嵁妫�楠岄」鐩鍙栨娊鏍风粨鏋� 
+        /// </summary>
+        /// <param name="guid5"></param>
+        private void getList12(string guid5)
+        {
+            var _obj = new
+            {
+                parentGuid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
+                guid = UtilityHelper.ToGuid(guid5), //涓诲缓
+            };
+            try
+            {
+                var strReturn = UtilityHelper.HttpPost("", _webServiceName + "GetModel12", JsonConvert.SerializeObject(_obj));
+                var dd = UtilityHelper.ReturnToList(strReturn);
+                var dt = dd.rtnData;
+                gcMx2.BindingContext = new BindingContext();
+                gcMx2.DataSource = dt;
+                gcMx2.ForceInitialize();
+            }
+            catch (Exception ex)
+            {
+                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);
+                }
+            }
         }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3