Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TCorrectForm.SaveButtonClick(Sender: TObject);
- var
- TelephoneNumber: TTelephoneNumber;
- Surname: TSurname;
- Name: TName;
- Patronymic: TPatronymic;
- City: TCity;
- DateofPay: TDateOfPay;
- SameSubscriberIndex: integer;
- RequiredSubscriber: TRequiredSubscriber;
- begin
- SameSubscriberIndex := -1;
- TelephoneNumber := toTelephoneNumber(TelephoneEdit.text);
- Surname := toSurname(SurnameEdit.Text);
- Name := toName(NameEdit.Text);
- Patronymic := toPatronymic(PatronymicEdit.Text);
- City := toCity(CityEdit.Text);
- DateOfPay := toDateOfPay(strToDate(DateOfPayLabel.Caption), PaySpinEdit.Value);
- PaySpinEdit.Value := 0;
- EditForm.getRequiredSubscriber(RequiredSubscriber, TelephoneEdit.text, SurnameEdit.text, NameEdit.text,
- PatronymicEdit.text, CityEdit.text);
- if isExist(RequiredSubscriber, SameSubscriberIndex)
- and (not(SubscriberIndex = SameSubscriberIndex)) then
- SubscriberExistsLabel.Visible := true
- else
- begin
- if (not areEditsCorrect()) then
- WrongDataLabel.Visible := true
- else
- begin
- write(SubscriberIndex, TelephoneNumber, Surname, Name, Patronymic, City,
- DateofPay);
- showSavedInfo();
- SuccessLabel.Visible := true;
- end;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement