Advertisement
believe_me

Untitled

May 18th, 2022
1,830
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. procedure TCorrectForm.SaveButtonClick(Sender: TObject);
  2. var
  3.     TelephoneNumber: TTelephoneNumber;
  4.     Surname: TSurname;
  5.     Name: TName;
  6.     Patronymic: TPatronymic;
  7.     City: TCity;
  8.     DateofPay: TDateOfPay;
  9.     SameSubscriberIndex: integer;
  10.     RequiredSubscriber: TRequiredSubscriber;
  11. begin
  12.     SameSubscriberIndex := -1;
  13.     TelephoneNumber := toTelephoneNumber(TelephoneEdit.text);
  14.     Surname := toSurname(SurnameEdit.Text);
  15.     Name := toName(NameEdit.Text);
  16.     Patronymic := toPatronymic(PatronymicEdit.Text);
  17.     City := toCity(CityEdit.Text);
  18.     DateOfPay := toDateOfPay(strToDate(DateOfPayLabel.Caption), PaySpinEdit.Value);
  19.     PaySpinEdit.Value := 0;
  20.     EditForm.getRequiredSubscriber(RequiredSubscriber,  TelephoneEdit.text, SurnameEdit.text, NameEdit.text,
  21.                                 PatronymicEdit.text, CityEdit.text);
  22.     if isExist(RequiredSubscriber, SameSubscriberIndex)
  23.         and (not(SubscriberIndex = SameSubscriberIndex)) then
  24.         SubscriberExistsLabel.Visible := true
  25.     else
  26.     begin
  27.         if (not areEditsCorrect()) then
  28.             WrongDataLabel.Visible := true
  29.         else
  30.         begin
  31.             write(SubscriberIndex, TelephoneNumber, Surname, Name, Patronymic, City,
  32.                   DateofPay);
  33.             showSavedInfo();
  34.             SuccessLabel.Visible := true;
  35.         end;
  36.     end;
  37. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement