private void Register_update_car_Click(object sender, EventArgs e) { if (Wizzard_Helper.inputValidator(Register_car_deatiles) && Register_car_list.SelectedIndex != -1) { Register_utiles.updateCar(GetCarData(), Register_car_list.SelectedIndex); Register_car_list.SelectedIndex = -1; Load_car(); } }
private void Worker_Register_Finish(object sender, EventArgs e) { if (Wizzard_Helper.inputValidator(Worker_Profile_Panel) && Wizzard_Helper.inputValidator(Worker_User_panel)) { try { List <object> profile = new List <object>() { int.Parse(Worker_Id.Text), Worker_fname.Text, Worker_lname.Text, Worker_Bdate.Value.ToShortDateString(), Worker_gender.Text, Worker_phone.Text, Worker_email.Text, }, user = new List <object>() { int.Parse(Worker_Id.Text), Worker_password.Text, Worker_Admin.Checked }; if (Access.Execute(SQL_Queries.Insert("people", profile)) && Access.Execute(SQL_Queries.Insert("workers", user))) { Refresh_Screen(); MessageBox.Show("inserted"); } else { MessageBox.Show(Access.ExplaindError()); Access.Execute(SQL_Queries.Delete("people", new Condition("id", int.Parse(Worker_Id.Text)))); } } catch { } } else { MessageBox.Show("אנא מלא את השדות החסרים"); } }
private void Register_add_car_Click(object sender, EventArgs e) { if (Register_id.Text == "") { MessageBox.Show("אנא הכנס תעודת זהות בחלון הקודם"); return; } if (Wizzard_Helper.inputValidator(Register_car_deatiles)) { if (Register_utiles.ExsistCar(int.Parse(Register_car_number.Text)) == false) { Register_utiles.AddCar(GetCarData()); Register_car_list.SelectedIndex = -1; Load_car(); Clear_Car_Register_Form(); } else { MessageBox.Show("מספר מכונית קיים במערכת"); } } }
private void Register_Finish(object sender, EventArgs e) { List <object> values = new List <object>(); if (Wizzard_Helper.inputValidator(Register_Profile_Page)) { try { values.Add(int.Parse(Register_id.Text)); values.Add(Register_firstname.Text); values.Add(Register_lastname.Text); values.Add(Register_birthady.Value.ToShortDateString()); values.Add(Register_gender.Text); values.Add(Register_phone.Text); values.Add(Register_email.Text); if (Register_utiles.InsertPerson(values) && Register_utiles.InsertCar()) { Refresh_Screen(); Clear_Car_Register_Form(); MessageBox.Show("Inserted"); } else { MessageBox.Show("not Inserted"); } } catch { } } else { MessageBox.Show("not ok"); } //register account }