From aa61ade84d2657a9fb37993378c6fba4680b5ddf Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期五, 27 十二月 2024 09:39:11 +0800
Subject: [PATCH] 调拨

---
 DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesDbck.cs |   14 +++++--
 DevApp/Gs.DevApp/UserControl/UcLookCk.cs         |   31 +++++++++++++++
 DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs        |   23 +++++------
 3 files changed, 51 insertions(+), 17 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesDbck.cs b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesDbck.cs
index d2ae922..385975d 100644
--- a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesDbck.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesDbck.cs
@@ -48,6 +48,8 @@
             txt_fromFcode.getSuppler("");
             this.txt_invFcode.EditChanged += (s, e) =>
             {
+                txt_fstockoutorgidNo.Text = txt_invFcode.GetOrgName();
+                txt_fowneroutidhead.Text = txt_invFcode.GetOrgId();
                 var _obj = new
                 {
                     currentPage = 1,
@@ -68,6 +70,10 @@
                 {
                     MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
                 }
+            };
+            this.txt_fromFcode.EditChanged += (s, e) => {
+                txt_fstockorgidNo.Text = txt_fromFcode.GetOrgName();
+                txt_fowneridhead.Text = txt_fromFcode.GetOrgId();
             };
         }
         private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
@@ -230,13 +236,13 @@
              string _inRkId = txt_fromFcode.GetId();//鍏�
             if (string.IsNullOrEmpty(_inCkId))
             {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨宸ュ崟锛�");
+                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨鍑鸿揣浠撳簱锛�");
                 txt_invFcode.Focus();
                 return;
             }
             if (string.IsNullOrEmpty(_inRkId))
             {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨浠撳簱锛�");
+                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨鏀惰揣浠撳簱锛�");
                 txt_fromFcode.Focus();
                 return;
             }
@@ -430,7 +436,7 @@
             };
             toolBarMenu1.guidKey = "";
             string rowGuid, rowName;
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billno, gridView1, "blNo");
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billno, gridView1, "billno");
             if (string.IsNullOrEmpty(rowGuid))
             {
                 MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
@@ -482,7 +488,7 @@
             if (e.Button.Index == 0)
             {
                 var dr = gvMx1.GetDataRow(rowhandle);
-                var mxGuid = dr["guid"].ToString();
+                var mxGuid = dr["id"].ToString();
                 if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾鍒犻櫎鍚楋紵"))
                     return;
                 if (string.IsNullOrEmpty(mxGuid))
diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
index 37332df..e2a9375 100644
--- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
+++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
@@ -344,25 +344,22 @@
                             var txt = colType as ComboBoxEdit;
                             if (txt.Properties.TextEditStyle ==
                                 TextEditStyles.DisableTextEditor)
-                                txt.SelectedIndex = int.Parse(strVal);
-                            else
-                                txt.Text = strVal;
-                            txt.ReadOnly = isEdt;
-                            continue;
-                        }
+                                try
+                                {
+                                    txt.SelectedIndex = int.Parse(strVal);
+                                }
+                                catch (Exception)
+                                {
 
-                        //涓嬫媺
-                        if (colType is ComboBoxEdit)
-                        {
-                            var txt = colType as ComboBoxEdit;
-                            if (txt.Properties.TextEditStyle ==
-                                TextEditStyles.DisableTextEditor)
-                                txt.SelectedIndex = int.Parse(strVal);
+                                    txt.Text = strVal;
+                                }
+                              
                             else
                                 txt.Text = strVal;
                             txt.ReadOnly = isEdt;
                             continue;
                         }
+                    
 
                         //鑷畾涔変笅鎷�
                         if (colType is UcComBox)
diff --git a/DevApp/Gs.DevApp/UserControl/UcLookCk.cs b/DevApp/Gs.DevApp/UserControl/UcLookCk.cs
index b99b673..99b088f 100644
--- a/DevApp/Gs.DevApp/UserControl/UcLookCk.cs
+++ b/DevApp/Gs.DevApp/UserControl/UcLookCk.cs
@@ -87,7 +87,38 @@
                 lookSearchSupplier.EditValue = null;
                 return;
             }
+            if(!string.IsNullOrEmpty(Code))
             lookSearchSupplier.EditValue = Int64.Parse(((Code.ToString().Trim())));
         }
+
+        /// <summary>
+        /// 璇诲彇缁勭粐ID
+        /// </summary>
+        /// <returns></returns>
+        public string GetOrgId()
+        {
+            var row = lookSearchSupplier.GetSelectedDataRow() as DataRowView;
+            if (row != null)
+            {
+                string id = row["OrgId"].ToString();
+                return id;
+            }
+            return "";
+        }
+
+        /// <summary>
+        /// 璇诲彇缁勭粐鍚嶇О
+        /// </summary>
+        /// <returns></returns>
+        public string GetOrgName()
+        {
+            var row = lookSearchSupplier.GetSelectedDataRow() as DataRowView;
+            if (row != null)
+            {
+                string id = row["OrgName"].ToString();
+                return id;
+            }
+            return "";
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3