private void createButton_Click(object sender, EventArgs e) { string passport = ClientComboBox.SelectedValue.ToString(); string carId = numCarComboBox.SelectedValue.ToString(); int duration = Convert.ToInt32(durationComboBox.Value); string from = fromTextBox.Text; string to = toTextBox.Text; if (db.createRent(passport, carId, user, from, to, duration)) { MessageBox.Show("Rent is created"); ClientComboBox.Text = ""; numCarComboBox.Text = ""; clientTeltextBox.Text = ""; clientNameTextBox.Text = ""; brandCarTextBox.Text = ""; modelCarTextBox.Text = ""; locationTextBox.Text = ""; durationComboBox.Value = 0; priceTextBox.Text = ""; fromTextBox.Text = ""; toTextBox.Text = ""; } else { MessageBox.Show("Rent doesn't create"); } this.Validate(); RCTableAdapterManager.UpdateAll(this.myDbDataSet); }
private void createButton_Click(object sender, EventArgs e) { string name = clientNametextBox.Text; string pass = clientPassportTextBox.Text; string tel = clientTeltextBox.Text; Client cl = db.addClient(pass, name, tel); if (cl == null || clientNametextBox.Text == "" && clientPassportTextBox.Text == "" && clientTeltextBox.Text == "") { MessageBox.Show("Error! Client isn't added"); } else { MessageBox.Show("Client " + name + " is created"); clientNametextBox.Text = ""; clientPassportTextBox.Text = ""; clientTeltextBox.Text = ""; } this.Validate(); RCTableAdapterManager.UpdateAll(this.myDbDataSet); }
private void buttonText_Click_1(object sender, EventArgs e) { this.Validate(); rentBindingSource.EndEdit(); RCTableAdapterManager.UpdateAll(this.myDbDataSet); }