private void btn_skip_Click_1(object sender, EventArgs e) { winMain fm = new winMain(); fm.Show(); this.Hide(); }
//************************************************************* 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(); }