public ConfirmClientDetails(DbManager db, Client client, bool update_flag, Order order) { Current = this; this.db = db; this.update_flag = update_flag; newclient = client; current_order = order; InitializeComponent(); lbl_FirstName.Text = client.Firstname; lbl_LastName.Text = client.Lastname; lbl_Tel.Text = client.Tel; lbl_Email.Text = client.Email; lbl_Address.Text = client.Address; lbl_Postalcode.Text = client.Postalcode; lbl_city.Text = client.City; lbl_Country.Text = client.Country; }
private void btn_Client_signup_Click(object sender, EventArgs e) { if (txtBx_Firstname.Text.Equals("") || txtBx_Lastname.Text.Equals("") || txtBx_Tel.Text.Equals("") || txtBx_Email.Text.Equals("") || txtbx_City.Text.Equals("") || txtBx_Address.Text.Equals("") || txtBx_Country.Text.Equals("") || txtBx_postalcode.Text.Equals("") || txtBx_Password.Text.Equals("") || txtbox_confirmPassword.Text.Equals("")) { MessageBox.Show("Please fill in all the fields ", "Titre", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { if (!(txtBx_Firstname.ForeColor == Color.Red || txtBx_Lastname.ForeColor == Color.Red || txtBx_Tel.ForeColor == Color.Red || txtBx_Email.ForeColor == Color.Red || txtbx_City.ForeColor == Color.Red || txtBx_Address.ForeColor == Color.Red || txtBx_Country.ForeColor == Color.Red || txtBx_postalcode.ForeColor == Color.Red || txtBx_Password.ForeColor == Color.Red)) { if (txtbox_confirmPassword.Text == txtBx_Password.Text) { newclient.Password = txtBx_Password.Text; if ((db.List_of_clients.Exists(x => x.Email == newclient.Email)) && (update_flag == false)) { //Change password when client has forgotten his/hers. Form6 form_newPasswrd = new Form6(db, newclient); form_newPasswrd.ShowDialog(); } else { //Add new Client(newclient) after confirmation or update exisiting client; this.Hide(); ConfirmClientDetails confirm_details = new ConfirmClientDetails(db, newclient, update_flag, current_order); confirm_details.ShowDialog(); } } else { MessageBox.Show("Your Passwords do not match ", "Titre", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Please correct the fields highlighted in red ", "Titre", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
public ConfirmClientDetails(DbManager db) { Current = this; this.db = db; InitializeComponent(); }
//Constructors public ConfirmClientDetails() { Current = this; InitializeComponent(); }