Example #1
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="tag">标识符</param>
 /// <param name="level">优先级</param>
 /// <param name="parameterNumber">参数个数
 /// ,值为-1表示参数个数不确定,值为-2表示该运算因子不是运算符</param>
 /// <param name="opeType">运算符类型</param>
 public CalOpe(string tag, int level, int parameterNumber, OpeType opeType)
 {
     this.tag = tag;
     this.level = level;
     this.parameterNumber = parameterNumber;
     this.opeType = opeType;
 }
Example #2
0
 // 只传入了上一级的数据列表,就是添加操作
 public addOrderForm(MainForm mainForm, BindingSource orderBinding)
 {
     InitializeComponent();
     this.orderBinding = orderBinding;
     this.mainForm     = mainForm;
     typeLabel.Text    = "添加订单";
     opeType           = OpeType.ADD;
     bind();
 }
Example #3
0
        // 同时传入了上一级的数据列表和某个订单编号,就是修改操作
        public addOrderForm(MainForm mainForm, BindingSource orderBinding, Order editOrder)
        {
            InitializeComponent();
            this.mainForm     = mainForm;
            this.orderBinding = orderBinding;
            // 深拷贝Order对象
            this.order    = Order.DeepCopyByXml <Order>(editOrder);
            this.oldOrder = editOrder;

            typeLabel.Text = "修改订单";
            opeType        = OpeType.EDIT;
            bind();
        }
Example #4
0
        private bool Str_Decision(string str, int len, StrType st, OpeType ot)
        {
            switch (ot)
            {
                case OpeType.EQ:
                    if (str.Length == len)
                    {
                        break;
                    }
                    return false;

                case OpeType.GE:
                    if ((str.Length != 0) && (str.Length <= len))
                    {
                        break;
                    }
                    return false;

                case OpeType.GT:
                    if (str.Length >= len)
                    {
                        break;
                    }
                    return false;

                case OpeType.LE:
                    if ((str.Length != 0) && (str.Length < len))
                    {
                        break;
                    }
                    return false;

                case OpeType.LT:
                    if (str.Length > len)
                    {
                        break;
                    }
                    return false;
            }
            char[] chArray = str.ToUpper().ToCharArray();
            switch (st)
            {
                case StrType.IsDigit:
                    foreach (char ch in chArray)
                    {
                        if ((ch < '0') || (ch > '9'))
                        {
                            return false;
                        }
                    }
                    break;

                case StrType.IsLetter:
                    foreach (char ch2 in chArray)
                    {
                        if ((ch2 < 'A') || (ch2 > 'Z'))
                        {
                            return false;
                        }
                    }
                    break;

                case StrType.IsLetterOrDigit:
                    foreach (char ch3 in chArray)
                    {
                        if (((ch3 < '0') || (ch3 > '9')) && ((ch3 < 'A') || (ch3 > 'Z')))
                        {
                            return false;
                        }
                    }
                    break;

                case StrType.IsSymbol:
                    foreach (char ch4 in chArray)
                    {
                        if ((ch4 < ' ') || (ch4 > '\x007f'))
                        {
                            return false;
                        }
                    }
                    break;

                case StrType.IsNACCS:
                    foreach (char ch5 in chArray)
                    {
                        if ((ch5 < ' ') || (ch5 > ']'))
                        {
                            return false;
                        }
                        if (((ch5 == '$') || (ch5 == '%')) || ((ch5 == '\'') || (ch5 == '*')))
                        {
                            return false;
                        }
                    }
                    break;
            }
            return true;
        }