SortingVehicle.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using System.Data.SqlClient;
  11. namespace Transportation
  12. {
  13. public partial class SortingVehicle : Form
  14. {
  15. SqlCommand query = null;
  16. SqlDataAdapter dataAdapter = null;
  17. DataSet dataSet = null;
  18. public SortingVehicle()
  19. {
  20. InitializeComponent();
  21. }
  22. private void VehiclesSortingDGV_CellContentClick(object sender, DataGridViewCellEventArgs e)
  23. {
  24. }
  25. private void SortingVehicle_Load(object sender, EventArgs e)
  26. {
  27. 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 and volume_body like {MainMenu.sort}", dbhelper.sqlConnection);
  28. dataSet = new DataSet();
  29. dataAdapter.Fill(dataSet);
  30. VehiclesSortingDGV.DataSource = dataSet.Tables[0];
  31. }
  32. }
  33. }