Exemplo n.º 1
0
        private void AddSavedCondition(MDModel_Table_Column _tc, MDQuery_ConditionItem _columnCodition)
        {
            SinoSZUC_ConditionItem _item = null;

            switch (_tc.ColumnDataType.ToUpper())
            {
            case "DATE":
                _item = new SinoSZUC_ConditionItem_Date(_tc);
                break;

            case "NUMBER":
                _item = new SinoSZUC_ConditionItem_Number(_tc);
                break;

            default:
                if (_tc.ColumnDefine.TableColumn.RefDMB != "")
                {
                    _item = new SinoSZUC_ConditionItem_RefCode(_tc);
                }
                else
                {
                    _item = new SinoSZUC_ConditionItem(_tc);
                }
                break;
            }

            if (_item != null)
            {
                _item.Dock = DockStyle.Top;
                this.xtraScrollableControl1.Controls.Add(_item);
                _item.GetFocused      += new EventHandler <EventArgs>(_item_GetFocused);
                _item.LoseFocused     += new EventHandler <EventArgs>(_item_LoseFocused);
                _item.RemoveCondition += new EventHandler <EventArgs>(_item_RemoveCondition);
                _item.SendToBack();
                this.xtraScrollableControl1.ScrollControlIntoView(_item);

                _item.SetInputValue(_columnCodition);
            }
        }
        private void AddConditionItem(MDModel_Table_Column _tc)
        {
            SinoSZUC_ConditionItem _item = null;

            switch (_tc.ColumnDataType.ToUpper())
            {
            case "DATE":
                _item = new SinoSZUC_ConditionItem_Date(_tc);
                break;

            case "NUMBER":
                _item = new SinoSZUC_ConditionItem_Number(_tc);
                break;

            default:
                if (_tc.ColumnDefine.TableColumn.RefDMB != "")
                {
                    _item = new SinoSZUC_ConditionItem_RefCode(_tc);
                }
                else
                {
                    _item = new SinoSZUC_ConditionItem(_tc);
                }
                break;
            }

            if (_item != null)
            {
                _item.Dock = DockStyle.Top;
                this.xtraScrollableControl1.Controls.Add(_item);
                _item.GetFocused  += new EventHandler <EventArgs>(_item_GetFocused);
                _item.LoseFocused += new EventHandler <EventArgs>(_item_LoseFocused);
                _item.BringToFront();
                ResetOrderNumber();
                this.xtraScrollableControl1.Refresh();
            }
        }
Exemplo n.º 3
0
        private void AddFilterCondition(MDModel_Table_Column _tc)
        {
            SinoSZUC_ConditionItem _item = null;

            if (!_tc.ColumnDefine.CanShowAsCondition)
            {
                XtraMessageBox.Show("此字段不可做条件项", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            switch (_tc.ColumnDataType.ToUpper())
            {
            case "DATE":
                _item = new SinoSZUC_ConditionItem_Date(_tc);
                break;

            case "NUMBER":
                _item = new SinoSZUC_ConditionItem_Number(_tc);
                break;

            default:
                if (_tc.ColumnDefine.TableColumn.RefDMB != "")
                {
                    _item = new SinoSZUC_ConditionItem_RefCode(_tc);
                }
                else
                {
                    _item = new SinoSZUC_ConditionItem(_tc);
                }
                break;
            }

            if (_item != null)
            {
                _item.Dock = DockStyle.Top;
                this.xtraScrollableControl1.Controls.Add(_item);
                _item.GetFocused      += new EventHandler <EventArgs>(_item_GetFocused);
                _item.LoseFocused     += new EventHandler <EventArgs>(_item_LoseFocused);
                _item.RemoveCondition += new EventHandler <EventArgs>(_item_RemoveCondition);
                _item.BringToFront();
                ResetOrderNumber(this.xtraScrollableControl1);
                this.xtraScrollableControl1.Refresh();
                this.xtraScrollableControl1.ScrollControlIntoView(_item);
                if (this.textEdit1.EditValue == null)
                {
                    this.textEdit1.EditValue = this.xtraScrollableControl1.Controls.Count.ToString();
                }
                else
                {
                    string _expression = this.textEdit1.EditValue.ToString();
                    if (_expression == "")
                    {
                        _expression = "1";
                    }
                    else
                    {
                        _expression += string.Format("*{0}", this.xtraScrollableControl1.Controls.Count);
                    }
                    this.textEdit1.EditValue = _expression;
                }
            }
        }