private void PayButton_Click(object sender, EventArgs e) { this.Hide(); Pay pay = new Pay(Debs, ID, Type_user); pay.ShowDialog(); }
private void PayButton_Click(object sender, EventArgs e) { if (HotelsComboBox.SelectedIndex > -1 && PeopleCoutComboBox.SelectedIndex > -1 && FinishDatePicker.Value >= StartDatePicker.Value.AddDays(1)) { int AmountPay; int.TryParse(string.Join("", AmountLabel.Text.Where(c => char.IsDigit(c))), out AmountPay); this.Hide(); Pay pay = new Pay(AmountPay.ToString(), ID, StartDatePicker.Value.ToShortDateString(), FinishDatePicker.Value.ToShortDateString(), Type_user, HotelsComboBox.SelectedItem.ToString(), PeopleCoutComboBox.SelectedItem.ToString());; pay.ShowDialog(); } }