private void btn_Login(object sender, EventArgs e) { OnLogin LoginDelegate = () => Dispatcher.BeginInvoke(() => NavigationService.Navigate(new Uri("/UsersList.xaml", UriKind.Relative))); OnException ExceptionDelegate = (ex) => Dispatcher.BeginInvoke(() => MessageBox.Show(ex.Message)); CTConnection.ResetProxy(); CTConnection.LoginUser(txtName.Text, txtPassword.Password, LoginDelegate, ExceptionDelegate); }
private void btn_Login(object sender, EventArgs e) { OnLogin LoginDelegate = () => Dispatcher.BeginInvoke(() => NavigationService.Navigate(new Uri("/UsersList.xaml", UriKind.Relative))); OnException ExceptionDelegate = (ex) => Dispatcher.BeginInvoke(() => MessageBox.Show(ex.Message)); CTConnection.ResetProxy(); String retmsg = ""; String AccCode = ""; int sindex = lbAccBook.SelectedIndex; if (sindex > -1) { AccCode = AccBookArray[sindex].AccBookID; } CTConnection.LoginUser(txtName.Text, txtPassword.Password, AccCode, retmsg, LoginDelegate, ExceptionDelegate); }
private void SaveSettings(object sender, EventArgs e) { this.Dispatcher.BeginInvoke(() => { settings["hostname"] = txt_hostname.Text.ToString(); settings["port"] = txt_port.Text.ToString(); settings.Save(); CTConnection.ResetProxy(); try { Convert.ToInt32(txt_port.Text.ToString()); this.NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative)); } catch (Exception) { MessageBox.Show("Invalid port number!"); } }); }