public SinoSZUC_ConditionItem(MDQuery_ConditionItem _citem)
 {
     InitializeComponent();
     ColumnDefine = null;
     ShowValue(_citem);
     InitFinished = true;
 }
Example #2
0
        public static string BuildItem(MDModel_Table_Column _mcolumn)
        {
            //if ((_mcolumn.ColumnDefine.TableColumn.SecretLevel > SinoUserCtx.CurUser.SecretLevel) || (!_mcolumn.ColumnDefine.TableColumn.CanDisplay))
            if (!_mcolumn.ColumnDefine.TableColumn.CanDisplay)
            {
                return(string.Format("'***' {0}", _mcolumn.ColumnAlias));
            }


            if (_mcolumn.ColumnRefDMB == string.Empty)
            {
                switch (_mcolumn.ColumnDataType)
                {
                case "date":
                    return(string.Format("DATE_FORMAT({0}.{1},'%Y-%m-%d') {2}", _mcolumn.TableName, _mcolumn.ColumnName, _mcolumn.ColumnAlias));

                case "datetime":
                case "timestamp":
                    return(string.Format("DATE_FORMAT({0}.{1},'%Y-%m-%d %H:%i:%s') {2}", _mcolumn.TableName, _mcolumn.ColumnName, _mcolumn.ColumnAlias));

                case "NUMBER":
                    return(string.Format("Round({0}.{1},20) {2}", _mcolumn.TableName, _mcolumn.ColumnName, _mcolumn.ColumnAlias));

                default:
                    return(string.Format("{0}.{1} {2}", _mcolumn.TableName, _mcolumn.ColumnName, _mcolumn.ColumnAlias));
                }
            }
            else
            {
                return(string.Format("mdfun_getct({0}.{1},'{3}') {2}", _mcolumn.TableName, _mcolumn.ColumnName,
                                     _mcolumn.ColumnAlias, _mcolumn.ColumnRefDMB));
            }
        }
        public void AddResultTableColumn(MDModel_Table _mtable, MDModel_Table_Column _mColumn)
        {
            MDQuery_ResultTable _rtable = null;
            string _tname = _mtable.TableName;

            if (this.queryRequest.MainResultTable != null && this.queryRequest.MainResultTable.TableName == _tname)
            {
                _rtable = this.queryRequest.MainResultTable;
            }
            else
            {
                var _rts = from _c in this.queryRequest.ChildResultTables
                           where _c.TableName == _tname
                           select _c;
                if (_rts != null && _rts.Count() > 0)
                {
                    _rtable = _rts.First();
                }
            }
            if (_rtable.Columns == null)
            {
                _rtable.Columns = new List <MDQuery_TableColumn>();
            }

            string _cname = _mColumn.ColumnName;
            var    _find  = from _t in _rtable.Columns
                            where _t.ColumnName == _cname
                            select _t;

            if (_find == null || _find.Count() < 1)
            {
                MDQuery_TableColumn _column = new MDQuery_TableColumn(_mColumn);
                _rtable.Columns.Add(_column);
            }
        }
Example #4
0
        private void AddFLWSDownloadItem(MDModel_Table_Column _tc, DataRow TableRecordData)
        {
            if (_tc.ColumnDefine.TableColumn.DisplayLength >= 2)
            {
                this.RightPanel.Visible = false;
                this.LeftPanel.Visible  = true;
                this.LeftPanel.Dock     = DockStyle.Fill;
                this.LeftLabel.Text     = _tc.ColumnTitle;
                this.LeftMemo.Visible   = false;
                this.LeftText.Visible   = false;

                HyperLinkEdit _link = new HyperLinkEdit();
                _link.Properties.AutoHeight = false;
                _link.Dock = DockStyle.Fill;
                _link.Properties.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
                _link.Properties.Appearance.Options.UseTextOptions = true;
                this.LeftPanel.Controls.Add(_link);
                _link.BringToFront();
                _link.Text        = "下载法律文书";
                _link.Tag         = TableRecordData[_tc.ColumnAlias] + "," + _tc.ColumnDefine.TableColumn.RefWordTableName;
                _link.Click      += new EventHandler(FLWSAttachmentDownload_Click);
                this._blankLength = 0;
            }
            else
            {
                if (this.BlankLength == 2)
                {
                    this.LeftLabel.Text   = _tc.ColumnTitle;
                    this.LeftMemo.Visible = false;
                    this.LeftText.Visible = false;
                    HyperLinkEdit _link = new HyperLinkEdit();
                    _link.Properties.AutoHeight = false;
                    _link.Dock = DockStyle.Fill;
                    _link.Properties.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
                    _link.Properties.Appearance.Options.UseTextOptions = true;
                    this.LeftPanel.Controls.Add(_link);
                    _link.BringToFront();
                    _link.Text        = "下载法律文书";
                    _link.Tag         = TableRecordData[_tc.ColumnAlias] + "," + _tc.ColumnDefine.TableColumn.RefWordTableName;
                    _link.Click      += new EventHandler(FLWSAttachmentDownload_Click);
                    this._blankLength = 1;
                }
                else
                {
                    this.RightLabel.Text   = _tc.ColumnTitle;
                    this.RightText.Visible = false;
                    HyperLinkEdit _link = new HyperLinkEdit();
                    _link.Properties.AutoHeight = false;
                    _link.Dock = DockStyle.Fill;
                    _link.Properties.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
                    _link.Properties.Appearance.Options.UseTextOptions = true;
                    this.RightPanel.Controls.Add(_link);
                    _link.BringToFront();
                    _link.Text        = "下载法律文书";
                    _link.Tag         = TableRecordData[_tc.ColumnAlias] + "," + _tc.ColumnDefine.TableColumn.RefWordTableName;
                    _link.Click      += new EventHandler(FLWSAttachmentDownload_Click);
                    this._blankLength = 0;
                }
            }
        }
Example #5
0
        private static string BuildCharFieldCondition_Table(MDCompare_ConditionItem _cItem, MDModel_QueryModel _qv, string _fieldStr)
        {
            MDModel_Table _table;
            string        _targetField = string.Format("TEMP_IMPDATA.{0}", _cItem.CompareTagetField);
            string        _tname       = _cItem.Column.TableName;

            if (_qv.MainTable.TableName == _tname)
            {
                _table = _qv.MainTable;
            }
            else
            {
                _table = _qv.ChildTableDict[_tname];
            }

            MDModel_Table_Column _tc = _table.GetColumnByName(_cItem.Column.ColumnName);

            //普通字符型

            switch (_cItem.Operator)
            {
            case "等于":
                return(string.Format("{0} ={1}", _fieldStr, _targetField));


            case "近似":
                return(string.Format("{0} = {1} ", _fieldStr, _targetField));
            }

            return("");
        }
Example #6
0
        private static MDModel_Table_Column GetColumn(string _fieldStr, MDModel_QueryModel _queryModel)
        {
            MDModel_Table_Column _ret;
            string _tableName  = StrUtils.GetMetaByName("QCF_TABLE", _fieldStr);
            string _columnName = StrUtils.GetMetaByName("QCF_COL", _fieldStr);
            string _columType  = StrUtils.GetMetaByName("QCF_TYPE", _fieldStr);
            string _columTitle = StrUtils.GetMetaByName("QCF_TITLE", _fieldStr);

            if (_columType.Substring(0, 1) == "#")
            {
                _ret = new MDModel_Table_Column();
                _ret.ColumnDefine    = new MD_ViewTableColumn(Guid.NewGuid().ToString(), "", "", true, true, true, true, false, "", 0, 0);
                _ret.ColumnDataType  = _columType.Substring(1);
                _ret.ColumnName      = _columnName;
                _ret.ColumnAlgorithm = _columnName;
                _ret.ColumnType      = QueryColumnType.CalculationColumn;
                _ret.TableName       = _tableName;
                _ret.ColumnTitle     = _columTitle;
                _ret.ColumnRefDMB    = "";
            }
            else
            {
                _ret = MC_QueryModel.GetColumnDefineByName(_queryModel, _tableName, _columnName);
            }
#if DEBUG
            //if (_ret == null)
            //{
            //    Console.WriteLine(string.Format("未找到字段{0}.{1}", _tableName, _columnName));
            //}
#endif
            return(_ret);
        }
Example #7
0
        public static string BuildItem(MDModel_Table_Column _mcolumn)
        {
            if ((_mcolumn.ColumnDefine.TableColumn.SecretLevel > SinoUserCtx.CurUser.SecretLevel) || (!_mcolumn.ColumnDefine.TableColumn.CanDisplay))
            {
                return(string.Format("'***' {0}", _mcolumn.ColumnAlias));
            }


            if (_mcolumn.ColumnRefDMB == string.Empty)
            {
                if (_mcolumn.ColumnDataType == "NUMBER")
                {
                    return(string.Format("Round({0}.{1},20) {2}", _mcolumn.TableName, _mcolumn.ColumnName, _mcolumn.ColumnAlias));
                }
                else
                {
                    return(string.Format("{0}.{1} {2}", _mcolumn.TableName, _mcolumn.ColumnName, _mcolumn.ColumnAlias));
                }
            }
            else
            {
                return(string.Format("ZHCX.GETCT(TO_CHAR({0}.{1}),'{3}') {2}", _mcolumn.TableName, _mcolumn.ColumnName,
                                     _mcolumn.ColumnAlias, _mcolumn.ColumnRefDMB));
            }
        }
Example #8
0
 private void treeList1_GetSelectImage(object sender, DevExpress.XtraTreeList.GetSelectImageEventArgs e)
 {
     if ((string)e.Node.GetValue("ItemType") == "TABLE")
     {
         MDModel_Table _tb = e.Node.GetValue("Data") as MDModel_Table;
         if (_tb.TableDefine.ViewTableRelationType == MDType_ViewTableRelation.SingleChildRecord)
         {
             e.NodeImageIndex = 0;
         }
         else
         {
             e.NodeImageIndex = 1;
         }
     }
     else if ((string)e.Node.GetValue("ItemType") == "COLUMN")
     {
         MDModel_Table_Column _tc = e.Node.GetValue("Data") as MDModel_Table_Column;
         if (_tc.ColumnType == QueryColumnType.TableColumn)
         {
             e.NodeImageIndex = 2;
         }
         else if (_tc.ColumnType == QueryColumnType.StatisticsColumn)
         {
             e.NodeImageIndex = 4;
         }
         else if (_tc.ColumnType == QueryColumnType.CalculationColumn)
         {
             e.NodeImageIndex = 3;
         }
     }
 }
Example #9
0
        public static MDModel_Table_Column GetColumnDefineByName(MDModel_QueryModel qv, string tName, string cName)
        {
            MDModel_Table_Column _ret = null;

            if (qv.MainTable.TableName == tName)
            {
                _ret = (from _c in qv.MainTable.Columns
                        where _c.ColumnName == cName
                        select _c).First();
            }
            else
            {
                MDModel_Table _tb = (from _t in qv.ChildTables
                                     where _t.TableName == tName
                                     select _t).First();
                if (_tb == null)
                {
                    return(null);
                }

                _ret = (from _c in _tb.Columns
                        where _c.ColumnName == cName
                        select _c).First();
            }
            return(_ret);
        }
Example #10
0
        private void AddCalculationField(string _displayName, string _algorithm, string _queryModelName, MDModel_Table _tb, string _resultType)
        {
            MD_ViewTableColumn _vtc = new MD_ViewTableColumn("", "", "", true, true, false, false, false, "", 0, 0);

            _vtc.TableColumn = new MD_TableColumn("", "", "", true, _resultType, 0, 0, 0, "", "", 0, _displayName, "",
                                                  80, 1, 0, true, 0, "", "", "");


            MDModel_Table_Column _newtc = new MDModel_Table_Column(_vtc);

            _newtc.ColumnType      = QueryColumnType.CalculationColumn;
            _newtc.ColumnTitle     = _displayName;
            _newtc.ColumnName      = "";
            _newtc.ColumnAlgorithm = _algorithm;
            _newtc.ColumnAlias     = _tb.TableName + "_EXP" + ExpIndex++;
            _newtc.QueryModelName  = _queryModelName;
            _newtc.ColumnDataType  = _resultType;
            _newtc.TableName       = _tb.TableName;
            _newtc.TID             = _tb.TableID;

            _tb.Columns.Add(_newtc);
            _tb.AliasDict.Add(_newtc.ColumnAlias, _newtc);

            this.treeList1.BeginUpdate();
            SinoSZUC_FieldTreeItem _tcItem = new SinoSZUC_FieldTreeItem(_newtc);

            _tcItem.ParentID = _tb.TableDefine.TableID;
            _tcItem.State    = 2;
            List <SinoSZUC_FieldTreeItem> _listData = this.treeList1.DataSource as List <SinoSZUC_FieldTreeItem>;

            _listData.Add(_tcItem);

            this.treeList1.EndUpdate();
            this.treeList1.RefreshDataSource();
        }
Example #11
0
 private void RaiseFieldSelected(MDModel_Table_Column _item)
 {
     if (FieldSelected != null)
     {
         FieldSelected(this, new FieldSelectEventArgs(_item));
     }
 }
Example #12
0
        private void RefreshTableSelected(MDQuery_ResultTable _mtable)
        {
            TreeListNode  _mtableNode = FindTableNode(_mtable.TableName);
            MDModel_Table _tb         = _mtableNode.GetValue("Data") as MDModel_Table;

            if (_mtableNode != null)
            {
                foreach (TreeListNode _cnode in _mtableNode.Nodes)
                {
                    MDModel_Table_Column _mColumn = _cnode.GetValue("Data") as MDModel_Table_Column;
                    var _find = from _c in _mtable.Columns
                                where _c.ColumnName == _mColumn.ColumnName
                                select _c;
                    if (_find != null && _find.Count() > 0)
                    {
                        _cnode.SetValue("State", 2);
                        SetTableState(_cnode, 2);
                    }
                }

                foreach (MDQuery_TableColumn _rtc in _mtable.Columns)
                {
                    if (_rtc.ColumnType == QueryColumnType.CalculationColumn)
                    {
                        AddCalculationField(_rtc.ColumnTitle, _rtc.ColumnAlgorithm, this.queryModel.FullQueryModelName, _tb,
                                            _rtc.ColumnDataType);
                    }

                    if (_rtc.ColumnType == QueryColumnType.StatisticsColumn)
                    {
                        AddStaticsticsField(_rtc.ColumnTitle, _rtc.ColumnAlgorithm, _rtc.ColumnDataType, _tb);
                    }
                }
            }
        }
Example #13
0
        public void AddItem(MDModel_Table_Column _tc, DataRow TableRecordData)
        {
            if (_tc.ColumnDefine.TableColumn.DisplayLength > _blankLength)
            {
                return;
            }

            if (_tc.ColumnDataType == "附件下载")
            {
                AddDownloadItem(_tc, TableRecordData);
                return;
            }

            if (_tc.ColumnDataType == "法律文书下载")
            {
                AddFLWSDownloadItem(_tc, TableRecordData);
                return;
            }

            if (_tc.ColumnDefine.TableColumn.DisplayLength >= 2)
            {
                this.RightPanel.Visible = false;
                this.LeftPanel.Visible  = true;
                this.LeftPanel.Dock     = DockStyle.Fill;
                this.LeftLabel.Text     = _tc.ColumnTitle;
                if (_tc.ColumnDefine.TableColumn.DisplayHeight > 1)
                {
                    this.Height             = 22 * _tc.ColumnDefine.TableColumn.DisplayHeight;
                    this.LeftText.Visible   = false;
                    this.LeftMemo.Visible   = true;
                    this.LeftMemo.EditValue = ShowData(_tc, TableRecordData);
                }
                else
                {
                    this.LeftMemo.Visible   = false;
                    this.LeftText.Visible   = true;
                    this.LeftText.EditValue = ShowData(_tc, TableRecordData);
                    this.LeftText.Properties.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
                }
                this._blankLength = 0;
            }
            else
            {
                if (this.BlankLength == 2)
                {
                    this.LeftLabel.Text     = _tc.ColumnTitle;
                    this.LeftMemo.Visible   = false;
                    this.LeftText.Visible   = true;
                    this.LeftText.EditValue = ShowData(_tc, TableRecordData);
                    this._blankLength       = 1;
                }
                else
                {
                    this.RightLabel.Text     = _tc.ColumnTitle;
                    this.RightText.Visible   = true;
                    this.RightText.EditValue = ShowData(_tc, TableRecordData);
                    this._blankLength        = 0;
                }
            }
        }
Example #14
0
        public void RefreshBySaveRequest(MDModel_QueryModel _qv, MDQuery_Request _request)
        {
            this.xtraScrollableControl1.Controls.Clear();
            foreach (MDQuery_ConditionItem _item in _request.ConditionItems)
            {
                switch (_item.Column.ColumnType)
                {
                case QueryColumnType.TableColumn:
                    MDModel_Table_Column _cdefine = MC_QueryModel.GetColumnDefineByAlias(_qv, _item.Column.TableName, _item.Column.ColumnAlias);
                    AddSavedCondition(_cdefine, _item);
                    break;

                case QueryColumnType.CalculationColumn:
                case QueryColumnType.StatisticsColumn:
                    MDModel_Table_Column _ccdefine = new MDModel_Table_Column();
                    _ccdefine.ColumnDataType  = _item.Column.ColumnDataType;
                    _ccdefine.ColumnTitle     = _item.Column.ColumnTitle;
                    _ccdefine.ColumnAlgorithm = _item.Column.ColumnAlgorithm;
                    _ccdefine.ColumnName      = "";
                    _ccdefine.ColumnType      = _item.Column.ColumnType;
                    _ccdefine.TableName       = _item.Column.TableName;
                    _ccdefine.DisplayLength   = _item.Column.DisplayLength;
                    _ccdefine.DisplayFormat   = _item.Column.DisplayFormat;
                    AddSavedCondition(_ccdefine, _item);
                    break;
                }
            }
            this.textEdit1.EditValue = _request.ConditionExpressions;
        }
 public SinoSZUC_ConditionItem(MDModel_Table_Column _column)
 {
     InitializeComponent();
     ColumnDefine = _column;
     InitControls();
     initOperator();
     InitFinished = true;
 }
Example #16
0
        private static string BuildTableColumnResult(MDQuery_TableColumn rColumn, MDModel_QueryModel qv, SinoRequestUser requestUser)
        {
            MDModel_Table_Column _mcolumn = GetColumnDefineByName(qv, rColumn.TableName, rColumn.ColumnName);

            if (_mcolumn == null)
            {
                return("");
            }
            return("," + BuildItem(_mcolumn, requestUser));
        }
Example #17
0
        public static string BuildItem(MDModel_Table_Column _mcolumn)
        {
            if ((_mcolumn.ColumnDefine.TableColumn.SecretLevel > SinoUserCtx.CurUser.SecretLevel) || (!_mcolumn.ColumnDefine.TableColumn.CanDisplay))
            {
                return(string.Format("'***' {0}", _mcolumn.ColumnAlias));
            }


            return(string.Format("{0}.{1} {2}", _mcolumn.TableName, _mcolumn.ColumnName, _mcolumn.ColumnAlias));
        }
Example #18
0
        private static string BuildTableColumnResult(MDQuery_TableColumn _rColumn, MDModel_QueryModel _qv)
        {
            MDModel_Table_Column _mcolumn = MC_QueryModel.GetColumnDefineByName(_qv, _rColumn.TableName, _rColumn.ColumnName);

            if (_mcolumn == null)
            {
                return("");
            }
            return("," + BuildItem(_mcolumn));
        }
Example #19
0
        public static List <MDModel_Table_Column> GetMDModelColumns(this MD_ViewTable ViewTable)
        {
            List <MDModel_Table_Column> _ret = new List <MDModel_Table_Column>();

            foreach (MD_ViewTableColumn _col in ViewTable.Columns)
            {
                MDModel_Table_Column _newcol = new MDModel_Table_Column(_col);
                _ret.Add(_newcol);
            }
            return(_ret);
        }
Example #20
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;
                }
            }
        }
Example #21
0
        public void AddCondition(MDModel_Table_Column _tableColumn)
        {
            if (this.xtraTabControl1.SelectedTabPageIndex == 0)
            {
                //添加到比对条件
                AddCompareCondtion(_tableColumn);
            }

            if (this.xtraTabControl1.SelectedTabPageIndex == 1)
            {
                //添加到筛选条件
                AddFilterCondition(_tableColumn);
            }
        }
Example #22
0
 public MDQuery_ResultTableColumn(MDModel_Table_Column _columnDefine)
 {
     this.ColumnAlgorithm = _columnDefine.ColumnAlgorithm;
     this.ColumnAlias     = _columnDefine.ColumnAlias;
     this.ColumnDataType  = _columnDefine.ColumnDataType;
     this.columnLength    = _columnDefine.ColumnDefine.Length;
     this.refDMB          = _columnDefine.ColumnDefine.RefDMB;
     this.ColumnName      = _columnDefine.ColumnName;
     this.ColumnTitle     = _columnDefine.ColumnTitle;
     this.ColumnType      = _columnDefine.ColumnType;
     this.DisplayOrder    = _columnDefine.DisplayOrder;
     this.DisplayFormat   = _columnDefine.ColumnDefine.DisplayFormat;
     this.DisplayLength   = (_columnDefine.ColumnDefine.ColWidth > 10) ? _columnDefine.ColumnDefine.ColWidth : 80;
     this.Source          = new MDQuery_ColumnSource(_columnDefine.QueryModelName, _columnDefine.TableName, _columnDefine.ColumnName);
 }
Example #23
0
        public static MDQuery_Request RuleToQueryRequest(MD_CheckRule _rule, MDModel_QueryModel _queryModel, MDQuery_Request filter_Request)
        {
            MDQuery_Request _ret = new MDQuery_Request();

            _ret.ChildResultTables    = new List <MDQuery_ResultTable>();
            _ret.QueryModelName       = _rule.QueryModelName;
            _ret.ConditionExpressions = StrUtils.GetMetaByName("C_BDS", _rule.MethodDefine);
            MDQuery_ResultTable _restable = new MDQuery_ResultTable();

            _restable.TableName    = _queryModel.MainTable.TableName;
            _restable.DisplayTitle = _queryModel.DisplayName;
            _restable.Columns      = new List <MDQuery_TableColumn>();
            _ret.MainResultTable   = _restable;
            if (_ret.ConditionItems == null)
            {
                _ret.ConditionItems = new List <MDQuery_ConditionItem>();
            }
            foreach (string _field in StrUtils.GetMetasByName("C_FIELD", _rule.MethodDefine))
            {
                string _index = StrUtils.GetMetaByName("MII_INDEX", _field);
                MDQuery_ConditionItem _citem = new MDQuery_ConditionItem();
                _citem.Operator = StrUtils.GetMetaByName("MII_OPER", _field).TrimStart().TrimEnd();
                MDModel_Table_Column _columnDefine = GetColumn(StrUtils.GetMetaByName("MII_FIELD", _field), _queryModel);
                _citem.Column = new MDQuery_TableColumn(_columnDefine);
                _ret.ConditionItems.Add(_citem);
                _citem.Values      = GetValues(StrUtils.GetMetaByName("MII_VALUE", _field), (_columnDefine.ColumnRefDMB != ""));
                _citem.ColumnIndex = _index;
            }
            if (filter_Request != null && filter_Request.ConditionItems.Count > 0)
            {
                int _oldcount = _ret.ConditionItems.Count;
                _ret.ConditionExpressions = string.Format("({0})", _ret.ConditionExpressions);
                foreach (MDQuery_ConditionItem _fci in filter_Request.ConditionItems)
                {
                    MDQuery_ConditionItem _citem = new MDQuery_ConditionItem();
                    _citem.Operator      = _fci.Operator;
                    _citem.Column        = _fci.Column;
                    _citem.Values        = _fci.Values;
                    _citem.CaseSensitive = _fci.CaseSensitive;
                    _citem.ColumnIndex   = (int.Parse(_fci.ColumnIndex) + _oldcount).ToString();
                    _ret.ConditionItems.Add(_citem);
                    _ret.ConditionExpressions += string.Format("*{0}", _citem.ColumnIndex);
                }
            }
            return(_ret);
        }
Example #24
0
 private void AddTableColumn(MC_QueryRequsetFactory _queryRequestFactory, MDModel_Table _mtable, TreeListNode _fnode)
 {
     foreach (TreeListNode _cnode in _fnode.Nodes)
     {
         string _itemType = (string)_cnode.GetValue("ItemType");
         if (_itemType == "COLUMN")
         {
             //如果是表则处理
             int _state = (int)_cnode.GetValue("State");
             if (_state > 0 && _state < 3)
             {
                 //如果是选中部分或全选中状态
                 MDModel_Table_Column _mColumn = _cnode.GetValue("Data") as MDModel_Table_Column;
                 _queryRequestFactory.AddResultTableColumn(_mtable, _mColumn);
             }
         }
     }
 }
Example #25
0
        private string GetCurrentVEHIData()
        {
            if (ResultData == null)
            {
                return("");
            }
            if (ResultData.Rows.Count < 1)
            {
                return("");
            }
            if (this.QueryModel.MainTable.GetColumnByName("VE_CUSTOMS_NO") == null)
            {
                return("");
            }
            MDModel_Table_Column _tc = this.QueryModel.MainTable.GetColumnByName("VE_CUSTOMS_NO");

            return(ResultData.Rows[0][_tc.ColumnAlias].ToString());
        }
Example #26
0
        public static string BuildItem(MDModel_Table_Column mcolumn, SinoRequestUser requestUser)
        {
            if ((mcolumn.SecretLevel > requestUser.BaseInfo.SecretLevel) || (!mcolumn.CanDisplay))
            {
                return(string.Format("'***' {0}", mcolumn.ColumnAlias));
            }


            if (mcolumn.ColumnRefDMB == string.Empty)
            {
                if (mcolumn.ColumnDataType == "NUMBER")
                {
                    return(string.Format("Round({0}.{1},20) {2}", mcolumn.TableName, mcolumn.ColumnName, mcolumn.ColumnAlias));
                }
                else if (mcolumn.ColumnDataType == "单位名称")
                {
                    return(string.Format("ZHTJ_ZZJG2.GETDWMC(to_number({0}.{1})) {2}", mcolumn.TableName, mcolumn.ColumnName,
                                         mcolumn.ColumnAlias));
                }
                else if (mcolumn.ColumnDataType == "用户名称")
                {
                    return(string.Format("ZHTJ_ZZJG2.Get_YHXM(to_number({0}.{1})) {2}", mcolumn.TableName, mcolumn.ColumnName,
                                         mcolumn.ColumnAlias));
                }
                else
                {
                    return(string.Format("{0}.{1} {2}", mcolumn.TableName, mcolumn.ColumnName, mcolumn.ColumnAlias));
                }
            }
            else
            {
                if (mcolumn.DMBLevelFormat == "多选")
                {
                    return(string.Format("ZHCX.GetCTMuti_FGF(TO_CHAR({0}.{1}),'{3}','{4}') {2}", mcolumn.TableName, mcolumn.ColumnName,
                                         mcolumn.ColumnAlias, mcolumn.ColumnRefDMB, ';'));
                }
                else
                {
                    return(string.Format("ZHCX.GetCT(TO_CHAR({0}.{1}),'{3}') {2}", mcolumn.TableName, mcolumn.ColumnName,
                                         mcolumn.ColumnAlias, mcolumn.ColumnRefDMB));
                }
            }
        }
Example #27
0
        public static string BuildComupteField(string ExpressionString, MDModel_Table TableDefine)
        {
            StringBuilder _ret      = new StringBuilder();
            int           _endIndex = 0;
            string        _cacheStr = "";

            for (int _index = 0; _index < ExpressionString.Length; _index++)
            {
                Char _c = ExpressionString[_index];
                if (Char.IsLetter(_c))
                {
                    string _aliasName = GetFieldAliasName(ExpressionString, _index, out _endIndex);
                    _index = _endIndex;
                    if (TableDefine.AliasDict.ContainsKey(_aliasName))
                    {
                        MDModel_Table_Column _tc = TableDefine.AliasDict[_aliasName];
                        switch (_tc.ColumnType)
                        {
                        case QueryColumnType.TableColumn:
                            _ret.Append(string.Format("{0}.{1}", TableDefine.TableName, _tc.ColumnName));
                            break;

                        case QueryColumnType.CalculationColumn:
                        case QueryColumnType.StatisticsColumn:
                            _ret.Append(string.Format(" ({0}) ", _tc.ColumnAlgorithm));
                            break;
                        }
                    }
                    else
                    {
                        _ret.Append(_aliasName);
                    }
                }
                else
                {
                    _ret.Append(_c);
                }
            }

            return(_ret.ToString());
        }
Example #28
0
        private void xtraScrollableControl1_DragDrop(object sender, DragEventArgs e)
        {
            TreeListNode _node = GetDragNode(e.Data);

            if (_node == null)
            {
                return;
            }

            string _itemType = (string)_node.GetValue("ItemType");

            if (_itemType == "TABLE")
            {
                return;
            }
            if (_itemType == "COLUMN")
            {
                MDModel_Table_Column _tc = _node.GetValue("Data") as MDModel_Table_Column;
                AddFilterCondition(_tc);
            }
        }
Example #29
0
        public static string BuildStatisticsField(string TableName, MDModel_Table_Column _column, MD_FUNCTION FunctionDefine)
        {
            StringBuilder _sb = new StringBuilder();

            _sb.Append("select ");
            _sb.Append(FunctionDefine.Name);
            _sb.Append("(");
            switch (_column.ColumnType)
            {
            case QueryColumnType.TableColumn:
                _sb.Append(string.Format("{0}.{1}", TableName, _column.ColumnName));
                break;

            case QueryColumnType.CalculationColumn:
            case QueryColumnType.StatisticsColumn:
                _sb.Append(string.Format("{0}", _column.ColumnAlgorithm));
                break;
            }
            _sb.Append(string.Format(") from {0}  ", TableName));
            return(_sb.ToString());
        }
Example #30
0
        private void treeList1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            TreeListNode _node = this.treeList1.FocusedNode;

            if (_node != null)
            {
                string _itemType = (string)_node.GetValue("ItemType");
                if (_itemType == "COLUMN")
                {
                    MDModel_Table_Column _item = _node.GetValue("Data") as MDModel_Table_Column;
                    #region 设为选择此字段

                    if (_item.ColumnDefine.CanShowAsResult)
                    {
                        Clipboard.SetDataObject(_item.ColumnAlias);
                        this.te_exp.Paste();
                    }

                    #endregion
                }
            }
        }