|
@@ -29,29 +29,30 @@ namespace Transportation
|
|
|
|
|
|
private void Form1_Load(object sender, EventArgs e)
|
|
|
{
|
|
|
+
|
|
|
dbhelper.openConnection(ref dbhelper.sqlConnection);
|
|
|
|
|
|
- dataAdapter = new SqlDataAdapter("select * from Vehicles", dbhelper.sqlConnection);
|
|
|
+ dataAdapter = new SqlDataAdapter("select code_vehicle as 'Код автомобиля', (executors.surname_executor + ' ' + executors.name_executor + ' ' + executors.midname_executor) as 'ФИО исполнителя', brand_vehicle as 'Марка автомобиля', model_vehicle as 'Модель автомобиля', number_vehicle as 'Гос. номер автомобиля', name_category as 'Категория прицепа', volume_body as 'Тоннаж', length_body as 'Длина автомобиля', width_body as 'Ширина автомобиля', height_body as 'Высота автомобиля' from vehicles, executors, category_trailer where vehicles.code_executor = executors.code_executor and vehicles.code_category = category_trailer.code_category", dbhelper.sqlConnection);
|
|
|
dataSet = new DataSet();
|
|
|
dataAdapter.Fill(dataSet);
|
|
|
VehiclesDGV.DataSource = dataSet.Tables[0];
|
|
|
|
|
|
- dataAdapter = new SqlDataAdapter("select * from Drivers", dbhelper.sqlConnection);
|
|
|
+ dataAdapter = new SqlDataAdapter("select code_driver as 'Код водителя', (executors.surname_executor + ' ' + executors.name_executor + ' ' + executors.midname_executor) as 'ФИО исполнителя', surname_driver as 'Фамилия водителя', name_driver as 'Имя водителя', midname_driver as 'Отчество водителя', number_passport_driver as 'Серия-номер паспорта', place_passport_driver as 'Место выдачи паспорта', date_passport_driver as 'Дата выдачи паспорта', code_passport_driver as 'Код подразделения', number_driverlicense as 'Серия-номер вод. удостоверения', telephone_driver as 'Телефон водителя' from executors, drivers where drivers.code_executor = executors.code_executor", dbhelper.sqlConnection);
|
|
|
dataSet = new DataSet();
|
|
|
dataAdapter.Fill(dataSet);
|
|
|
DriversDGV.DataSource = dataSet.Tables[0];
|
|
|
|
|
|
- dataAdapter = new SqlDataAdapter("select * from Executors", dbhelper.sqlConnection);
|
|
|
+ dataAdapter = new SqlDataAdapter("select code_executor as 'Код исполнителя', surname_executor as 'Фамилия исполнителя', name_executor as 'Имя исполнителя', midname_executor as 'Отчество исполнителя' from Executors", dbhelper.sqlConnection);
|
|
|
dataSet = new DataSet();
|
|
|
dataAdapter.Fill(dataSet);
|
|
|
ExecutorsDGV.DataSource = dataSet.Tables[0];
|
|
|
|
|
|
- dataAdapter = new SqlDataAdapter("select * from Logisticians", dbhelper.sqlConnection);
|
|
|
+ dataAdapter = new SqlDataAdapter("select code_logistician as 'Код логиста', surname_logistician as 'Фамилия логиста', name_logistician as 'Имя логиста', midname_logistician as 'Отчество логиста', number_passport_logistician as 'Серия-номер паспорта', place_passport_logistician as 'Место выдачи паспорта', date_passport_logistician as 'Дата выдачи паспорта', code_passport_logistician as 'Код подразделения', telephone_logistician as 'Телефон логиста' from Logisticians", dbhelper.sqlConnection);
|
|
|
dataSet = new DataSet();
|
|
|
dataAdapter.Fill(dataSet);
|
|
|
LogisticiansDGV.DataSource = dataSet.Tables[0];
|
|
|
|
|
|
- dataAdapter = new SqlDataAdapter("select * from Requests", dbhelper.sqlConnection);
|
|
|
+ dataAdapter = new SqlDataAdapter("select code_request as 'Код заявки', (executors.surname_executor + ' ' + executors.name_executor + ' ' + executors.midname_executor) as 'ФИО исполнителя', (drivers.surname_driver + ' ' + drivers.name_driver + ' ' + drivers.midname_driver) as 'ФИО водителя', (vehicles.brand_vehicle + ' ' + vehicles.model_vehicle + ' ' + vehicles.number_vehicle) as 'Автомобиль', (logisticians.surname_logistician + ' ' + logisticians.name_logistician + ' ' + logisticians.midname_logistician) as 'ФИО логиста', date_loading as 'Дата загрузки', place_loading as 'Место загрузки', fullname_shipper as 'ФИО грузоотправителя', telephone_shipper as 'Телефон грузоотправителя', name_cargo as 'Наименования груза', transportation_conditions as 'Условия транспортировки', date_unloading as 'Дата разгрузки', place_unloading as 'Место разгрузки', fullname_consignee as 'ФИО грузополучателя', route_town_request as 'Маршрут (города)', route_mileage_request as 'Маршрут (километраж)', transportation_format as 'Формат транспортировки', payment_request as 'Оплата заявки', payment_conditions_request as 'Условия оплаты' from Requests, executors, drivers, vehicles, logisticians where requests.code_executor = executors.code_executor and requests.code_driver = drivers.code_driver and requests.code_vehicle = vehicles.code_vehicle and requests.code_logistician = logisticians.code_logistician", dbhelper.sqlConnection);
|
|
|
dataSet = new DataSet();
|
|
|
dataAdapter.Fill(dataSet);
|
|
|
RequestsDGV.DataSource = dataSet.Tables[0];
|
|
@@ -64,7 +65,7 @@ namespace Transportation
|
|
|
|
|
|
add.FormClosing += (obj, args) =>
|
|
|
{
|
|
|
- dataAdapter = new SqlDataAdapter("select * from Vehicles", dbhelper.sqlConnection);
|
|
|
+ dataAdapter = new SqlDataAdapter("select code_vehicle as 'Код автомобиля', (executors.surname_executor + ' ' + executors.name_executor + ' ' + executors.midname_executor) as 'ФИО исполнителя', brand_vehicle as 'Марка автомобиля', model_vehicle as 'Модель автомобиля', number_vehicle as 'Гос. номер автомобиля', name_category as 'Категория прицепа', volume_body as 'Тоннаж', length_body as 'Длина автомобиля', width_body as 'Ширина автомобиля', height_body as 'Высота автомобиля' from vehicles, executors, category_trailer where vehicles.code_executor = executors.code_executor and vehicles.code_category = category_trailer.code_category", dbhelper.sqlConnection);
|
|
|
dataSet = new DataSet();
|
|
|
dataAdapter.Fill(dataSet);
|
|
|
VehiclesDGV.DataSource = dataSet.Tables[0];
|
|
@@ -79,7 +80,7 @@ namespace Transportation
|
|
|
|
|
|
update.FormClosing += (obj, args) =>
|
|
|
{
|
|
|
- dataAdapter = new SqlDataAdapter("select * from Vehicles", dbhelper.sqlConnection);
|
|
|
+ dataAdapter = new SqlDataAdapter("select code_vehicle as 'Код автомобиля', (executors.surname_executor + ' ' + executors.name_executor + ' ' + executors.midname_executor) as 'ФИО исполнителя', brand_vehicle as 'Марка автомобиля', model_vehicle as 'Модель автомобиля', number_vehicle as 'Гос. номер автомобиля', name_category as 'Категория прицепа', volume_body as 'Тоннаж', length_body as 'Длина автомобиля', width_body as 'Ширина автомобиля', height_body as 'Высота автомобиля' from vehicles, executors, category_trailer where vehicles.code_executor = executors.code_executor and vehicles.code_category = category_trailer.code_category", dbhelper.sqlConnection);
|
|
|
dataSet = new DataSet();
|
|
|
dataAdapter.Fill(dataSet);
|
|
|
VehiclesDGV.DataSource = dataSet.Tables[0];
|
|
@@ -95,7 +96,7 @@ namespace Transportation
|
|
|
query = new SqlCommand($"delete from vehicles where code_vehicle like '{vehicleIndex}'", dbhelper.sqlConnection);
|
|
|
query.ExecuteNonQuery();
|
|
|
|
|
|
- dataAdapter = new SqlDataAdapter("select * from Vehicles", dbhelper.sqlConnection);
|
|
|
+ dataAdapter = new SqlDataAdapter("select code_vehicle as 'Код автомобиля', (executors.surname_executor + ' ' + executors.name_executor + ' ' + executors.midname_executor) as 'ФИО исполнителя', brand_vehicle as 'Марка автомобиля', model_vehicle as 'Модель автомобиля', number_vehicle as 'Гос. номер автомобиля', name_category as 'Категория прицепа', volume_body as 'Тоннаж', length_body as 'Длина автомобиля', width_body as 'Ширина автомобиля', height_body as 'Высота автомобиля' from vehicles, executors, category_trailer where vehicles.code_executor = executors.code_executor and vehicles.code_category = category_trailer.code_category", dbhelper.sqlConnection);
|
|
|
dataSet = new DataSet();
|
|
|
dataAdapter.Fill(dataSet);
|
|
|
VehiclesDGV.DataSource = dataSet.Tables[0];
|
|
@@ -110,7 +111,7 @@ namespace Transportation
|
|
|
|
|
|
add.FormClosing += (obj, args) =>
|
|
|
{
|
|
|
- dataAdapter = new SqlDataAdapter("select * from Drivers", dbhelper.sqlConnection);
|
|
|
+ dataAdapter = new SqlDataAdapter("select code_driver as 'Код водителя', (executors.surname_executor + ' ' + executors.name_executor + ' ' + executors.midname_executor) as 'ФИО исполнителя', surname_driver as 'Фамилия водителя', name_driver as 'Имя водителя', midname_driver as 'Отчество водителя', number_passport_driver as 'Серия-номер паспорта', place_passport_driver as 'Место выдачи паспорта', date_passport_driver as 'Дата выдачи паспорта', code_passport_driver as 'Код подразделения', number_driverlicense as 'Серия-номер вод. удостоверения', telephone_driver as 'Телефон водителя' from executors, drivers where drivers.code_executor = executors.code_executor", dbhelper.sqlConnection);
|
|
|
dataSet = new DataSet();
|
|
|
dataAdapter.Fill(dataSet);
|
|
|
DriversDGV.DataSource = dataSet.Tables[0];
|
|
@@ -125,7 +126,7 @@ namespace Transportation
|
|
|
|
|
|
update.FormClosing += (obj, args) =>
|
|
|
{
|
|
|
- dataAdapter = new SqlDataAdapter("select * from Drivers", dbhelper.sqlConnection);
|
|
|
+ dataAdapter = new SqlDataAdapter("select code_driver as 'Код водителя', (executors.surname_executor + ' ' + executors.name_executor + ' ' + executors.midname_executor) as 'ФИО исполнителя', surname_driver as 'Фамилия водителя', name_driver as 'Имя водителя', midname_driver as 'Отчество водителя', number_passport_driver as 'Серия-номер паспорта', place_passport_driver as 'Место выдачи паспорта', date_passport_driver as 'Дата выдачи паспорта', code_passport_driver as 'Код подразделения', number_driverlicense as 'Серия-номер вод. удостоверения', telephone_driver as 'Телефон водителя' from executors, drivers where drivers.code_executor = executors.code_executor", dbhelper.sqlConnection);
|
|
|
dataSet = new DataSet();
|
|
|
dataAdapter.Fill(dataSet);
|
|
|
DriversDGV.DataSource = dataSet.Tables[0];
|
|
@@ -141,7 +142,7 @@ namespace Transportation
|
|
|
query = new SqlCommand($"delete from drivers where code_driver like '{driverIndex}'", dbhelper.sqlConnection);
|
|
|
query.ExecuteNonQuery();
|
|
|
|
|
|
- dataAdapter = new SqlDataAdapter("select * from drivers", dbhelper.sqlConnection);
|
|
|
+ dataAdapter = new SqlDataAdapter("select code_driver as 'Код водителя', (executors.surname_executor + ' ' + executors.name_executor + ' ' + executors.midname_executor) as 'ФИО исполнителя', surname_driver as 'Фамилия водителя', name_driver as 'Имя водителя', midname_driver as 'Отчество водителя', number_passport_driver as 'Серия-номер паспорта', place_passport_driver as 'Место выдачи паспорта', date_passport_driver as 'Дата выдачи паспорта', code_passport_driver as 'Код подразделения', number_driverlicense as 'Серия-номер вод. удостоверения', telephone_driver as 'Телефон водителя' from executors, drivers where drivers.code_executor = executors.code_executor", dbhelper.sqlConnection);
|
|
|
dataSet = new DataSet();
|
|
|
dataAdapter.Fill(dataSet);
|
|
|
DriversDGV.DataSource = dataSet.Tables[0];
|
|
@@ -155,7 +156,7 @@ namespace Transportation
|
|
|
|
|
|
add.FormClosing += (obj, args) =>
|
|
|
{
|
|
|
- dataAdapter = new SqlDataAdapter("select * from Executors", dbhelper.sqlConnection);
|
|
|
+ dataAdapter = new SqlDataAdapter("select code_executor as 'Код исполнителя', surname_executor as 'Фамилия исполнителя', name_executor as 'Имя исполнителя', midname_executor as 'Отчество исполнителя' from Executors", dbhelper.sqlConnection);
|
|
|
dataSet = new DataSet();
|
|
|
dataAdapter.Fill(dataSet);
|
|
|
ExecutorsDGV.DataSource = dataSet.Tables[0];
|
|
@@ -170,7 +171,7 @@ namespace Transportation
|
|
|
|
|
|
update.FormClosing += (obj, args) =>
|
|
|
{
|
|
|
- dataAdapter = new SqlDataAdapter("select * from Executors", dbhelper.sqlConnection);
|
|
|
+ dataAdapter = new SqlDataAdapter("select code_executor as 'Код исполнителя', surname_executor as 'Фамилия исполнителя', name_executor as 'Имя исполнителя', midname_executor as 'Отчество исполнителя' from Executors", dbhelper.sqlConnection);
|
|
|
dataSet = new DataSet();
|
|
|
dataAdapter.Fill(dataSet);
|
|
|
ExecutorsDGV.DataSource = dataSet.Tables[0];
|
|
@@ -186,7 +187,7 @@ namespace Transportation
|
|
|
query = new SqlCommand($"delete from executors where code_executor like '{executorIndex}'", dbhelper.sqlConnection);
|
|
|
query.ExecuteNonQuery();
|
|
|
|
|
|
- dataAdapter = new SqlDataAdapter("select * from executors", dbhelper.sqlConnection);
|
|
|
+ dataAdapter = new SqlDataAdapter("select code_executor as 'Код исполнителя', surname_executor as 'Фамилия исполнителя', name_executor as 'Имя исполнителя', midname_executor as 'Отчество исполнителя' from Executors", dbhelper.sqlConnection);
|
|
|
dataSet = new DataSet();
|
|
|
dataAdapter.Fill(dataSet);
|
|
|
ExecutorsDGV.DataSource = dataSet.Tables[0];
|
|
@@ -200,7 +201,7 @@ namespace Transportation
|
|
|
|
|
|
add.FormClosing += (obj, args) =>
|
|
|
{
|
|
|
- dataAdapter = new SqlDataAdapter("select * from Logisticians", dbhelper.sqlConnection);
|
|
|
+ dataAdapter = new SqlDataAdapter("select code_logistician as 'Код логиста', surname_logistician as 'Фамилия логиста', name_logistician as 'Имя логиста', midname_logistician as 'Отчество логиста', number_passport_logistician as 'Серия-номер паспорта', place_passport_logistician as 'Место выдачи паспорта', date_passport_logistician as 'Дата выдачи паспорта', code_passport_logistician as 'Код подразделения', telephone_logistician as 'Телефон логиста' from Logisticians", dbhelper.sqlConnection);
|
|
|
dataSet = new DataSet();
|
|
|
dataAdapter.Fill(dataSet);
|
|
|
LogisticiansDGV.DataSource = dataSet.Tables[0];
|
|
@@ -215,7 +216,7 @@ namespace Transportation
|
|
|
|
|
|
update.FormClosing += (obj, args) =>
|
|
|
{
|
|
|
- dataAdapter = new SqlDataAdapter("select * from Logisticians", dbhelper.sqlConnection);
|
|
|
+ dataAdapter = new SqlDataAdapter("select code_logistician as 'Код логиста', surname_logistician as 'Фамилия логиста', name_logistician as 'Имя логиста', midname_logistician as 'Отчество логиста', number_passport_logistician as 'Серия-номер паспорта', place_passport_logistician as 'Место выдачи паспорта', date_passport_logistician as 'Дата выдачи паспорта', code_passport_logistician as 'Код подразделения', telephone_logistician as 'Телефон логиста' from Logisticians", dbhelper.sqlConnection);
|
|
|
dataSet = new DataSet();
|
|
|
dataAdapter.Fill(dataSet);
|
|
|
LogisticiansDGV.DataSource = dataSet.Tables[0];
|
|
@@ -231,7 +232,7 @@ namespace Transportation
|
|
|
query = new SqlCommand($"delete from logisticians where code_logistician like '{logisticianIndex}'", dbhelper.sqlConnection);
|
|
|
query.ExecuteNonQuery();
|
|
|
|
|
|
- dataAdapter = new SqlDataAdapter("select * from logisticians", dbhelper.sqlConnection);
|
|
|
+ dataAdapter = new SqlDataAdapter("select code_logistician as 'Код логиста', surname_logistician as 'Фамилия логиста', name_logistician as 'Имя логиста', midname_logistician as 'Отчество логиста', number_passport_logistician as 'Серия-номер паспорта', place_passport_logistician as 'Место выдачи паспорта', date_passport_logistician as 'Дата выдачи паспорта', code_passport_logistician as 'Код подразделения', telephone_logistician as 'Телефон логиста' from Logisticians", dbhelper.sqlConnection);
|
|
|
dataSet = new DataSet();
|
|
|
dataAdapter.Fill(dataSet);
|
|
|
LogisticiansDGV.DataSource = dataSet.Tables[0];
|
|
@@ -253,7 +254,7 @@ namespace Transportation
|
|
|
|
|
|
add.FormClosing += (obj, args) =>
|
|
|
{
|
|
|
- dataAdapter = new SqlDataAdapter("select * from Requests", dbhelper.sqlConnection);
|
|
|
+ dataAdapter = new SqlDataAdapter("select code_request as 'Код заявки', (executors.surname_executor + ' ' + executors.name_executor + ' ' + executors.midname_executor) as 'ФИО исполнителя', (drivers.surname_driver + ' ' + drivers.name_driver + ' ' + drivers.midname_driver) as 'ФИО водителя', (vehicles.brand_vehicle + ' ' + vehicles.model_vehicle + ' ' + vehicles.number_vehicle) as 'Автомобиль', (logisticians.surname_logistician + ' ' + logisticians.name_logistician + ' ' + logisticians.midname_logistician) as 'ФИО логиста', date_loading as 'Дата загрузки', place_loading as 'Место загрузки', fullname_shipper as 'ФИО грузоотправителя', telephone_shipper as 'Телефон грузоотправителя', name_cargo as 'Наименования груза', transportation_conditions as 'Условия транспортировки', date_unloading as 'Дата разгрузки', place_unloading as 'Место разгрузки', fullname_consignee as 'ФИО грузополучателя', route_town_request as 'Маршрут (города)', route_mileage_request as 'Маршрут (километраж)', transportation_format as 'Формат транспортировки', payment_request as 'Оплата заявки', payment_conditions_request as 'Условия оплаты' from Requests, executors, drivers, vehicles, logisticians where requests.code_executor = executors.code_executor and requests.code_driver = drivers.code_driver and requests.code_vehicle = vehicles.code_vehicle and requests.code_logistician = logisticians.code_logistician", dbhelper.sqlConnection);
|
|
|
dataSet = new DataSet();
|
|
|
dataAdapter.Fill(dataSet);
|
|
|
RequestsDGV.DataSource = dataSet.Tables[0];
|
|
@@ -269,7 +270,7 @@ namespace Transportation
|
|
|
|
|
|
update.FormClosing += (obj, args) =>
|
|
|
{
|
|
|
- dataAdapter = new SqlDataAdapter("select * from requests", dbhelper.sqlConnection);
|
|
|
+ dataAdapter = new SqlDataAdapter("select code_request as 'Код заявки', (executors.surname_executor + ' ' + executors.name_executor + ' ' + executors.midname_executor) as 'ФИО исполнителя', (drivers.surname_driver + ' ' + drivers.name_driver + ' ' + drivers.midname_driver) as 'ФИО водителя', (vehicles.brand_vehicle + ' ' + vehicles.model_vehicle + ' ' + vehicles.number_vehicle) as 'Автомобиль', (logisticians.surname_logistician + ' ' + logisticians.name_logistician + ' ' + logisticians.midname_logistician) as 'ФИО логиста', date_loading as 'Дата загрузки', place_loading as 'Место загрузки', fullname_shipper as 'ФИО грузоотправителя', telephone_shipper as 'Телефон грузоотправителя', name_cargo as 'Наименования груза', transportation_conditions as 'Условия транспортировки', date_unloading as 'Дата разгрузки', place_unloading as 'Место разгрузки', fullname_consignee as 'ФИО грузополучателя', route_town_request as 'Маршрут (города)', route_mileage_request as 'Маршрут (километраж)', transportation_format as 'Формат транспортировки', payment_request as 'Оплата заявки', payment_conditions_request as 'Условия оплаты' from Requests, executors, drivers, vehicles, logisticians where requests.code_executor = executors.code_executor and requests.code_driver = drivers.code_driver and requests.code_vehicle = vehicles.code_vehicle and requests.code_logistician = logisticians.code_logistician", dbhelper.sqlConnection);
|
|
|
dataSet = new DataSet();
|
|
|
dataAdapter.Fill(dataSet);
|
|
|
RequestsDGV.DataSource = dataSet.Tables[0];
|
|
@@ -285,14 +286,12 @@ namespace Transportation
|
|
|
query = new SqlCommand($"delete from requests where code_request like '{requestIndex}'", dbhelper.sqlConnection);
|
|
|
query.ExecuteNonQuery();
|
|
|
|
|
|
- dataAdapter = new SqlDataAdapter("select * from requests", dbhelper.sqlConnection);
|
|
|
+ dataAdapter = new SqlDataAdapter("select code_request as 'Код заявки', (executors.surname_executor + ' ' + executors.name_executor + ' ' + executors.midname_executor) as 'ФИО исполнителя', (drivers.surname_driver + ' ' + drivers.name_driver + ' ' + drivers.midname_driver) as 'ФИО водителя', (vehicles.brand_vehicle + ' ' + vehicles.model_vehicle + ' ' + vehicles.number_vehicle) as 'Автомобиль', (logisticians.surname_logistician + ' ' + logisticians.name_logistician + ' ' + logisticians.midname_logistician) as 'ФИО логиста', date_loading as 'Дата загрузки', place_loading as 'Место загрузки', fullname_shipper as 'ФИО грузоотправителя', telephone_shipper as 'Телефон грузоотправителя', name_cargo as 'Наименования груза', transportation_conditions as 'Условия транспортировки', date_unloading as 'Дата разгрузки', place_unloading as 'Место разгрузки', fullname_consignee as 'ФИО грузополучателя', route_town_request as 'Маршрут (города)', route_mileage_request as 'Маршрут (километраж)', transportation_format as 'Формат транспортировки', payment_request as 'Оплата заявки', payment_conditions_request as 'Условия оплаты' from Requests, executors, drivers, vehicles, logisticians where requests.code_executor = executors.code_executor and requests.code_driver = drivers.code_driver and requests.code_vehicle = vehicles.code_vehicle and requests.code_logistician = logisticians.code_logistician", dbhelper.sqlConnection);
|
|
|
dataSet = new DataSet();
|
|
|
dataAdapter.Fill(dataSet);
|
|
|
RequestsDGV.DataSource = dataSet.Tables[0];
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
}
|