示例#1
0
        private Panel CreatePanel(MDModel_Table _ctable)
        {
            Panel _panel = new Panel();

            _panel.Height = 0;
            DataTable _cdt;

            using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient())
            {
                _cdt = _msc.GetChildTableDataByKey(this.QueryModel.FullQueryModelName,
                                                   _ctable.TableName, this.MainKeyID);
            }
            if (_cdt != null)
            {
                int i = 1;
                foreach (DataRow _dr in _cdt.Rows)
                {
                    SinoSZUC_RecordData _crd = new SinoSZUC_RecordData(_ctable, _dr, i++);
                    _crd.Dock = DockStyle.Top;
                    _panel.Controls.Add(_crd);
                    _crd.BringToFront();
                    _panel.Height += _crd.Height;
                }
            }
            _panel.Visible = false;
            _panel.Dock    = DockStyle.Top;
            this.PanelDetail.Controls.Add(_panel);
            ChildTablePanel.Add(_ctable.TableName, _panel);
            return(_panel);
        }
示例#2
0
        private void ShowData()
        {
            DataTable _cdt;

            using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient())
            {
                _cdt = _msc.GetChildTableDataByKey(this.QueryModel.FullQueryModelName,
                                                   TabelDefine.TableName, this.MainKeyID);
            }
            foreach (MDModel_Table_Column _tc in TabelDefine.Columns)
            {
                if (_tc.CanDisplay && _tc.CanResultShow)
                {
                    GridColumn _gc = this.gridView1.Columns.Add();
                    _gc.Caption   = _tc.ColumnTitle;
                    _gc.FieldName = _tc.ColumnAlias;
                    _gc.OptionsColumn.AllowFocus             = true;
                    _gc.OptionsColumn.AllowGroup             = DefaultBoolean.True;
                    _gc.OptionsColumn.AllowIncrementalSearch = true;
                    _gc.OptionsColumn.AllowMerge             = DefaultBoolean.True;
                    _gc.OptionsColumn.AllowMove               = true;
                    _gc.OptionsColumn.AllowSize               = true;
                    _gc.OptionsColumn.AllowSort               = DefaultBoolean.True;
                    _gc.OptionsColumn.ReadOnly                = true;
                    _gc.OptionsColumn.ShowCaption             = true;
                    _gc.OptionsColumn.ShowInCustomizationForm = true;



                    if (_tc.ColumnDefine.TableColumn.DisplayFormat == "")
                    {
                        if (_tc.ColumnDataType == "DATE")
                        {
                            _gc.DisplayFormat.FormatType   = FormatType.DateTime;
                            _gc.DisplayFormat.FormatString = "yyyy-MM-dd";
                        }
                    }
                    else
                    {
                        if (_tc.ColumnDataType == "DATE")
                        {
                            _gc.DisplayFormat.FormatType = FormatType.DateTime;
                        }
                        _gc.DisplayFormat.FormatString = _tc.ColumnDefine.TableColumn.DisplayFormat;
                    }
                    _gc.Width        = (_tc.ColumnDefine.TableColumn.DisplayLength + _tc.ColumnDefine.TableColumn.DisplayHeight) * 80;
                    _gc.VisibleIndex = gridView1.Columns.Count;
                }
            }

            this.sinoCommonGrid1.DataSource = _cdt;
            //this.gridView1.BestFitColumns();
            ShowDetailData();
            this._initFinished = true;
        }