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
+14 -9
+14 -9
View File
@@ -59,16 +59,21 @@ namespace PaymentLogs
{ {
try try
{ {
Payment payment = new Payment if(row.Cells.Count > 1)
{ {
Id = Convert.ToInt32(row.Cells["id"].Value), Payment payment = new Payment
FCs = row.Cells["fcs"].ToString(), {
CourseId = Program.CourseRepository.ByName(row.Cells["course"].Value.ToString()).Id, Id = Convert.ToInt32(row.Cells["id"].Value),
CoursePrice = Convert.ToInt32(row.Cells["course_price"].Value), FCs = row.Cells["fcs"].ToString(),
Paid = Convert.ToInt32(row.Cells["paid"].Value), CourseId = Program.CourseRepository.ByName(row.Cells["course"].Value.ToString()).Id,
Debt = Convert.ToInt32(row.Cells["debt"].Value) CoursePrice = Convert.ToInt32(row.Cells["course_price"].Value),
}; Paid = Convert.ToInt32(row.Cells["paid"].Value),
Program.PaymentRepository.Update(payment.Id, payment); Debt = Convert.ToInt32(row.Cells["debt"].Value)
};
Program.PaymentRepository.Update(payment.Id, payment);
}
} catch(NullReferenceException ignored) } catch(NullReferenceException ignored)
{ {
Console.WriteLine(ignored.Message); Console.WriteLine(ignored.Message);