Beispiel #1
0
        void _item_GetFocused(object sender, EventArgs e)
        {
            CurrentFocused = true;
            SinoSZUC_ConditionItem _uc = sender as SinoSZUC_ConditionItem;

            this.focusedItem    = _uc.Index;
            this.focusedControl = _uc;
            RaiseMenuChanged();
        }
Beispiel #2
0
        private void AddCompareCondtion(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":

            case "NUMBER":

            default:

                _item = new SinoSZUC_CompareConditionItem(_tc, this.ExcelColumns);

                break;
            }

            if (_item != null)
            {
                _item.Dock = DockStyle.Top;
                this.xtraScrollableControl2.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.xtraScrollableControl2);
                this.xtraScrollableControl2.Refresh();
                this.xtraScrollableControl2.ScrollControlIntoView(_item);

                if (this.textEdit2.EditValue == null)
                {
                    this.textEdit2.EditValue = this.xtraScrollableControl2.Controls.Count.ToString();
                }
                else
                {
                    string _expression = this.textEdit2.EditValue.ToString();
                    if (_expression == "")
                    {
                        _expression = "1";
                    }
                    else
                    {
                        _expression += string.Format("*{0}", this.xtraScrollableControl2.Controls.Count);
                    }
                    this.textEdit2.EditValue = _expression;
                }
            }
        }
Beispiel #3
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();
            }
        }