готова второй раз

This commit is contained in:
ikswi 2024-12-10 02:48:52 +04:00
parent 777ad9a658
commit e574952343
2 changed files with 4 additions and 7 deletions

View File

@ -10,14 +10,12 @@ public class TripTicket
{ {
public int Id { get; private set; } public int Id { get; private set; }
public int TicketId { get; private set; } public int TicketId { get; private set; }
public int Count { get; private set; } public static TripTicket CreateElement(int id, int ticketId)
public static TripTicket CreateElement(int id, int ticketId, int count)
{ {
return new TripTicket return new TripTicket
{ {
Id = id, Id = id,
TicketId = ticketId, TicketId = ticketId
Count = count
}; };
} }
} }

View File

@ -50,12 +50,11 @@ namespace ProjectPassengerTransfers.Forms
var list = new List<TripTicket>(); var list = new List<TripTicket>();
foreach (DataGridViewRow row in dataGridViewTickets.Rows) foreach (DataGridViewRow row in dataGridViewTickets.Rows)
{ {
if (row.Cells["ColumnFeed"].Value == null || if (row.Cells["ColumnFeed"].Value == null)
row.Cells["ColumnCount"].Value == null)
{ {
continue; continue;
} }
list.Add(TripTicket.CreateElement(0, Convert.ToInt32(row.Cells["ColumnBus"].Value), Convert.ToInt32(row.Cells["ColumnCount"].Value))); list.Add(TripTicket.CreateElement(0, Convert.ToInt32(row.Cells["ColumnBus"].Value)));
} }
return list; return list;
} }