private void button2_Click(object sender, EventArgs e) { this.Close(); Main_form f = new Main_form(); f.Show(); }
private void button1_Click(object sender, EventArgs e) { Main_form m = new Main_form(); m.Show(); this.Hide(); }
private void button2_Click(object sender, EventArgs e) //back button { this.Hide(); Main_form m = new Main_form(); m.Show(); }
private void button1_Click(object sender, EventArgs e) { bool cond = false; string birthday_date = Timepicker_birthday.Value.ToShortDateString(); if (Timepicker_birthday.Value > DateTime.Now) { MessageBox.Show("Nu sti introdus data de nastere corecta"); } int val = 0; cond = Int32.TryParse(id_value.Text, out val); if (pass_string(password_value) && pass_string(city_value) && pass_string(firstName_value) && pass_string(lastName_value) && pass_string(adress_value) && pass_string(email_value) && pass_string(phoneNumber_value) && pass_number(id_value) && Timepicker_birthday.Value < DateTime.Now) { reset_colors(); try { using (conn = new OracleConnection(CONNECTION_STRING)) { //deschiderea conexiunii conn.Open(); string command = Comenzi_SQL.UpdateClient(val, city_value.Text, firstName_value.Text, lastName_value.Text, birthday_date, adress_value.Text, phoneNumber_value.Text, password_value.Text, email_value.Text); if (Comenzi_SQL.ExecuteOracleCommand(command, conn)) { MessageBox.Show("Datele au fost introduse cu succes"); this.Hide(); Main_form f = new Main_form(); f.Show(); } else { MessageBox.Show("ID-ul acesta este deja luat de catre o persoana"); } } } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } finally { conn.Dispose(); } } }