// ----------------------------------------------------------
        //                 Save client documents
        // ----------------------------------------------------------
        private static void Save(
            ClientDocumentSet clientDocumentSet,
            int documentSetUID,
            TreeView tvFileList

            )
        {
            ClientDocument    cdsl   = new ClientDocument();
            ClientDocumentSet docSet = new ClientDocumentSet();

            var lodsl = new ListOfscClientDocSetDocLink();

            lodsl.list = new List <scClientDocSetDocLink>();

            // Move data into views..

            int selUID = documentSetUID;

            docSet.Get(clientDocumentSet.FKClientUID, selUID);
            docSet.ClientSetID  = selUID;
            docSet.Folder       = clientDocumentSet.Folder;
            docSet.SourceFolder = clientDocumentSet.SourceFolder;
            docSet.Description  = clientDocumentSet.Description;
            docSet.Update();

            // Save complete tree...

            SaveTreeViewToClient(tvFileList, 0, clientDocumentSet);
        }
Exemple #2
0
        private void UIClientMetadata_Load(object sender, EventArgs e)
        {
            // Get client list from background and load into the list
            //
            foreach (Client c in Utils.ClientList)
            {
                cbxClient.Items.Add(c.UID + "; " + c.Name);
            }

            // Get selected client from the background
            //
            cbxClient.SelectedIndex = Utils.ClientIndex;
            cbxDocumentSet.Text     = Utils.ClientSetText;
            cbxDocumentSet.Enabled  = false;

            cbxClient.Enabled = false;

            //
            // Retrieve document set for a client
            //
            ClientDocumentSet clientDocSet = new ClientDocumentSet();

            clientDocSet.Get(Utils.ClientID, Utils.ClientSetID);
            cbxDocumentSet.SelectedItem = 0;

            txtSourceFolder.Text      = clientDocSet.SourceFolder;
            txtDestinationFolder.Text = clientDocSet.Folder;

            loadList();
        }
Exemple #3
0
        private void UIClientDocumentSet_Load(object sender, EventArgs e)
        {
            foreach (Client c in Utils.ClientList.clientList)
            {
                cbxClient.Items.Add(c.UID + "; " + c.Name);
            }
            // Retrieve current client from background
            //
            cbxClient.SelectedIndex = Utils.ClientIndex;

            // List document sets for a client
            //
            ClientDocumentSetList cdsl = new ClientDocumentSetList();

            cdsl.List(Utils.ClientID);

            foreach (ClientDocumentSet cds in cdsl.documentSetList)
            {
                cbxDocumentSet.Items.Add(cds.UID + "; " + cds.Description);
            }

            // Retrieve document set for a client
            //
            ClientDocumentSet clientDocSet = new ClientDocumentSet();

            documentSetID = 1;
            clientDocSet.Get(Utils.ClientID, documentSetID);
            cbxDocumentSet.SelectedIndex = 0;

            // If this is the first time the client is selected, this program
            // will copy all documents to a client before displaying the list.
            // The list will always come from the client
            // The intention is to use the client type to get the correct
            // Document set before copying the documents to the client
            //

            loadDocumentList();
        }
Exemple #4
0
        //
        // List companies
        //
        private void loadDocumentList()
        {
            elementSourceDataTable.Clear();

            // Check if the client has a list of documents for the template
            //
            ClientDocumentSet cds = new ClientDocumentSet();

            if (cds.Get(Utils.ClientID, documentSetID))
            {
                // Just proceed to list
            }
            else
            {
                // Copy the recors to the client first
            }


            var docoList = new DocumentList();

            docoList.List();

            foreach (Document doco in docoList.documentList)
            {
                DataRow elementRow = elementSourceDataTable.NewRow();
                elementRow["CUID"]                = doco.CUID;
                elementRow["Name"]                = doco.Name;
                elementRow["Directory"]           = doco.Directory;
                elementRow["Subdirectory"]        = doco.Subdirectory;
                elementRow["SequenceNumber"]      = doco.SequenceNumber;
                elementRow["LatestIssueNumber"]   = doco.LatestIssueNumber;
                elementRow["LatestIssueLocation"] = doco.LatestIssueLocation;

                elementSourceDataTable.Rows.Add(elementRow);
            }
        }
Exemple #5
0
        public WordReport(int ClientID, int ClientDocSetID, IOutputMessage UIoutput = null,
                          string OverrideDocuments = null)
        {
            row = 1;

            // Set private attributes
            clientID       = ClientID;
            clientDocSetID = ClientDocSetID;
            uioutput       = UIoutput;

            // Instantiate Word
            //
            vkFalse = false;

            vkWordApp = new Word.Application();

            // Make it not visible
            vkWordApp.Visible = false;

            vkExcelApp = new Excel.Application();

            // Make it not visible
            vkExcelApp.Visible = false;

            // Make it not visible
            oApplication         = new Application();
            oApplication.Visible = false;

            // Get Metadata for client

            clientMetadata = new ReportMetadataList();
            clientMetadata.ListMetadataForClient(clientID);

            ts = new List <WordDocumentTasks.TagStructure>();

            // Load variables/ metadata into memory
            //
            #region ClientMetadata
            foreach (ReportMetadata metadata in clientMetadata.reportMetadataList)
            {
                // Retrieve value for the field selected
                //
                string value = metadata.GetValue();

                // If the field is not enabled, the program has to replace the value with spaces.
                //
                var valueOfTag = metadata.Enabled == 'Y' ? value : string.Empty;

                // When the field is an image and it is not enable, do not include the "No image" icon in the list
                //
                if (metadata.InformationType == MackkadoITFramework.Helper.Utils.InformationType.IMAGE && metadata.Enabled == 'N')
                {
                    continue;
                }

                ts.Add(new WordDocumentTasks.TagStructure()
                {
                    TagType  = metadata.InformationType,
                    Tag      = metadata.FieldCode,
                    TagValue = valueOfTag
                });
            }
            #endregion ClientMetadata

            // Get Client Document Set Details
            // To get the source and destination folders
            cds = new ClientDocumentSet();
            cds.Get(clientID, clientDocSetID);

            valueForProgressBar = 0;
            startTime           = System.DateTime.Now.ToString();

            client = new Client();
            ClientReadRequest crr = new ClientReadRequest();
            crr.clientUID = clientID;
            var response = BUSClient.ClientRead(crr);

            client = response.client;
        }