Exemple #1
0
        private void DisplayDealsheet()
        {
            try
            {
                string trdSysTicket = "";
                string trdSysCode = "";

                GridView view = gridViewSummary;
                int rowHandle = view.FocusedRowHandle;

                if (rowHandle == DevExpress.XtraGrid.GridControl.AutoFilterRowHandle)
                {
                    rowHandle = 0;
                }
                trdSysCode = view.GetRowCellDisplayText(rowHandle, "TrdSysCode").ToString();
                trdSysTicket = view.GetRowCellDisplayText(view.FocusedRowHandle, "TradeSysTicket").ToString();
                if (!("".Equals(trdSysTicket)))
                {
                    string getDocumentUrl = Properties.Settings.Default.ExtSvcAPIBaseUrl;
                    string svcUserName = Properties.Settings.Default.ExtSvcAPIUserName;
                    string svcPassword = Properties.Settings.Default.ExtSvcAPIPassword;
                    DealsheetAPIDal dealsheetApiDal = new DealsheetAPIDal(getDocumentUrl, svcUserName, svcPassword);
                    // DealsheetAPIDal dealsheetApiDal = new DealsheetAPIDal("http://hou-121.mercuria.met:9004", svcUserName, svcPassword);

                    string docFormatStr = "";
                    byte[] dealsheetByteStream = dealsheetApiDal.GetDealsheet(trdSysCode, trdSysTicket, out docFormatStr);
                    //   byte[] dealsheetByteStream = dealsheetApiDal.GetDealsheet("ICTS", "2658854", out docFormatStr);
                    DocumentFormat docFormat = Utils.GetDocumentFormat(docFormatStr);

                    if (dealsheetByteStream.Length > 0)
                    {
                        using (MemoryStream contractStream = new MemoryStream(dealsheetByteStream))
                        {
                            richeditDealsheetBrowser.LoadDocument(contractStream, docFormat);
                        }
                    }
                }
                else
                {
                    //webbrowserDealsheet.DocumentText = "";
                }
            }
            catch (Exception ex)
            {
                throw new Exception("An error occurred while attempting to display the trade dealsheet." + Environment.NewLine +
                     "Error CNF-090 in " + FORM_NAME + ".DisplayDealsheet(): " + ex.Message);
            }
        }
Exemple #2
0
 public void Test_DealsheetAPIDal()
 {
     string dealsheetUrl = @"http://cnf01inf01:11111/GetDocument.svc";
     DealsheetAPIDal dealsheetAPIdal = new DealsheetAPIDal(dealsheetUrl, "", "");
     string docFormatStr = "";
     dealsheetAPIdal.GetDealsheet("AFF", "1", out docFormatStr);
 }