private async void buttSubmit_Clicked(object sender, EventArgs e) { double num; var num_text = txtNumber.Text.Trim(); if (num_text == "pi") { num = pi; } else if (num_text == "e") { num = euler; } else if (!double.TryParse(num_text, out num)) { await DisplayAlert("Invalid", "There was an error parsing the number", "Ok"); return; } int count; if (!int.TryParse(txtIterations.Text, out count)) { await DisplayAlert("Invalid", "There was an error parsing the iterations", "Ok"); return; } ContinuedFractionResponse resp = await WebServiceCom.POSTContinuedFractionRequest(num, count); if (resp == null) { await DisplayAlert("Server Error", "There was an issue communicating the server", "Ok"); return; } else if (!string.IsNullOrWhiteSpace(resp.ServerResponse)) { await DisplayAlert("Bad Request", resp.ServerResponse, "Ok"); return; } else { txtOutput.Text = convertEnumerableToString(resp.qSequence); } }
private void VaultMain_Load(object sender, EventArgs e) { if (GlobalAppInfo.User == null) { this.Close(); } dgv.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; var colsToHide = new List <string>(new string[] { "RecordNumber" }); var dSource = WebServiceCom.SendLoadInfoRequest(); dgv.DataSource = dSource; foreach (DataGridViewColumn col in dgv.Columns) { col.Visible = !colsToHide.Contains(col.Name); } }
private void btnLogin_Click(object sender, EventArgs e) { var username = txtUsername.Text.Trim(); var password = txtPassword.Text.Trim(); var user = WebServiceCom.SendLoginRequest(username, password); if (user == null) { MessageBox.Show("Incorrect login information."); } else { //set Global User GlobalAppInfo.User = user; var frm = new VaultMain(); frm.WindowState = FormWindowState.Maximized; frm.StartPosition = FormStartPosition.WindowsDefaultLocation; frm.FormClosed += OnVaultMain_FormClosed; frm.ShowDialog(); } }