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