Exemple #1
0
        private XtraAxTabPage GetActiveTabPage()
        {
            XtraTabControl tabControl = xtraTabControl1;
            XtraTabPage    tabPage    = null;
            XtraAxTabPage  returnVal  = null;

            if (tabControl.TabPages != null)
            {
                tabPage = xtraTabControl1.TabPages[xtraTabControl1.SelectedTabPageIndex];
                foreach (Control control in tabPage.Controls)
                {
                    if (control is XtraTabControl) // it is a grouping tab..
                    {
                        tabControl = (XtraTabControl)control;
                        break;
                    }
                }
            }

            if (tabControl.SelectedTabPage != null)
            {
                returnVal = (XtraAxTabPage)tabControl.TabPages[tabControl.SelectedTabPageIndex];
            }

            return(returnVal);
        }
Exemple #2
0
        private void barBtnXmit_ItemClick(object sender, ItemClickEventArgs e)
        {
            XtraAxTabPage tabPage = GetActiveTabPage();

            if (tabPage != null)
            {
                IAXTab document = (IAXTab)tabPage;
                document.TransmitDocument();
            }
        }
Exemple #3
0
        public void SaveDocuments(string path, string fileName)
        {
            XtraAxTabPage tabPage = GetActiveTabPage();

            if (tabPage != null)
            {
                IAXTab document = (IAXTab)tabPage;
                document.SaveDocument(path, fileName);
            }
        }
Exemple #4
0
        private void CreateDocumentViewers()
        {
            // we want latest version, ONLY if view all verions is NOT checked, AND there is not a specific version selected
            bool displayLatestDocOnly = true;
            if (barChkViewAllVersions.EditValue != null)
            {
                displayLatestDocOnly = (barChkViewAllVersions.EditValue.Equals(false));
            }

            string resouceId = null;
            int versionCounter = 0;
            string versionIndexField = "";
            IList<string> docTypes = new List<string>();
            if (dtDocuments != null)
            {
                // CREATE THIS TABLE ONLY IF THE CURRENT INDEX QRY HAS CHANGED.  ALSO, DO NOT CLEAR THE DOCUMENTS AS WELL
                ClearDocs();


                if (axFolder.GroupByIndexField != "")
                {
                    docTypes = CreateParrentTabs(tblIndexes);
                }

                versionCounter = dtDocuments.Rows.Count;

                //create for all rows
                foreach (DataRow dr in dtDocuments.Rows)
                {
                    resouceId = (string)dr[0];
                    XtraAxTabPage axTabPage = null;

                    versionIndexField = "";
                    if (axFolder.GroupByIndexField != "")
                    {
                        versionIndexField = (string)tblIndexes.Rows[versionCounter - 1][axFolder.GroupByIndexField];
                    }
                    if (versionIndexField != "")  // WE HAVE A VERSION TAB
                    {
                        XtraTabPage versionTabPage = GetVersionTabPage(versionIndexField);
                        XtraTabControl versionTabControl = GetVersionTabControl(versionTabPage, versionIndexField);
                        if (versionTabControl.TabPages.Count == 0)  // Latest document always is the first tab created
                        {
                            axTabPage = new XtraAxTabPage(axFolder, resouceId, ref sempraDocWs);
                            if (axTabPage.Controls.Count > 0)
                            {
                                versionTabControl.TabPages.AddRange(new XtraAxTabPage[] { axTabPage });
                            }
                        }
                        else  // loading all versions
                        {
                            if (displayLatestDocOnly == false)
                            {
                                axTabPage = new XtraAxTabPage(axFolder, resouceId, ref sempraDocWs);
                                if (axTabPage.Controls.Count > 0)
                                {
                                    versionTabControl.TabPages.AddRange(new XtraAxTabPage[] { axTabPage });
                                }
                            }
                        }
                    }
                    else  // these types of documents don't have parrent tabs....
                    {
                        if (xtraTabControl1.TabPages.Count == 0)  // Latest document always is the first tab created
                        {
                            axTabPage = new XtraAxTabPage(axFolder, resouceId, ref sempraDocWs);
                            xtraTabControl1.TabPages.AddRange(new XtraAxTabPage[] { axTabPage });
                        }
                        else  // loading all versions
                        {
                            if (displayLatestDocOnly == false)
                            {
                                axTabPage = new XtraAxTabPage(axFolder, resouceId, ref sempraDocWs);
                                xtraTabControl1.TabPages.AddRange(new XtraAxTabPage[] { axTabPage });
                            }
                        }
                    }
                    versionCounter--;
                }
            }
        }
Exemple #5
0
        private void CreateDocumentViewers()
        {
            // we want latest version, ONLY if view all verions is NOT checked, AND there is not a specific version selected
            bool displayLatestDocOnly = true;

            if (barChkViewAllVersions.EditValue != null)
            {
                displayLatestDocOnly = (barChkViewAllVersions.EditValue.Equals(false));
            }

            string         resouceId         = null;
            int            versionCounter    = 0;
            string         versionIndexField = "";
            IList <string> docTypes          = new List <string>();

            if (dtDocuments != null)
            {
                // CREATE THIS TABLE ONLY IF THE CURRENT INDEX QRY HAS CHANGED.  ALSO, DO NOT CLEAR THE DOCUMENTS AS WELL
                ClearDocs();


                if (axFolder.GroupByIndexField != "")
                {
                    docTypes = CreateParrentTabs(tblIndexes);
                }

                versionCounter = dtDocuments.Rows.Count;

                //create for all rows
                foreach (DataRow dr in dtDocuments.Rows)
                {
                    resouceId = (string)dr[0];
                    XtraAxTabPage axTabPage = null;

                    versionIndexField = "";
                    if (axFolder.GroupByIndexField != "")
                    {
                        versionIndexField = (string)tblIndexes.Rows[versionCounter - 1][axFolder.GroupByIndexField];
                    }
                    if (versionIndexField != "")  // WE HAVE A VERSION TAB
                    {
                        XtraTabPage    versionTabPage    = GetVersionTabPage(versionIndexField);
                        XtraTabControl versionTabControl = GetVersionTabControl(versionTabPage, versionIndexField);
                        if (versionTabControl.TabPages.Count == 0)  // Latest document always is the first tab created
                        {
                            axTabPage = new XtraAxTabPage(axFolder, resouceId, ref sempraDocWs);
                            if (axTabPage.Controls.Count > 0)
                            {
                                versionTabControl.TabPages.AddRange(new XtraAxTabPage[] { axTabPage });
                            }
                        }
                        else  // loading all versions
                        {
                            if (displayLatestDocOnly == false)
                            {
                                axTabPage = new XtraAxTabPage(axFolder, resouceId, ref sempraDocWs);
                                if (axTabPage.Controls.Count > 0)
                                {
                                    versionTabControl.TabPages.AddRange(new XtraAxTabPage[] { axTabPage });
                                }
                            }
                        }
                    }
                    else  // these types of documents don't have parrent tabs....
                    {
                        if (xtraTabControl1.TabPages.Count == 0)  // Latest document always is the first tab created
                        {
                            axTabPage = new XtraAxTabPage(axFolder, resouceId, ref sempraDocWs);
                            xtraTabControl1.TabPages.AddRange(new XtraAxTabPage[] { axTabPage });
                        }
                        else  // loading all versions
                        {
                            if (displayLatestDocOnly == false)
                            {
                                axTabPage = new XtraAxTabPage(axFolder, resouceId, ref sempraDocWs);
                                xtraTabControl1.TabPages.AddRange(new XtraAxTabPage[] { axTabPage });
                            }
                        }
                    }
                    versionCounter--;
                }
            }
        }