Exemplo n.º 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();
     }
 }
Exemplo n.º 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();
     }
 }