Exemple #1
0
        private void ImportXML(string fileName)
        {
            System.Xml.Serialization.XmlSerializer mySerializer = new System.Xml.Serialization.XmlSerializer(typeof(TemplateExchange));
            // To read the file, create a FileStream.
            System.IO.FileStream myFileStream = new System.IO.FileStream(fileName, System.IO.FileMode.Open);
            // Call the Deserialize method and cast to the object type.
            TemplateExchange tex = (TemplateExchange)mySerializer.Deserialize(myFileStream);

            myFileStream.Close();

            fTemplateVersionTag fVT = new fTemplateVersionTag(tex.trs);
            DialogResult        dr  = fVT.ShowDialog(this);

            if (dr != System.Windows.Forms.DialogResult.OK)
            {
                MessageBox.Show("The Template Import operation was cancelled.", "Import Cancelled", MessageBoxButtons.OK);
            }
            else
            {
                using (fWait fw = new fWait("Importing templates, please wait."))
                {
                    UpdateTemplates(tex);
                }
            }
        }
Exemple #2
0
 private void LaunchWorkflowDesigner()
 {
     if (!verifyOpenForm("fSeries"))
     {
         using (fWait fProgress = new fWait("Loading Workflow Designer, please wait"))
         {
             fSeries f = new fSeries(this);
             f.Show();
             f.WindowState    = FormWindowState.Maximized;
             WorkflowDesigner = f;
         }
     }
 }
Exemple #3
0
        private void Export()
        {
            templateGridEX.CurrentRow.EndEdit();
            templateGridEX.UpdateData();

            appDB.TemplateRow[] selectedTemplates = (appDB.TemplateRow[])AtMng.DB.Template.Select("Export=True");
            if (selectedTemplates.Length == 0)
            {
                MessageBox.Show("You have not selected any templates to export.");
                return;
            }

            fTemplateVersionTag fVT = new fTemplateVersionTag(selectedTemplates);
            DialogResult        dr  = fVT.ShowDialog(this);

            if (dr != System.Windows.Forms.DialogResult.OK)
            {
                MessageBox.Show("The Template Export was cancelled.", "Export Cancelled", MessageBoxButtons.OK);
                return;
            }


            saveFileDialog1.Filter   = "XML files (*.xml)|*.xml|All files (*.*)|*.*";
            saveFileDialog1.FileName = "{0}_templates" + DateTime.Today.ToString("yyyyMMdd") + ".xml";
            if (saveFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                string saveas = saveFileDialog1.FileName;

                using (fWait fw = new fWait("Exporting templates, please wait."))
                {
                    int iPart            = 1;
                    int iMax             = 30000000;
                    int iCount           = 0;
                    TemplateExchange tex = new TemplateExchange();
                    foreach (appDB.TemplateRow tr in selectedTemplates)
                    {
                        tr.ExportedDate = fVT.ExportDate;
                        tr.Tag          = fVT.TagVersion;
                        if (fVT.ClearFlag)
                        {
                            tr.FlagForExport = false;
                        }

                        tex.trs.ImportRow(tr);
                        if (tex.dcrs.FindByDocId(tr.DocID) == null)
                        {
                            docDB.DocumentRow dr1 = myDM.DB.Document.FindByDocId(tr.DocID);
                            tex.drs.ImportRow(dr1);

                            docDB.DocContentRow dcr1 = myDM.DB.DocContent.FindByDocId(dr1.DocRefId);

                            if (dcr1 == null)
                            {
                                myDM.GetDocContent().Load(dr1.DocRefId, dr1.CurrentVersion); //WI 73696 - added current version
                            }
                            dcr1    = myDM.DB.DocContent.FindByDocId(dr1.DocRefId);
                            iCount += dcr1.Size;
                            tex.dcrs.ImportRow(dcr1);
                        }
                        if (iCount >= iMax)
                        {
                            System.Xml.Serialization.XmlSerializer mySerializer = new System.Xml.Serialization.XmlSerializer(typeof(TemplateExchange));
                            // To write to a file, create a StreamWriter object.
                            System.IO.StreamWriter myWriter = new System.IO.StreamWriter(String.Format(saveas, iPart));
                            mySerializer.Serialize(myWriter, tex);
                            myWriter.Close();
                            Save();

                            iCount = 0;
                            iPart++;
                            tex = new TemplateExchange();
                        }
                    }


                    System.Xml.Serialization.XmlSerializer mySerializer1 = new System.Xml.Serialization.XmlSerializer(typeof(TemplateExchange));
                    // To write to a file, create a StreamWriter object.
                    System.IO.StreamWriter myWriter1 = new System.IO.StreamWriter(String.Format(saveas, iPart));
                    mySerializer1.Serialize(myWriter1, tex);
                    myWriter1.Close();
                    Save();
                }
            }
            else
            {
                MessageBox.Show("The Template Export was cancelled.", "Export Cancelled", MessageBoxButtons.OK);
            }
        }
Exemple #4
0
        //private void dumpToolStripMenuItem_Click(object sender, EventArgs e)
        //{
        //    try
        //    {
        //        this.saveFileDialog1.ShowDialog();
        //        string file = this.saveFileDialog1.FileName;


        //        Atmng.acMng.DB.WriteXml(file);//, XmlWriteMode.WriteSchema);
        //    }
        //    catch (Exception x)
        //    {
        //        UIHelper.HandleUIException(x);
        //    }

        //}

        //private void toolStripButton1_Click(object sender, EventArgs e)
        //{
        //    if (MdiChildren.Length > 0)
        //    {
        //        if (MessageBox.Show("All screens must be closed in order to reload the configuration data.\nIf you made any edits and want to save your changes before refreshing the data, please cancel this dialog by selecting No, save your changes, then refresh the config data.\n\nAre you sure you want to refresh the config data and close all screens automatically?", "Refresh Configuration Data", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
        //        {
        //            foreach (Form childForm in MdiChildren)
        //            {
        //                childForm.Close();
        //            }
        //            atmng.acMng.LoadAllConfigInfo();
        //            atmng.LoadDDInfo();

        //        }
        //    }
        //    else
        //    {
        //        atmng.acMng.LoadAllConfigInfo();
        //        atmng.LoadDDInfo();
        //    }
        //}


        //private void examineToolStripMenuItem_Click(object sender, EventArgs e)
        //{
        //    try
        //    {
        //        if (MessageBox.Show("This will erase all pending changes.  Do not edit data after examining.", "Warning", MessageBoxButtons.OKCancel) == DialogResult.OK)
        //        {
        //            this.openFileDialog1.ShowDialog();
        //            string file = this.openFileDialog1.FileName;

        //            Atmng.acMng.DB.Clear();
        //            foreach (DataTable dt in Atmng.acMng.DB.Tables)
        //            {
        //                dt.BeginLoadData();
        //            }
        //            Atmng.acMng.isMerging = true;
        //            Atmng.acMng.DB.ReadXml(file);//, XmlReadMode.ReadSchema);
        //            Atmng.acMng.isMerging = false;
        //            foreach (DataTable dt in Atmng.acMng.DB.Tables)
        //            {
        //                dt.EndLoadData();
        //            }
        //            Atmng.acMng.DB.AcceptChanges();

        //        }

        //    }
        //    catch (Exception x)
        //    {
        //        UIHelper.HandleUIException(x);
        //    }

        //}

        private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e)
        {
            Application.UseWaitCursor = true;

            try
            {
                switch (e.Command.Key)
                {
                case "cmdArchive":
                    if (!verifyOpenForm("fArchive"))
                    {
                        fArchive f = new fArchive(this);
                        f.Show();
                        f.WindowState = FormWindowState.Maximized;
                    }
                    break;

                case "cmdSystemMessages":
                    if (!verifyOpenForm("fSystemMessage"))
                    {
                        fSystemMessage f = new fSystemMessage(this);
                        f.Show();
                        f.WindowState = FormWindowState.Maximized;
                    }
                    break;

                case "cmdExportDocs":
                    fExportDocs fexp = new fExportDocs(this);
                    fexp.Show();
                    fexp.WindowState = FormWindowState.Maximized;
                    break;

                case "cmdConfigSync":
                    fConfigSync fcsy = new fConfigSync(this);
                    fcsy.Show();
                    fcsy.WindowState = FormWindowState.Maximized;
                    break;

                case "cmdWWHelp":
                    using (fWait fProgress = new fWait("Loading Deskbook Data, please wait"))
                    {
                        fHelp fh = new fHelp(this);
                        fh.Show();
                        fh.WindowState = FormWindowState.Maximized;
                    }
                    break;

                case "cmdClose":
                    if (ActiveMdiChild != null)
                    {
                        ActiveMdiChild.Close();
                    }
                    break;

                case "cmdExit":
                    this.Close();
                    break;

                case "cmdAppSettings":
                    if (!verifyOpenForm("fAppSetting"))
                    {
                        fAppSetting f = new fAppSetting(this);
                        f.Show();
                        f.WindowState = FormWindowState.Maximized;
                    }
                    break;

                case "cmdReportAdmin":
                    using (fWait fProgress = new fWait("Loading Report Admin Module, please wait"))
                    {
                        if (!verifyOpenForm("fReportAdmin"))
                        {
                            fReportAdmin f = new fReportAdmin(this);
                            f.Show();
                            f.WindowState = FormWindowState.Maximized;
                        }
                    }
                    break;

                case "cmdActivityCode":
                    using (fWait fProgress = new fWait("Loading Activity Code Templates, please wait"))
                    {
                        if (!verifyOpenForm("fACTemplate"))
                        {
                            fACTemplate f = new fACTemplate(this);
                            f.Show();
                            f.WindowState = FormWindowState.Maximized;
                        }
                    }
                    break;

                case "cmdCity":
                    if (!verifyOpenForm("fCity"))
                    {
                        fCity f = new fCity(this);
                        f.Show();
                        f.WindowState = FormWindowState.Maximized;
                    }
                    break;

                case "cmdPLOffice":
                    using (fWait fProgress = new fWait("Loading Office File Distribution Data, please wait"))
                    {
                        if (!verifyOpenForm("fPLOffice"))
                        {
                            fPLOffice f = new fPLOffice(this);
                            f.Show();
                            f.WindowState = FormWindowState.Maximized;
                        }
                    }
                    break;

                case "cmdBatchReview":
                    using (fWait fProgress = new fWait("Loading Batch Job Data, please wait"))
                    {
                        if (!verifyOpenForm("fBatch"))
                        {
                            fBatch f = new fBatch(this);
                            f.Show();
                            f.WindowState = FormWindowState.Maximized;
                        }
                    }
                    break;

                case "cmdProvinces":
                    if (!verifyOpenForm("fProvinces"))
                    {
                        fProvinces f = new fProvinces(this);
                        f.Show();
                        f.WindowState = FormWindowState.Maximized;
                    }
                    break;

                case "cmdDocTemplates":
                    using (fWait fProgress = new fWait("Loading Document Templates, please wait"))
                    {
                        if (!verifyOpenForm("fTemplates"))
                        {
                            fTemplates f = new fTemplates(this);
                            f.Show();
                            f.WindowState = FormWindowState.Maximized;
                        }
                    }
                    break;

                case "cmdLookupTables":
                    using (fWait fProgress = new fWait("Loading Lookup Table Data, please wait"))
                    {
                        if (!verifyOpenForm("fLookup"))
                        {
                            fLookup f = new fLookup(this, true);
                            f.Show();
                            f.WindowState = FormWindowState.Maximized;
                        }
                    }
                    break;

                case "cmdLookupTablesAll":
                    using (fWait fProgress = new fWait("Loading Lookup Table Data, please wait"))
                    {
                        if (!verifyOpenForm("fLookup"))
                        {
                            fLookup f = new fLookup(this, false);
                            f.Show();
                            f.WindowState = FormWindowState.Maximized;
                        }
                    }
                    break;

                case "cmdOfficeToJD":
                    if (!verifyOpenForm("fOfficeToJudicialDistrict"))
                    {
                        fOfficeToJudicialDistrict f = new fOfficeToJudicialDistrict(this);
                        f.Show();
                        f.WindowState = FormWindowState.Maximized;
                    }
                    break;

                case "cmdWFDesigner":
                    LaunchWorkflowDesigner();
                    break;

                case "cmdAdhocQuery":
                    fSQL fsql = new fSQL(this);
                    fsql.Show();
                    fsql.WindowState = FormWindowState.Maximized;
                    break;

                case "cmdBFTemplates":
                    using (fWait fProgress = new fWait("Loading BF Template Data, please wait"))
                    {
                        if (!verifyOpenForm("fBFCode"))
                        {
                            fBFCode f = new fBFCode(this);
                            f.Show();
                            f.WindowState = FormWindowState.Maximized;
                        }
                    }
                    break;

                case "cmdIssues":
                    using (fWait fProgress = new fWait("Loading Issues, please wait"))
                    {
                        if (!verifyOpenForm("fIssues"))
                        {
                            fIssues f = new fIssues(this);
                            f.Show();
                            f.WindowState = FormWindowState.Maximized;
                        }
                    }
                    break;

                case "cmdOfficeMandates":
                    if (!verifyOpenForm("fOfficeMandate"))
                    {
                        fOfficeMandate f = new fOfficeMandate(this);
                        f.Show();
                        f.WindowState = FormWindowState.Maximized;
                    }
                    break;

                case "cmdDataDictionnary":
                    using (fWait fProgress = new fWait("Loading Data Dictionnary Data, please wait"))
                    {
                        if (!verifyOpenForm("fDataDictionnary"))
                        {
                            fDataDictionnary f = new fDataDictionnary(this);
                            f.Show();
                            f.WindowState = FormWindowState.Maximized;
                        }
                    }
                    break;

                case "cmdDDLookup":
                    using (fWait fProgress = new fWait("Loading DD Lookup, please wait"))
                    {
                        if (!verifyOpenForm("fDDLookup"))
                        {
                            fDDLookup f = new fDDLookup(this);
                            f.Show();
                            f.WindowState = FormWindowState.Maximized;
                        }
                    }
                    break;

                case "cmdSecRules":
                    using (fWait fProgress = new fWait("Loading Security Rules Data, please wait"))
                    {
                        if (!verifyOpenForm("fRules"))
                        {
                            fRules f = new fRules(this);
                            f.Show();
                            f.WindowState = FormWindowState.Maximized;
                        }
                    }
                    break;

                case "cmdGroups":
                    using (fWait fProgress = new fWait("Loading Security Groups Data, please wait"))
                    {
                        if (!verifyOpenForm("fGroups"))
                        {
                            fGroups f = new fGroups(this);
                            f.Show();
                            f.WindowState = FormWindowState.Maximized;
                        }
                    }
                    break;

                case "cmdDistList":
                    if (!verifyOpenForm("fDistributionList"))
                    {
                        fDistributionList f = new fDistributionList(this);
                        f.Show();
                        f.WindowState = FormWindowState.Maximized;
                    }
                    break;

                case "cmdImportExternalDocs":
                    fLoad fl = new fLoad(this);
                    fl.Show();
                    fl.WindowState = FormWindowState.Maximized;
                    break;

                case "cmdACMenu":
                    if (!verifyOpenForm("fACMenu"))
                    {
                        fACMenu f = new fACMenu(this);
                        f.Show();
                        f.WindowState = FormWindowState.Maximized;
                    }
                    break;

                case "cmdPeriodicFileClosure":
                    if (!verifyOpenForm("fClose"))
                    {
                        fClose f = new fClose(this);
                        f.Show();
                        f.WindowState = FormWindowState.Maximized;
                    }
                    break;

                case "cmdFileMetaType":
                    if (!verifyOpenForm("fFileMetaChildren"))
                    {
                        fFileMetaChildren f = new fFileMetaChildren(this);
                        f.Show();
                        f.WindowState = FormWindowState.Maximized;
                    }
                    break;

                case "cmdOfficerPrefs":
                    using (fWait fProgress = new fWait("Loading Officer Preferences Data, please wait"))
                    {
                        if (!verifyOpenForm("fOfficerPreferences"))
                        {
                            fOfficerPreferences f = new fOfficerPreferences(this);
                            f.Show();
                            f.WindowState = FormWindowState.Maximized;
                        }
                    }
                    break;

                case "cmdEventLog":
                    using (fWait fProgress = new fWait("Loading Log Event Data, please wait"))
                    {
                        if (!verifyOpenForm("fLogEvent"))
                        {
                            fLogEvent f = new fLogEvent(this);
                            f.Show();
                            f.WindowState = FormWindowState.Maximized;
                        }
                    }
                    break;

                case "cmdLegislation":
                    if (!verifyOpenForm("fLegislation"))
                    {
                        fLegislation f = new fLegislation(this);
                        f.Show();
                        f.WindowState = FormWindowState.Maximized;
                    }
                    break;
                }
            }
            catch (Exception x)
            {
                UIHelper.HandleUIException(x);
            }
            finally
            {
                Application.UseWaitCursor = false;
            }
        }