Beispiel #1
0
        private void init(object sender, EventArgs e)
        {
            ICurrentDocumentWindow currentDocumentWin = this.GetServiceForThisTypeKey <ICurrentDocumentWindow>();

            if (currentDocumentWin == null)
            {
                return;
            }

            IFindControlService ser = this.GetService <IFindControlService>();
            Control             c;

            if (ser.TryGet("XdesignerGrid1XMO_AB_D2", out c))
            {
                _dgGrid3 = c as DigiwinGrid;
                _dgGrid3.InnerGridView.MouseDown += new MouseEventHandler(InnerGridView_MouseDown);
            }
            Control d;

            if (ser.TryGet("XdesignerGrid1XMO_AB_D1", out d))
            {
                _dgGrid1 = d as DigiwinGrid;
                _dgGrid1.InnerGridView.MouseDown += new MouseEventHandler(_dgGrid1_InnerGridView_MouseDown);
            }
        }
Beispiel #2
0
        public override void Execute()
        {
            ICurrentDocumentWindow     win        = this.GetServiceForThisTypeKey <ICurrentDocumentWindow>();
            ServiceControl             serControl = win.EditController.EditorView as ServiceControl;
            DependencyObject           entity     = win.EditController.EditorView.DataSource as DependencyObject;
            DependencyObjectCollection XMO_AA_D2  = entity["XMO_AA_D2"] as DependencyObjectCollection;
            IFindControlService        findSer    = serControl.GetService <IFindControlService>();

            if (XMO_AA_D2.Count == 0)
            {
                DigiwinMessageBox.ShowInfo("无导出数据!");
                return;
            }
            Control control;

            if (findSer.TryGet("XdesignerGrid1XMO_AA_D1", out control))
            {
                DigiwinGrid gridControl = control as DigiwinGrid;
                if (gridControl != null)
                {
                    BindingSource bs = gridControl.DataSource as BindingSource;
                    DependencyObjectCollection entityDColl = ((DependencyObjectCollectionView <DependencyObjectView>)bs.List).DependencyObjectCollection;

                    using (var form = new ExportExcelForm(gridControl.InnerGridView, this.ResourceServiceProvider, this.ServiceCallContext))
                    {
                        DialogResult log = form.ShowDialog();
                        if (log == DialogResult.OK)
                        {
                            DigiwinMessageBox.ShowInfo("资料导出成功!");
                        }
                        form.Dispose();
                    }
                }
            }



            return;

            using (var form = new ExportExcelForm(entity, this.ResourceServiceProvider, this.ServiceCallContext))
            {
                DialogResult log = form.ShowDialog();
                if (log == DialogResult.OK)
                {
                    DigiwinMessageBox.ShowInfo("资料导出成功!");
                }
                form.Dispose();
            }
        }
        private void CreateUIControls(object sender, EventArgs e)
        {
            IFindControlService findControlSrv = this.GetService <IFindControlService>();
            Control             control        = null;

            _funtionList = UIEntity.CreateViewEntity(null);
            DependencyObjectView dv = CreateDataSource();

            _dataSource = dv.DependencyObject;
            _dataSource.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(dataSource_PropertyChanged);
            if (findControlSrv.TryGet("desingerTabControl1", out control))
            {
                TabControl tabControl = control as TabControl;
                tabControl.SuspendLayout();
                CreateTableLayout();
                CreateUIView();
                tabControl.TabPages[0].Controls.Add(_table);
                tabControl.ResumeLayout(false);
            }
        }
        private void CreateUIControls(object sender, EventArgs e)
        {
            IFindControlService findControlSrv = this.GetService <IFindControlService>();
            Control             control        = null;

            if (findControlSrv.TryGet("pickListCOMPANY_TYPE", out control))
            {
                if (control != null)
                {
                    DigiwinPickListLookUpEdit pick = control as DigiwinPickListLookUpEdit;
                    if (pick != null)
                    {
                        ICurrentDocumentWindow win = this.GetServiceForThisTypeKey <ICurrentDocumentWindow>();
                        if (win != null)
                        {
                            string           id    = win.EditController.EditorView.Id;
                            DependencyObject dataS = win.EditController.Document.DataSource as DependencyObject;
                            if (dataS != null && dataS.ExtendedProperties.Contains("TFL") && //只有在E10中的公式录入界面才执行下面的逻辑,才依据此扩展属性修改过滤条件,在Excel中不控制
                                (id.Contains("QC") || id.Contains("QM") || id.Contains("FS") ||
                                 id.Contains("LFS")
                                ))
                            {
                                pick.FilterExpression = "\"[Id] In (2)\"";
                            }

                            if (dataS != null && dataS.ExtendedProperties.Contains("TFL_FormulaView") && //只有在E10中的公式查看按钮才执行下面的逻辑
                                (id.Contains("QC") || id.Contains("QM") || id.Contains("FS") ||
                                 id.Contains("LFS")
                                ))
                            {
                                SetFINReadOnly(sender as EditorView);
                            }
                        }
                    }
                }
            }
        }