private void SubmitButton_Click(object sender, EventArgs e) { if (firstUser == null) { showMessage("Old user is not found / Старый пользователь не найден"); } else if (secondUser == null) { showMessage("New user is not found / Новый пользователь не найден"); } else if (EquipmentList.SelectedIndex == -1) { showMessage("Equipment for tranfer is not selected / Оборудование не передачи не выбрано"); } else if (DeadlineDate.SelectionStart <= DateTime.Today) { showMessage("Chosen date is unavailable / Выбранная дата недоступна"); } else { PrintSheet.PrintTransferSheet(firstUser, secondUser, equipments[EquipmentList.SelectedIndex], DeadlineDate.SelectionStart.ToShortDateString()); Connector1C.transferEquipment(firstUser, secondUser, equipments[EquipmentList.SelectedIndex]); cardReader.CloseConnection(); this.Close(); } }
private void SubmitButton_Click(object sender, EventArgs e) { if (firstUser != null && secondUser != null && EquipmentList.SelectedIndex != -1 && DeadlineDate.Value > DateTime.Today) { PrintSheet.PrintTransferSheet(firstUser, secondUser, equipments[EquipmentList.SelectedIndex], DeadlineDate.Value.ToShortDateString()); //TODO this.Close(); } }