ИСЭбд-22. Парамонова И.А. Лабораторная работа №1 #2

Closed
ikswi wants to merge 3 commits from LabWork1 into main
2 changed files with 4 additions and 7 deletions
Showing only changes of commit e574952343 - Show all commits

View File

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

View File

@ -50,12 +50,11 @@ namespace ProjectPassengerTransfers.Forms
var list = new List<TripTicket>();
foreach (DataGridViewRow row in dataGridViewTickets.Rows)
{
if (row.Cells["ColumnFeed"].Value == null ||
row.Cells["ColumnCount"].Value == null)
if (row.Cells["ColumnFeed"].Value == null)
{
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;
}