lu
2024-12-07 c733a40f757501b3b1c95fec58e009e9703786ec
DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
@@ -1430,6 +1430,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 +1458,7 @@
            return regex.IsMatch(str);
        }
        /// <summary>
        /// yz_quantity_0,yz_字段_类型
        /// </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;
                    }
                }
            }
        }
    }