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/WW/Frm_WwPc.cs |  234 +++++++++++++++++++++++++++-------------------------------
 1 files changed, 109 insertions(+), 125 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/WW/Frm_WwPc.cs b/DevApp/Gs.DevApp/DevFrm/WW/Frm_WwPc.cs
index 4bc0234..d5a1e50 100644
--- a/DevApp/Gs.DevApp/DevFrm/WW/Frm_WwPc.cs
+++ b/DevApp/Gs.DevApp/DevFrm/WW/Frm_WwPc.cs
@@ -1,7 +1,3 @@
-using DevExpress.RichEdit.Export;
-using DevExpress.XtraEditors;
-using DevExpress.XtraGrid.Views.Grid;
-using DevExpress.XtraGrid.Views.Grid.ViewInfo;
 using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
 using Gs.DevApp.UserControl;
@@ -10,7 +6,6 @@
 using System;
 using System.Collections.Generic;
 using System.Data;
-using System.Drawing;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 
@@ -46,50 +41,40 @@
             });
             getPageList(1);
             pageBar1.PagerEvent += PageBar1_PagerEvent;
-            //txt_pba013.EditChanged += (s, e) =>
-            //{
-            //    string workGuid = this.txt_pba013.GetGuid();
-            //    _getListJybz(workGuid);
-            //};
             ////閫夋嫨闇�瑕佸叆搴撶殑鏄庣粏
-            //btnSelect.Click += (s, e) =>
-            //{
-            //    if (string.IsNullOrEmpty(this.txt_pba013.GetId()))
-            //    {
-            //        Gs.DevApp.ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨杞﹂棿锛屾墠鑳介�夋嫨浠诲姟鍗曪紒");
-            //        return;
-            //    }
-            //    var frm = new SelectWompba(this.txt_pba013.Text);
-            //    //璧嬪�肩粰鏄庣粏琛�
-            //    frm.UpdateParent += (ss, ee) =>
-            //    {
-            //        try
-            //        {
-            //            var lst = new List<string>();
-            //            lst = ee.StringList;
-            //            var _obj = lst;
-            //            var strReturn = UtilityHelper.HttpPost("",
-            //                "WompbaManager/SelectPbaToView",
-            //                JsonConvert.SerializeObject(_obj));
-            //            var dt = UtilityHelper.ReturnToList(strReturn);
-            //            DataTable _newTable = dt.rtnData;
-            //            DataTable _oldTable = (DataTable)gcMx1.DataSource;
-            //            DataRow[] sourceRows = _newTable.Select();
-            //            for (int i = 0; i < sourceRows.Length; i++)
-            //            {
-            //                _oldTable.ImportRow(sourceRows[i]);
-            //            }
-            //            gcMx1.BindingContext = new BindingContext();
-            //            gcMx1.DataSource = _oldTable;
-            //            gcMx1.ForceInitialize();
-            //        }
-            //        catch (Exception ex)
-            //        {
-            //            MessageBox.Show(ex.Message);
-            //        }
-            //    };
-            //    frm.ShowDialog();
-            //};
+            btnSelect.Click += (s, e) =>
+            {
+                var frm = new SelectWwPc("");
+                //璧嬪�肩粰鏄庣粏琛�
+                frm.UpdateParent += (ss, ee) =>
+                {
+                    try
+                    {
+                        var lst = new List<string>();
+                        lst = ee.StringList;
+                        var _obj = lst;
+                        var strReturn = UtilityHelper.HttpPost("",
+                            "WWPCManager/SelectFormTo",
+                            JsonConvert.SerializeObject(_obj));
+                        var dt = UtilityHelper.ReturnToList(strReturn);
+                        DataTable _newTable = dt.rtnData;
+                        DataTable _oldTable = (DataTable)gcMx1.DataSource;
+                        DataRow[] sourceRows = _newTable.Select();
+                        for (int i = 0; i < sourceRows.Length; i++)
+                        {
+                            _oldTable.ImportRow(sourceRows[i]);
+                        }
+                        gcMx1.BindingContext = new BindingContext();
+                        gcMx1.DataSource = _oldTable;
+                        gcMx1.ForceInitialize();
+                    }
+                    catch (Exception ex)
+                    {
+                        MessageBox.Show(ex.Message);
+                    }
+                };
+                frm.ShowDialog();
+            };
         }
         private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
         {
@@ -139,7 +124,7 @@
         /// <param name="e"></param>
         private void ToolBarMenu1_btnChkClick(object sender, EventArgs e)
         {
-            _toolCk(1, "EditModelSubmit");
+            _toolCk(1);
         }
 
         /// <summary>
@@ -150,7 +135,7 @@
         /// <exception cref="NotImplementedException"></exception>
         private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e)
         {
-            _toolCk(0, "EditModelSubmitFSH");
+            _toolCk(0);
         }
 
         /// <summary>
@@ -244,7 +229,7 @@
             Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
             List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
             gvList.Add(gvMx1);
-            UtilityHelper.ChangeEnableByControl(panel1.Controls, true);
+            UtilityHelper.ChangeEnableByControl(panel1.Controls, true, gvList);
         }
         /// <summary>
         /// 鏂板浜嬩欢
@@ -255,7 +240,9 @@
         {
             lbGuid.Text = "";
             Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4);
-            UtilityHelper.CleanValueByControl(panel1.Controls, true);
+            List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
+            gvList.Add(gvMx1);
+            UtilityHelper.CleanValueByControl(panel1.Controls, true, gvList);
             Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
         }
         /// <summary>
@@ -266,25 +253,17 @@
         private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
         {
             toolBarMenu1.isSetBtn = false;
-            //string workId = txt_pba013.GetId();
-            //if (string.IsNullOrEmpty(workId.Trim()))
-            //{
-            //    Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨杞﹂棿锛�");
-            //    txt_pba013.Focus();
-            //    return;
-            //}
-            //var _obj = new
-            //{
-            //    guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
-            //    bz = txt_pba009.Text.Trim(),
-            //    cjId = workId,
-            //    list = new List<dynamic>(),
-            //};
+            var _obj = new
+            {
+                guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
+                bz = "",
+                list = new List<dynamic>(),
+            };
             gvMx1.CloseEditor();
             gvMx1.UpdateCurrentRow();
             if (gvMx1.DataRowCount <= 0)
             {
-                MsgHelper.ShowError("鏄庣粏涓嶈兘涓虹┖锛岃閫夋嫨浣犵殑鏀舵枡鏄庣粏锛�");
+                MsgHelper.ShowError("鏄庣粏涓嶈兘涓虹┖锛岃閫夋嫨浣犵殑鏄庣粏锛�");
                 return;
             }
             for (var i = 0; i < gvMx1.DataRowCount; i++)
@@ -292,13 +271,7 @@
                 var row = gvMx1.GetDataRow(i);
                 if (row != null)
                 {
-                    Guid? _guid = UtilityHelper.ToGuid(row["guid"].ToString());
-                    //string _LineId = row["daa015"].ToString();
-                    //if (string.IsNullOrEmpty(_LineId))
-                    //{
-                    //    MsgHelper.ShowError("浜х嚎缂栫爜涓嶈兘涓虹┖锛�");
-                    //    return;
-                    //}
+                    Guid? _guid = UtilityHelper.ToGuid(row["id"].ToString());
                     string _Pcsl = row["daa008"].ToString();
                     if (string.IsNullOrEmpty(_Pcsl))
                     {
@@ -311,64 +284,36 @@
                         MsgHelper.ShowError("棰勮寮�宸ユ椂闂翠笉鑳戒负绌猴紒");
                         return;
                     }
-                    //string _prepareTime = row["prepareTime"].ToString();
-                    //if (string.IsNullOrEmpty(_prepareTime))
-                    //{
-                    //    MsgHelper.ShowError("棰勮澶囨枡鏃堕棿涓嶈兘涓虹┖锛�");
-                    //    return;
-                    //}
-                    //string _planPersonnel = row["planPersonnel"].ToString();
-                    //if (string.IsNullOrEmpty(_planPersonnel))
-                    //{
-                    //    MsgHelper.ShowError("璁″垝浜烘暟锛�");
-                    //    return;
-                    //}
-                    //string _changeLinetime = row["changeLinetime"].ToString();
-                    //if (string.IsNullOrEmpty(_changeLinetime))
-                    //{
-                    //    MsgHelper.ShowError("鎹㈢嚎鏃堕棿涓嶈兘涓虹┖锛�");
-                    //    return;
-                    //}
                     string _mesEndProd = row["mesEndProd"].ToString();
                     if (string.IsNullOrEmpty(_mesEndProd))
                     {
                         MsgHelper.ShowError("棰勮瀹屽伐鏃堕棿涓嶈兘涓虹┖锛�");
                         return;
                     }
-                    //string _restTime = row["restTime"].ToString();
-                    //if (string.IsNullOrEmpty(_prepareTime))
-                    //{
-                    //    MsgHelper.ShowError("浼戞伅鏃堕棿涓嶈兘涓虹┖锛�");
-                    //    return;
-                    //}
-                    //_obj.list.Add(new
-                    //{
-                    //    Guid = _guid,
-                    //    AboutGuid = Gs.DevApp.ToolBox.UtilityHelper.ToGuid(row["caaGuid"].ToString()),
-                    //    LineId = row["daa015"].ToString(),//浜х嚎id
-                    //    Yjkgsj = (row["mesStartProd"].ToString()),//棰勮寮�宸ユ椂闂�
-                    //    Jhrs = row["planPersonnel"].ToString(),//璁″垝浜烘暟
-                    //    Hxsj = row["changeLinetime"].ToString(),//鎹㈢嚎鏃堕棿
-                    //    Bz = row["daa009"].ToString(),//澶囨敞
-                    //    Blsj = row["prepareTime"].ToString(),//棰勮澶囨枡鏃堕棿
-                    //    Pcsl = row["daa008"].ToString(),//鎺掍骇鏁伴噺
-                    //    Yjwgsj = row["mesEndProd"].ToString()//棰勮瀹屽伐鏃堕棿
-                    //});
+                    _obj.list.Add(new
+                    {
+                        Guid = _guid,
+                        AboutGuid = Gs.DevApp.ToolBox.UtilityHelper.ToGuid(row["rwdGuid"].ToString()),//鐩稿綋浜巆aaGuid
+                        Yjkgsj = (row["mesStartProd"].ToString()),//棰勮寮�宸ユ椂闂�
+                        Bz = row["remark"].ToString(),//澶囨敞
+                        Pcsl = row["daa008"].ToString(),//鎺掍骇鏁伴噺
+                        Yjwgsj = row["mesEndProd"].ToString()//棰勮瀹屽伐鏃堕棿
+                    });
                 }
             }
             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;
-                //    List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
-                //    gvList.Add(gvMx1);
-                //    UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false, gvList);
-                //}
+                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;
+                    List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
+                    gvList.Add(gvMx1);
+                    UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false, gvList);
+                }
             }
             catch (Exception ex)
             {
@@ -476,12 +421,11 @@
         }
 
 
-
         /// <summary>
         /// 宸ュ叿鏉′簨浠�
         /// </summary>
         /// <param name="inFieldValue"></param>
-        private void _toolCk(int _inFieldValue, string _mth)
+        private void _toolCk(int _inFieldValue)
         {
             string strMsg = "";
             switch (_inFieldValue)
@@ -511,7 +455,7 @@
             try
             {
                 var strJson = UtilityHelper.HttpPost("",
-                    _webServiceName + _mth,
+                    _webServiceName + "EditModelSubmit",
                     JsonConvert.SerializeObject(_obj));
                 var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                 MsgHelper.Warning(_rtn.rtnData.outMsg.ToString());
@@ -529,5 +473,45 @@
             }
 
         }
+
+        private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
+        {
+            var rowhandle = gvMx1.FocusedRowHandle;
+            if (rowhandle < 0)
+                return;
+            if (e.Button.Index == 0)
+            {
+                var dr = gvMx1.GetDataRow(rowhandle);
+                var mxGuid = dr["id"].ToString();
+                if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾鍒犻櫎鍚楋紵"))
+                    return;
+                if (string.IsNullOrEmpty(mxGuid))
+                {
+                    gvMx1.DeleteRow(rowhandle);
+                    return;
+                }
+                var _obj = new
+                {
+                    guid = lbGuid.Text.Trim(),
+                    mxGuid = mxGuid,
+                };
+                try
+                {
+                    var strJson = UtilityHelper.HttpPost("",
+                        _webServiceName + "DeleteModelOrMx",
+                        JsonConvert.SerializeObject(_obj));
+                    var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+                    if (_rtn.rtnCode > 0)
+                    {
+                        if (_rtn.rtnCode > 0) getModel(lbGuid.Text);
+                    }
+                    MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+                }
+                catch (Exception ex)
+                {
+                    MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                }
+            }
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3