Пример #1
0
 public Student AddStudent(Student student)
 {
     try
     {
         student_PayDb.Students.Add(student);
         student_PayDb.SaveChanges();
         return(student);
     }
     catch (Exception)
     {
         return(null);
     }
 }
Пример #2
0
 public Payment AddPayment(Payment payment)
 {
     try
     {
         payment._Student = payDb.Students.FirstOrDefault(x => x.Id == payment._Student.Id);
         payDb.Add(payment);
         payDb.SaveChanges();
         return(payDb.Payments.FirstOrDefault(x => x.Pay_ID == payment.Pay_ID));
     }
     catch (Exception)
     {
         return(null);
     }
 }