Update DataForm.cs
This commit is contained in:
1 parent
75fa716046
commit
327041c3ab
1 file changed
+14
-9
+14
-9
@@ -59,16 +59,21 @@ namespace PaymentLogs
|
||||
{
|
||||
try
|
||||
{
|
||||
Payment payment = new Payment
|
||||
if(row.Cells.Count > 1)
|
||||
{
|
||||
Id = Convert.ToInt32(row.Cells["id"].Value),
|
||||
FCs = row.Cells["fcs"].ToString(),
|
||||
CourseId = Program.CourseRepository.ByName(row.Cells["course"].Value.ToString()).Id,
|
||||
CoursePrice = Convert.ToInt32(row.Cells["course_price"].Value),
|
||||
Paid = Convert.ToInt32(row.Cells["paid"].Value),
|
||||
Debt = Convert.ToInt32(row.Cells["debt"].Value)
|
||||
};
|
||||
Program.PaymentRepository.Update(payment.Id, payment);
|
||||
Payment payment = new Payment
|
||||
{
|
||||
Id = Convert.ToInt32(row.Cells["id"].Value),
|
||||
FCs = row.Cells["fcs"].ToString(),
|
||||
CourseId = Program.CourseRepository.ByName(row.Cells["course"].Value.ToString()).Id,
|
||||
CoursePrice = Convert.ToInt32(row.Cells["course_price"].Value),
|
||||
Paid = Convert.ToInt32(row.Cells["paid"].Value),
|
||||
Debt = Convert.ToInt32(row.Cells["debt"].Value)
|
||||
};
|
||||
Program.PaymentRepository.Update(payment.Id, payment);
|
||||
}
|
||||
|
||||
|
||||
} catch(NullReferenceException ignored)
|
||||
{
|
||||
Console.WriteLine(ignored.Message);
|
||||
|
||||
Reference in new issue
Block a user