Ejemplo n.º 1
0
 public AXFolderPnl(AxFolder axFolder, DataTable axFieldMappings, ref SempraDocWs sempraDocWs)
 {
     InitializeComponent();
     barChkViewAllVersions.EditValue = false;
     this.sempraDocWs     = sempraDocWs;
     this.axFolder        = axFolder;
     this.axFieldMappings = axFieldMappings;
     CreateFieldEditors();
 }
Ejemplo n.º 2
0
 public XtraTabAxFolderPage(AxFolder axFolder, DataTable axFolderMapping, ref SempraDocWs sempraDocWs)
 {
     this.axFolder        = axFolder;
     this.axFolderMapping = axFolderMapping;
     this.Text            = axFolder.DisplayName;
     this.sempraDocWs     = sempraDocWs;
     axFolderPanel        = new AXFolderPnl(axFolder, axFolderMapping, ref sempraDocWs);
     axFolderPanel.Dock   = System.Windows.Forms.DockStyle.Fill;
     this.Controls.Add(axFolderPanel);
 }
Ejemplo n.º 3
0
        internal string GetDealsheetFromVault(int tradeID, int version, string tradeSysCode)
        {
            string fieldNames  = "TRD_SYS_ID|TRD_SYS_VER";
            string fieldValues = tradeID + "|" + version;
            string dealSheet   = "";
            string docType     = "";

            byte[] docStream         = new byte[32768];
            bool   latestVersionOnly = false;

            try
            {
                if (version == 0)
                {
                    fieldNames        = "TRD_SYS_ID";
                    fieldValues       = tradeID.ToString();
                    latestVersionOnly = true;
                }
                SempraDocWs ws = new SempraDocWs();


                ws.Url         = VaultUrl;
                ws.Credentials = System.Net.CredentialCache.DefaultCredentials;

                string RetXML = ws.GetDocumentList("DEALSHEETS", fieldNames, fieldValues, latestVersionOnly, "");

                System.Xml.XmlDocument RetXMLNode = new System.Xml.XmlDocument();
                RetXMLNode.LoadXml(RetXML);

                if (RetXMLNode.DocumentElement.SelectSingleNode("//Documents/Doc/ResourceString") == null)
                {
                    return("No Document list found in vault: " + VaultUrl + " for Trade ID: " + tradeID.ToString() + " Version:" + version.ToString());
                }
                else
                {
                    string ResultValue = RetXMLNode.DocumentElement.SelectSingleNode("//Documents/Doc/ResourceString").InnerText;
                    RetXML = ws.GetLatestDocString("DEALSHEETS", ResultValue, "", out dealSheet, out docType);
                }

                if (dealSheet == "")
                {
                    return("Dealsheet not found  for trade and version: " + tradeID.ToString() + ":" + version.ToString());
                }
                else
                {
                    return(dealSheet);
                }
            }
            catch (Exception e)
            {
                throw new Exception("An error occurred while getting the Dealsheet from the vault for the following values:" + Environment.NewLine +
                                    "Trade Id: " + tradeID + ", Version: " + version + ", Trading System Code: " + tradeSysCode + Environment.NewLine +
                                    "Error CNF-416 in " + PROJ_FILE_NAME + ".GetDealsheetFromVault(): " + e.Message);
            }
        }
Ejemplo n.º 4
0
        public bool VaultDocument()
        {
            bool success = false;

            try
            {
                if (doc == null)
                {
                    throw new Exception("Associated Document is not assigned." + Environment.NewLine +
                                        "Error CNF-413 in " + PROJ_FILE_NAME + ".VaultDocument().");
                }
                BuildFieldValues();
                SempraDocWs ws = new SempraDocWs();
                ws.Url         = VaultUrl;
                ws.Credentials = System.Net.CredentialCache.DefaultCredentials;

                FileStream fs            = new FileStream(documentPath, FileMode.Open);
                Int32      initialLength = (Int32)fs.Length;
                byte[]     dataStream    = new byte[initialLength];
                fs.Read(dataStream, 0, initialLength);
                fs.Close();



                string RetXML = ws.ImportDocIntoVault(VaultFolder, documentPath, VaultFolderFieldNames, fieldValues, employee, false, "");
//                string RetXML = ws.ImportDocIntoVault(_lib, "\\\\STConfirm1\\InboundDocuments\\temp\\20121025_1133365641.TIF", _fieldNames, _fieldValues, "", false, "");
                //      string RetXML = ws.ImportDocByStream(VaultFolder, dataStream, "", VaultFolderFieldNames, fieldValues, employee, "");

                ws.Dispose();

                ws = null;

                System.Xml.XmlDocument RetXMLNode = new System.Xml.XmlDocument();
                RetXMLNode.LoadXml(RetXML);
                string ResultCode  = RetXMLNode.DocumentElement.SelectSingleNode("//CallResult/ResultCode").InnerText;
                string ResultValue = RetXMLNode.DocumentElement.SelectSingleNode("//CallResult/ResultValue").InnerText;
                if (ResultCode.Equals("0"))
                {
                    //MessageBox.Show("Inbound Document Vaulted Successfully!");
                    success = true;
                }
                else
                {
                    throw new Exception("An error occurred while vaulting the document: " + ResultValue + "." + Environment.NewLine +
                                        "Error CNF-414 in " + PROJ_FILE_NAME + ".VaultDocument().");
                }
            }
            catch (Exception e)
            {
                throw new Exception("An error occurred while setting up the category display list." + Environment.NewLine +
                                    "Error CNF-415 in " + PROJ_FILE_NAME + ".VaultDocument(): " + e.Message);
            }
            return(success);
        }
Ejemplo n.º 5
0
        public void GeneratePnls(string sourceFilePath, string fieldMappingsFilePath, string vaultUrl, string trackinUrl)
        {
            DataSet   dsStore         = null;
            DataSet   dsStoreMappings = null;
            DataTable dtMappings      = null;
            DataTable dt = null;

            try
            {
                ws             = new SempraDocWs();
                ws.Url         = vaultUrl;
                ws.Credentials = System.Net.CredentialCache.DefaultCredentials;

                //trackingMain.Url =
                //trackingMain = new VaultUtils.trackingClient.TradeConfirmService();
                //trackingMain.Url = trackinUrl;
                //trackingMain.userName = GetServicesUserName();

                if (File.Exists(sourceFilePath))
                {
                    dsStoreMappings = new DataSet();
                    dsStoreMappings.ReadXml(fieldMappingsFilePath);
                    dtMappings = dsStoreMappings.Tables["AxField"];
                }

                if (File.Exists(sourceFilePath))
                {
                    dsStore = new DataSet();
                    dsStore.ReadXml(sourceFilePath);
                    dt = dsStore.Tables["AxFolders"];
                    if (dt != null)
                    {
                        foreach (DataRow dr in dt.Rows)
                        {
                            AxFolder newFolder = CollectionHelper.CreateObjectFromDataRow <AxFolder>(dr);
                            AddAxFolderPnl(newFolder, dtMappings);
                        }
                    }
                }
                else
                {
                    throw new Exception("Exception AXPnl GeneratePnls: File does not exist: " + Environment.NewLine +
                                        "Error CNF-408 in " + PROJ_FILE_NAME + ".GeneratePnls().");
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error creating Inbound Panels." + Environment.NewLine +
                                    "Error CNF-409 in " + PROJ_FILE_NAME + ".GeneratePnls(): " + ex.Message);
            }
        }
Ejemplo n.º 6
0
        public XtraAxTabPage(AxFolder axFolder, string resourceId, ref SempraDocWs ws)
        {
            InitializeComponent();

            this.axFolder = axFolder;
            string fileType = "";

            byte[] docStream = new byte[32768];

            this.resourceId = resourceId;
            this.Name       = "XtraAxTabPage_" + resourceId;

            var result = ws.GetLatestDocStream(axFolder.FolderName, resourceId, axFolder.DslName, out docStream, out fileType);

            if (docStream.Length > 0)
            {
                AddDocViewer(docStream);
            }
        }