예제 #1
0
 //Deletes specified Debtor
 public static void Delete(Debtors debtor)
 {
     using (var context = new bankEntities())
     {
         var result = context.Debtors.Where(x => x.IBAN == debtor.IBAN && x.name == debtor.name).First();
         context.Debtors.Remove(result);
         context.SaveChanges();
     }
 }
예제 #2
0
 //Changes the data of specified Debtor
 public static void Update(Debtors debtor)
 {
     using (var context = new bankEntities())
     {
         var result = context.Debtors.Where(x => x.IBAN == debtor.IBAN && x.name == debtor.name).First();
         result.debt     = debtor.debt;
         result.endDate  = debtor.endDate;
         result.interest = debtor.interest;
         context.SaveChanges();
     }
 }