| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- namespace GBDD;
- public static class SqlQueries
- {
- public static string AuthorizationUser(string login, string password)
- {
- return $"select authorization_user('{login}', '{password}')";
- }
- public static string DriverIdByLogin(string login)
- {
- return $"select driver_id from app_user where login = '{login}'";
- }
- public static string AddDriver(
- string lastName,
- string firstName,
- string middleName,
- string birthDate,
- string city,
- string street,
- string building,
- string apartment,
- string postalCode)
- {
- return $"""
- select add_driver(
- '{lastName}',
- '{firstName}',
- '{middleName}',
- '{birthDate}',
- '{city}',
- '{street}',
- '{building}',
- '{apartment}',
- '{postalCode}'
- )
- """;
- }
- public static string AddViolation(
- int driverId,
- int vehicleId,
- int violationTypeId,
- string uin,
- string amount)
- {
- return $"""
- select add_violation(
- {driverId},
- {vehicleId},
- {violationTypeId},
- current_date,
- null,
- '{uin}',
- {amount}
- )
- """;
- }
- }
|