/// <summary>
        /// call the login service
        /// </summary>
        /// <param name="account">netsuite account</param>
        private void executeLogin(string account)
        {
            string _account = string.IsNullOrEmpty(account) ? ConfigurationManager.AppSettings["account"].Split(',')[0] : account;
            if (_account.Contains('|')) _account = _account.Split('|')[0];

            Login login = new Login(_account);

            bool isSandbox = false;
            if(!string.IsNullOrEmpty(account))
            {
                DialogResult dlrSandbox = MessageBox.Show("Connect to sandbox account?", "Question", MessageBoxButtons.YesNo);
                isSandbox = (dlrSandbox == DialogResult.Yes);
            }

            netSuiteService = new DataCenterAwareNetSuiteService(login.Account, isSandbox);

            ///password not mandatory in configuration
            if (string.IsNullOrEmpty(login.Password))
            {
                FrmDialog passwordDialog = new FrmDialog();
                passwordDialog.Text = login.Email;
                if (passwordDialog.ShowDialog(this) == DialogResult.OK)
                {
                    login.Password = passwordDialog.txtPassword.Text;
                }
                else
                {
                    login.Password = string.Empty;
                }
                passwordDialog.Dispose();
            }


            sessionResponse = login.login(netSuiteService);
            if (sessionResponse != null && sessionResponse.status.isSuccess)
            {
                lblToolStripStatus.Text = ((isSandbox) ? "SANDBOX " : "") + "Account: " + login.Account + " - Email: " + login.Email;
                appendLog("Login done [" + lblToolStripStatus.Text + "]");

                netSuiteService.addListCompleted += netSuiteService_addListCompleted;
                loadTasks();
            }
            else
            {
                tmrTimeout.Stop();

                lblToolStripStatus.Text = "Login failed!";
                appendLog(lblToolStripStatus.Text, NOTIFICATION_ERROR);
            }
        }
 private void frmUploader_Closing(object sender, FormClosingEventArgs e)
 {
     Login login = new Login();
     login.logout(netSuiteService, sessionResponse);
 }
        private void ddbAccount_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            Login login = new Login();
            login.logout(netSuiteService, sessionResponse);

            executeLogin(e.ClickedItem.ToString());
        }