bool FS_Initialize_Client() { if (!FSTI_initialized) { try { _fstiClient = new FSTIClient(); // call InitializeByConfigFile // second parameter == true is to participate in unified logon // third parameter == false, no support for impersonation is needed _fstiClient.InitializeByConfigFile(textConfig.Text, true, false); FSTI_initialized = true; // Since this program is participating in unified logon, need to // check if a logon is required. if (_fstiClient.IsLogonRequired) { // Logon is required, enable the logon button FSTI_Login.Enabled = true; FSTI_Login.Focus(); } else { // Logon is not required (because of unified logon), enable the SubmitItem button //FSTI_Logout.Enabled = true; //FSTI_Logout.Focus(); Server_Start.Enabled = true; FSTI_CloseClient.Enabled = true; } // Disable the Initialize button FSTI_Ini.Enabled = false; return(true); } catch (FSTIApplicationException exception) { //MessageBox.Show(exception.Message, "FSTIApplication Exception"); string EmailTo = "*****@*****.**"; string Subject = "FS Movements Error " + DateTime.Now.ToString("MM-dd-yyy hh-mm");; //AlternateView body= string Body = "Server Error: " + exception.Message; mail.CreateMessage(EmailTo, Subject, Body); mail.SendEmail(); _fstiClient.Terminate(); _fstiClient = null; return(false); } } return(true); }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { if (_fstiClient != null) { _fstiClient.Terminate(); _fstiClient = null; } }
private void FSTI_STOP() { if (_fstiClient != null) { _fstiClient.Terminate(); _fstiClient = null; FSTI_Is_Initialized = false; FSTI_Is_Loged = false; } }
private void FSTI_Initialization() { FSTI_ErrorMsg = ""; try { _fstiClient = new FSTIClient(); // call InitializeByConfigFile // second parameter == true is to participate in unified logon // third parameter == false, no support for impersonation is needed _fstiClient.InitializeByConfigFile(CFGFile, true, false); // Since this program is participating in unified logon, need to // check if a logon is required. if (_fstiClient.IsLogonRequired) { // Logon is required, enable the logon button //FSTI_Login.Enabled = true; //FSTI_Login.Focus(); FSTI_Is_Initialized = true; FSTI_Is_Loged = false; } else { // Logon is not required (because of unified logon), enable the SubmitItem button FSTI_Is_Initialized = true; FSTI_Is_Loged = true; } // Disable the Initialize button } catch (FSTIApplicationException exception) { FSTI_ErrorMsg = exception.Message; FSTI_Is_Initialized = false; FSTI_Is_Loged = false; //MessageBox.Show(exception.Message, "FSTIApplication Exception"); _fstiClient.Terminate(); _fstiClient = null; } //return FSTI_Is_Initialized; }
private void FS_Close_Client() { if (!HangFS.Checked) { timer1.Stop(); Server_Start.Enabled = true; Server_Stop.Enabled = false; if (_fstiClient != null) { _fstiClient.Terminate(); _fstiClient = null; } FSTI_Ini.Enabled = true; FSTI_CloseClient.Enabled = false; FSTI_initialized = false; FSTI_loged = false; } }
private void StopServer() { timer1.Stop(); FSTI_Proceed = false; FSTI_Trans.Enabled = false; Server_Start.Enabled = true; Server_Stop.Enabled = false; FSTI_Ini.Enabled = false; FSTI_Login.Enabled = false; if (_fstiClient != null) { _fstiClient.Terminate(); _fstiClient = null; } Proceed_trans = false; }