private void butOK_Click(object sender, EventArgs e) { try { int.Parse(textItemOrder.Text); } catch { MessageBox.Show("Item Order invalid"); } CentralConnectionCur.ServerName = textServerName.Text; CentralConnectionCur.DatabaseName = textDatabaseName.Text; CentralConnectionCur.MySqlUser = textMySqlUser.Text; CentralConnectionCur.MySqlPassword = CentralConnections.Encrypt(textMySqlPassword.Text, FormCentralManager.EncryptionKey); CentralConnectionCur.ServiceURI = textServiceURI.Text; CentralConnectionCur.WebServiceIsEcw = checkWebServiceIsEcw.Checked; CentralConnectionCur.ItemOrder = int.Parse(textItemOrder.Text); CentralConnectionCur.Note = textNote.Text; if (CentralConnectionCur.IsNew) { CentralConnections.Insert(CentralConnectionCur); CentralConnectionCur.IsNew = false; //so a double-click immediately in FormCentralConnections doesn't insert again } else { CentralConnections.Update(CentralConnectionCur); } DialogResult = DialogResult.OK; }
private void butOK_Click(object sender, EventArgs e) { try { int.Parse(textItemOrder.Text); } catch { MessageBox.Show("Item Order invalid"); } //if(textServiceURI.Text=="") { // MessageBox.Show("Please enter a remote URI."); // return; //} //if(textUserName.Text=="") { // MessageBox.Show("Please enter a username."); // return; //} //if(textPassword.Text=="") { //if(!MessageBox.Show(this,MsgBoxButtons.OKCancel,"Do you want to save with no password?")) { // return; //} //} CentralConnectionCur.ServerName = textServerName.Text; CentralConnectionCur.DatabaseName = textDatabaseName.Text; CentralConnectionCur.MySqlUser = textMySqlUser.Text; CentralConnectionCur.MySqlPassword = CentralConnections.Encrypt(textMySqlPassword.Text, FormCentralManager.EncryptionKey); CentralConnectionCur.ServiceURI = textServiceURI.Text; CentralConnectionCur.WebServiceIsEcw = checkWebServiceIsEcw.Checked; CentralConnectionCur.OdUser = textOdUser.Text; CentralConnectionCur.OdPassword = CentralConnections.Encrypt(textOdPassword.Text, FormCentralManager.EncryptionKey); CentralConnectionCur.ItemOrder = int.Parse(textItemOrder.Text); CentralConnectionCur.Note = textNote.Text; if (CentralConnectionCur.IsNew) { CentralConnections.Insert(CentralConnectionCur); } else { CentralConnections.Update(CentralConnectionCur); } DialogResult = DialogResult.OK; }
private void butOK_Click(object sender, EventArgs e) { CentralConnectionCur.ServerName = textServerName.Text; CentralConnectionCur.DatabaseName = textDatabaseName.Text; CentralConnectionCur.MySqlUser = textMySqlUser.Text; CentralConnectionCur.MySqlPassword = CentralConnections.Encrypt(textMySqlPassword.Text, FormCentralManager.EncryptionKey); CentralConnectionCur.ServiceURI = textServiceURI.Text; CentralConnectionCur.WebServiceIsEcw = checkWebServiceIsEcw.Checked; CentralConnectionCur.Note = textNote.Text; CentralConnectionCur.HasClinicBreakdownReports = checkClinicBreakdown.Checked; if (CentralConnectionCur.IsNew) { CentralConnectionCur.ItemOrder = LastItemOrder + 1; CentralConnections.Insert(CentralConnectionCur); CentralConnectionCur.IsNew = false; //so a double-click immediately in FormCentralConnections doesn't insert again } else { CentralConnections.Update(CentralConnectionCur); } DialogResult = DialogResult.OK; }