private DialogResult CheckIdentification() { // permet l'authentification if (string.IsNullOrEmpty(tbLogin.Text) || string.IsNullOrWhiteSpace(tbLogin.Text)) return this.DialogResult = DialogResult.No; if (string.IsNullOrEmpty(tbPassword.Text) || string.IsNullOrWhiteSpace(tbPassword.Text)) return this.DialogResult = DialogResult.No; string result = Service.GetPaymentService.PersonIdentification(tbLogin.Text, tbPassword.Text); int idClient; if (!Int32.TryParse(result, out idClient)) { InformationBox displayInformation = new InformationBox(result); using (displayInformation) { displayInformation.ShowDialog(); return this.DialogResult = DialogResult.No; } } CurrentClient = new Client(idClient); if (string.IsNullOrWhiteSpace(CurrentClient.result[1]) || string.IsNullOrEmpty(CurrentClient.result[1])) { InformationBox displayInformation = new InformationBox(CurrentClient.result[0]); using (displayInformation) { displayInformation.ShowDialog(); return this.DialogResult = DialogResult.No; } } // avec les information récupérées, on créer une nouvelle instance du client CurrentClient.FillClient(CurrentClient.result); return this.DialogResult = DialogResult.Yes; }
public Payment(Client client) { currentClient = client; InitializeComponent(); }
public ClientInformation(Client client, List<CartesBancaire> cartes) { currentClient = client; this.cartes = cartes; InitializeComponent(); }