public static void editTransaction(Transaction transaction) { BasicCreditDbContext db = new BasicCreditDbContext(); db.Entry(transaction).State = EntityState.Modified; db.SaveChanges(); }
public static void editCustomer(Customer customer) { BasicCreditDbContext db = new BasicCreditDbContext(); db.Entry(customer).State = EntityState.Modified; db.SaveChanges(); }
public static void createTransaction(Transaction transaction) { BasicCreditDbContext db = new BasicCreditDbContext(); db.Entry(transaction).State = EntityState.Added; db.Transactions.Add(transaction); db.SaveChanges(); }
public static void deleteTransaction(Transaction transaction) { BasicCreditDbContext db = new BasicCreditDbContext(); db.Entry(transaction).State = EntityState.Deleted; db.Transactions.Remove(transaction); db.SaveChanges(); }
public static void createCustomer(Customer customer) { BasicCreditDbContext db = new BasicCreditDbContext(); db.Entry(customer).State = EntityState.Added; db.Customers.Add(customer); db.SaveChanges(); }
public static void deleteCustomer(Customer customer) { BasicCreditDbContext db = new BasicCreditDbContext(); db.Entry(customer).State = EntityState.Deleted; db.Customers.Remove(customer); db.SaveChanges(); }
public static CustomerTransaction getCustomerAndTransactions(int?id) { BasicCreditDbContext db = new BasicCreditDbContext(); CustomerTransaction custTransactions = new CustomerTransaction(); custTransactions.customer = getCustomer(id); var transactions = db.Transactions.Where(s => s.CustID == custTransactions.customer.Id); custTransactions.transactions = transactions.ToList(); return(custTransactions); }
public static Transaction getTransaction(int?id) { BasicCreditDbContext db = new BasicCreditDbContext(); return(db.Transactions.Find(id)); }
public static List <Transaction> getTransactions() { BasicCreditDbContext db = new BasicCreditDbContext(); return(db.Transactions.ToList()); }
public static Customer getCustomer(int?id) { BasicCreditDbContext db = new BasicCreditDbContext(); return(db.Customers.Find(id)); }
public static List <Customer> getCustomers() { BasicCreditDbContext db = new BasicCreditDbContext(); return(db.Customers.ToList()); }