//************************************************************* public winNewOrder(prcCapParser vPrc) { WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; InitializeComponent(); prc = vPrc; }
//************************************************************* public winMain(prcCapParser vPrc) { WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; InitializeComponent(); prc = vPrc; RunHeartbeat(); }
//************************************************************* public winOrderCancel(prcCapParser vPrc, string vLastOrderId) { WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; InitializeComponent(); prc = vPrc; if (vLastOrderId != "") { txtOrigOrderID.Text = vLastOrderId; } }
//************************************************************* private void btnLogon_Click(object sender, RoutedEventArgs e) { MybusyIndicator.BusyContent = "Loading in process"; MybusyIndicator.IsBusy = true; string xUserName = txtUserName.Text.Nvl(""); string xPassword = txtPassword.Text.Nvl(""); string xSenderCompID = txtSenderCompID.Text.Nvl(""); string xSenderSubID = txtSenderSubID.Text.Nvl(""); new Thread(() => { Thread.CurrentThread.IsBackground = true; prc = new prcCapParser(xUserName, xPassword, xSenderCompID, xSenderSubID, xPassword); ObservableCollection <string> xReVal = prc.Logon(); this.Dispatcher.Invoke(() => { if (xReVal.Count - 2 < 0) { MessageBox.Show("Not appropriate response"); } if (xReVal[xReVal.Count - 2].GetMessageType() == "A") { //Logon successfully ==> Go to Main win. winMain pg = new winMain(prc); pg.Show(); pg.WriteLog(xReVal); this.Close(); MybusyIndicator.IsBusy = false; return; } else { //Error message ==> Display the error. string xError = xReVal[xReVal.Count - 2].GetTagValue("58"); MessageBox.Show(xError); } }); }).Start(); }