private void ViewBuses(object sender, EventArgs e) { var command = "SELECT " + "[Id], " + "[Number] as [№ автобуса], " + "[Model] as [Модель автобуса], " + "[Numberplate] as [Номерной знак], " + "[Size] as [Кол-во посадочных мест] " + "FROM " + "[Bus] "; SqlHelper.FillGrid(this.ViewData, "[Bus]", gridTableId: 0, sqlCommand: command); this.ViewData.Columns[0].Visible = false; this.activeTable = ActiveTable.Bus; }
private void ViewDispatchers(object sender, EventArgs e) { var command = "SELECT " + "[Id], " + "[Name] as [Диспетчер], " + "[BirthDate] as [Дата рождения], " + "[Passport] as [Пасспорт], " + "[Address] as [Адрес] " + "FROM " + "[Dispatcher] "; SqlHelper.FillGrid(this.ViewData, "[Dispatcher]", gridTableId: 0, sqlCommand: command); this.ViewData.Columns["Дата рождения"].DefaultCellStyle.Format = "yyyy-MM-dd"; this.ViewData.Columns[0].Visible = false; this.activeTable = ActiveTable.Dispatcher; }
private void ViewTickets(object sender, EventArgs e) { var command = "SELECT " + "[Id], " + "[Place] as [Место пассажира], " + "[Price] as [Цена билета], " + "[BuyDate] as [Дата покупки], " + "[Passenger] as [Пассажир], " + "[Passport] as [Пасспорт], " + "[Discount] as [Льготы?] " + "FROM " + "[Ticket] "; SqlHelper.FillGrid(this.ViewData, "[Ticket]", gridTableId: 0, sqlCommand: command); this.ViewData.Columns[0].Visible = false; this.ViewData.Columns["Дата покупки"].DefaultCellStyle.Format = "yyyy-MM-dd HH:mm:ss"; this.activeTable = ActiveTable.Ticket; }
private void ViewRoutes(object sender, EventArgs e) { var command = "SELECT " + "[Id], " + "[Number] as [№ маршрута], " + "[Departure] as [Место отправления], " + "[Destination] as [Место прибытия], " + "[Distance] as [Расстояние (км)], " + "[BeginDate] as [Время отправления], " + "[EndDate] as [Время прибытия] " + "FROM " + "[Route] "; SqlHelper.FillGrid(this.ViewData, "[Route]", gridTableId: 0, sqlCommand: command); this.ViewData.Columns[0].Visible = false; this.ViewData.Columns["Время отправления"].DefaultCellStyle.Format = "HH:mm:ss"; this.ViewData.Columns["Время прибытия"].DefaultCellStyle.Format = "HH:mm:ss"; this.activeTable = ActiveTable.Route; }