Update DataForm.cs

This commit is contained in:
redtea committed 2024-05-24 00:22:56 +03:00
1 parent 75fa716046
commit 327041c3ab
1 file changed
+5
+5
View File
@@ -58,6 +58,8 @@ namespace PaymentLogs
foreach (DataGridViewRow row in dataGridView1.Rows) foreach (DataGridViewRow row in dataGridView1.Rows)
{ {
try try
{
if(row.Cells.Count > 1)
{ {
Payment payment = new Payment Payment payment = new Payment
{ {
@@ -69,6 +71,9 @@ namespace PaymentLogs
Debt = Convert.ToInt32(row.Cells["debt"].Value) Debt = Convert.ToInt32(row.Cells["debt"].Value)
}; };
Program.PaymentRepository.Update(payment.Id, payment); Program.PaymentRepository.Update(payment.Id, payment);
}
} catch(NullReferenceException ignored) } catch(NullReferenceException ignored)
{ {
Console.WriteLine(ignored.Message); Console.WriteLine(ignored.Message);