private void button5_Click(object sender, EventArgs e) { GenericHelper helper = new GenericHelper(0); string serverAddress = "http://" + Session.Properties.Settings.Default.RemoteDatabaseAddress; if (helper.CheckInternet(serverAddress)) { string name = (textBox5.Text).Trim(); string address = (textBox6.Text).Trim(); string phone1 = (textBox1.Text).Trim(); string phone2 = (textBox3.Text).Trim(); string email = (textBox7.Text).Trim(); string website = (textBox4.Text).Trim(); organization = new Organization(); organization.Name = name; organization.Address = address; organization.Phone1 = phone1; organization.Phone2 = phone2; organization.Email = email; organization.Website = website; organization.Uid = Properties.Settings.Default.UID; button5.Enabled = false; statusLabel1.Text = "Adding organization..."; statusLabel1.Visible = true; statusProgressBar.Visible = true; accountAddBackgroundWorker.RunWorkerAsync(); } else { MessageBox.Show("Organization addition failed! There is no internet connection or there is a problem with the server address. Please check your server settings.", "Organization addition Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void button5_Click(object sender, EventArgs e) { GenericHelper helper = new GenericHelper(0); string serverAddress = "http://" + Session.Properties.Settings.Default.RemoteDatabaseAddress; if (helper.CheckInternet(serverAddress)) { int year = Convert.ToInt32(comboBox1.Text); int output11 = (int)numericUpDown1.Value; int output12 = (int)numericUpDown2.Value; int output13 = (int)numericUpDown3.Value; int output21 = (int)numericUpDown6.Value; int output22 = (int)numericUpDown5.Value; int output23 = (int)numericUpDown4.Value; int output24 = (int)numericUpDown8.Value; int output25 = (int)numericUpDown7.Value; int output31 = (int)numericUpDown11.Value; int output32 = (int)numericUpDown10.Value; previousYear = new PreviousYear(); previousYear.Year = year; previousYear.Output11 = output11; previousYear.Output12 = output12; previousYear.Output13 = output13; previousYear.Output21 = output21; previousYear.Output22 = output22; previousYear.Output23 = output23; previousYear.Output24 = output24; previousYear.Output25 = output25; previousYear.Output31 = output31; previousYear.Output32 = output32; previousYear.Uid = Properties.Settings.Default.UID; button3.Enabled = false; button4.Enabled = false; button5.Enabled = false; statusLabel1.Text = "Adding previous year data - " + year + "..."; statusLabel1.Visible = true; statusProgressBar.Visible = true; accountAddBackgroundWorker.RunWorkerAsync(); } else { MessageBox.Show("Previous year data addition failed! There is no internet connection or there is a problem with the server address. Please check your server settings.", "Previous year data addition Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void SyncUsers() { GenericHelper helper = new GenericHelper(0); string serverAddress = "http://" + Session.Properties.Settings.Default.RemoteDatabaseAddress; if (helper.CheckInternet(serverAddress)) { authenticateLabel.Visible = true; authenticateProgressBar.Visible = true; button1.Enabled = false; authenticateLabel.Text = "Syncing user accounts..."; backgroundWorker2.RunWorkerAsync(); } else { MessageBox.Show("Synchronization failed! There is no internet connection or there is a problem with the server address. Please check your server settings.", "Synchronization Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void button5_Click(object sender, EventArgs e) { GenericHelper helper = new GenericHelper(0); string serverAddress = "http://" + Session.Properties.Settings.Default.RemoteDatabaseAddress; if (helper.CheckInternet(serverAddress)) { string userName = (textBox2.Text).Trim(); string firstName = (textBox5.Text).Trim(); string lastName = (textBox1.Text).Trim(); string password = (textBox3.Text).Trim(); string email = (textBox4.Text).Trim(); string phone = (textBox6.Text).Trim(); string organization = comboBox7.Text; string partner = comboBox1.Text; int accessLevel = comboBox3.SelectedIndex; int activeStatus = comboBox2.SelectedIndex; user = new User(); user.FirstName = firstName; user.LastName = lastName; user.UserName = userName; user.Password = password; user.Email = email; user.Phone = phone; user.Organization = organization; user.Partner = partner; user.AccessLevel = accessLevel; user.ActiveStatus = activeStatus; user.Uuid = Properties.Settings.Default.UID; button5.Enabled = false; statusLabel1.Text = "Adding account..."; statusLabel1.Visible = true; statusProgressBar.Visible = true; accountAddBackgroundWorker.RunWorkerAsync(); } else { MessageBox.Show("Account addition failed! There is no internet connection or there is a problem with the server address. Please check your server settings.", "Account Additions Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void button1_Click(object sender, EventArgs e) { string url = textBox2.Text + textBox1.Text.Trim(); if (!string.IsNullOrEmpty(url)) { //SaveServerAddress(); GenericHelper helper = new GenericHelper(0); if (helper.CheckInternet(url)) { timerDelay2(Color.Chartreuse, "Successful connection!"); } else { timerDelay2(Color.Crimson, "Connection test failed!"); } } else { } }
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { GenericHelper genericHelper = new GenericHelper(); internetStatus = genericHelper.CheckInternet("http://" + Session.Properties.Settings.Default.RemoteDatabaseAddress); }