From b0cebba8ea5393c5de74f4b09078f7a4d3d3e8cf Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期五, 13 十二月 2024 10:38:09 +0800
Subject: [PATCH] Merge branch 'master' of http://43.142.96.171:8080/r/~tjx/GsMesClient

---
 DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs |  142 ++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 115 insertions(+), 27 deletions(-)

diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
index e88ab78..dd32cf5 100644
--- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
+++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
@@ -128,7 +128,7 @@
                 request.Timeout = 15000;
                 request.AllowAutoRedirect = false;
                 request.ServicePoint.Expect100Continue = false;
-                wdf.SetCaption(_caption+"锛�10/100锛�" + meth);
+                wdf.SetCaption(_caption + "锛�10/100锛�" + meth);
                 HttpRequestCachePolicy noCachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore);
                 request.CachePolicy = noCachePolicy;
                 wdf.SetCaption(_caption + "锛�20/100锛�" + meth);
@@ -604,7 +604,39 @@
                                 txt.Enabled = false;
                             continue;
                         }
-
+                        //鑷畾鐢ㄦ埛
+                        if (colType is UcLookUser)
+                        {
+                            var txt = colType as UcLookUser;
+                            txt.SetIdOrCode(strVal);
+                            if (txt.IsReadly == false)
+                                txt.Enabled = !isEdt;
+                            else
+                                txt.Enabled = false;
+                            continue;
+                        }
+                        //鑷畾鎵撳嵃鏈�
+                        if (colType is UcLookPrint)
+                        {
+                            var txt = colType as UcLookPrint;
+                            txt.SetIdOrCode(strVal);
+                            if (txt.IsReadly == false)
+                                txt.Enabled = !isEdt;
+                            else
+                                txt.Enabled = false;
+                            continue;
+                        }
+                        //鑷畾缂洪櫡绫诲埆 
+                        if (colType is UcLookDefectType)
+                        {
+                            var txt = colType as UcLookDefectType;
+                            txt.SetIdOrCode(strVal);
+                            if (txt.IsReadly == false)
+                                txt.Enabled = !isEdt;
+                            else
+                                txt.Enabled = false;
+                            continue;
+                        }
                         if (colType is SimpleButton)
                         {
                             var txt = colType as SimpleButton;
@@ -683,7 +715,12 @@
                 if (ctrl is TextEdit)
                 {
                     var txt = ctrl as TextEdit;
-                    txt.Text = "";
+                    if (txt.Tag != null && txt.Tag.ToString().Length > 0 && txt.Tag.ToString().StartsWith("moren"))
+                    {
+                        txt.Text = txt.Tag.ToString().Replace("moren.", "");
+                    }
+                    else
+                        txt.Text = "";
                     txt.ReadOnly = isEdt;
                     continue;
                 }
@@ -706,7 +743,7 @@
                 if (ctrl is CheckBox)
                 {
                     var txt = ctrl as CheckBox;
-                    txt.Checked = false;
+                    //txt.Checked = false;
                     txt.Enabled = !isEdt;
                 }
                 if (ctrl is CheckEdit)
@@ -784,6 +821,30 @@
                 if (ctrl is UcLookOrg)
                 {
                     var txt = ctrl as UcLookOrg;
+                    txt.SetIdOrCode("-1");
+                    txt.Enabled = !isEdt;
+                    continue;
+                }
+                //鑷畾鐢ㄦ埛
+                if (ctrl is UcLookUser)
+                {
+                    var txt = ctrl as UcLookUser;
+                    txt.SetIdOrCode("-1");
+                    txt.Enabled = !isEdt;
+                    continue;
+                }
+                //鑷畾鎵撳嵃鏈�
+                if (ctrl is UcLookPrint)
+                {
+                    var txt = ctrl as UcLookPrint;
+                    txt.SetIdOrCode("-1");
+                    txt.Enabled = !isEdt;
+                    continue;
+                }
+                //鑷畾缂洪櫡绫诲埆
+                if (ctrl is UcLookDefectType)
+                {
+                    var txt = ctrl as UcLookDefectType;
                     txt.SetIdOrCode("-1");
                     txt.Enabled = !isEdt;
                     continue;
@@ -959,6 +1020,36 @@
                 if (ctrl is UcLookOrg)
                 {
                     var txt = ctrl as UcLookOrg;
+                    if (txt.IsReadly == false)
+                        txt.Enabled = !isEdt;
+                    else
+                        txt.Enabled = false;
+                    continue;
+                }
+                //鑷畾鐢ㄦ埛
+                if (ctrl is UcLookUser)
+                {
+                    var txt = ctrl as UcLookUser;
+                    if (txt.IsReadly == false)
+                        txt.Enabled = !isEdt;
+                    else
+                        txt.Enabled = false;
+                    continue;
+                }
+                //鑷畾鎵撳嵃
+                if (ctrl is UcLookPrint)
+                {
+                    var txt = ctrl as UcLookPrint;
+                    if (txt.IsReadly == false)
+                        txt.Enabled = !isEdt;
+                    else
+                        txt.Enabled = false;
+                    continue;
+                }
+                //鑷畾缂洪櫡绫诲埆
+                if (ctrl is UcLookDefectType)
+                {
+                    var txt = ctrl as UcLookDefectType;
                     if (txt.IsReadly == false)
                         txt.Enabled = !isEdt;
                     else
@@ -1362,6 +1453,7 @@
         /// <param name="icoName">鍥炬爣璺緞</param>
         public static void SetGridSear(GridView gridView1, PictureBox btnChkIco = null, Form fm = null, string fileName = "checkStatus", string icoName = "")
         {
+            //   gridView1.OptionsView.ColumnAutoWidth = false;鑷姩璋冩暣鍒楀
             foreach (GridColumn column in gridView1.Columns)
             {
                 column.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains;
@@ -1430,6 +1522,24 @@
                     e.Bounds.Top + 45, e.Bounds.Right - 5, e.Bounds.Height - 5);
                 e.Graphics.DrawString(str, f, Brushes.Gray, r);
             };
+            gridView1.ValidatingEditor += (sender, e) =>
+            {
+                //yz_quantity_0
+                GridView view = sender as GridView;
+                if (view.FocusedColumn.Tag != null && view.FocusedColumn.Tag.ToString().StartsWith("yz_"))
+                {
+                    string[] _ary = view.FocusedColumn.Tag.ToString().Split('_');
+                    if (_ary.Length > 2)
+                    {
+                        if (_ary[2] == "0")
+                        {
+                            double price = 0; if (!Double.TryParse(e.Value as String, out price))
+                            { e.Valid = false; e.ErrorText = "璇疯緭鍏ユ纭殑鏁板瓧."; }
+                            return;
+                        }
+                    }
+                }
+            };
         }
 
         #endregion
@@ -1440,29 +1550,7 @@
             return regex.IsMatch(str);
         }
 
-        /// <summary>
-        /// yz_quantity_0锛寉z_瀛楁_绫诲瀷
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        public static void SetValidatingEditor(object sender, BaseContainerValidateEditorEventArgs e)
-        {
-            //yz_quantity_0
-            GridView view = sender as GridView;
-            if (view.FocusedColumn.Tag != null && view.FocusedColumn.Tag.ToString().StartsWith("yz_"))
-            {
-                string[] _ary = view.FocusedColumn.Tag.ToString().Split('_');
-                if (_ary.Length > 2)
-                {
-                    if (_ary[2] == "0")
-                    {
-                        double price = 0; if (!Double.TryParse(e.Value as String, out price))
-                        { e.Valid = false; e.ErrorText = "璇疯緭鍏ユ纭殑鏁板瓧."; }
-                        return;
-                    }
-                }
-            }
-        }
+
 
     }
 

--
Gitblit v1.9.3