public Model.STE.Order ReadOrderUsingSTE(int orderId) { using (var ctx = new OrderIT.Model.STE.OrderITEntities()) { return(ctx.Orders.Include("OrderDetails").FirstOrDefault(o => o.OrderId == orderId)); } }
public void UpdateCustomerUsingSTE(Model.STE.Customer customer) { using (var ctx = new OrderIT.Model.STE.OrderITEntities()) { ctx.Companies.ApplyChanges(customer); ctx.SaveChanges(); } }
public void DeleteOrderUsingSTE(OrderIT.Model.STE.Order order) { using (var ctx = new OrderIT.Model.STE.OrderITEntities()) { ctx.Orders.ApplyChanges(order); ctx.SaveChanges(); } }
/*IOrderService Interface*/ public int CreateOrderUsingSTE(Model.STE.Order order) { using (var ctx = new OrderIT.Model.STE.OrderITEntities()) { ctx.Orders.ApplyChanges(order); ctx.SaveChanges(); return(order.OrderId); } }
/*ICustomerSTEService Interface*/ public int CreateCustomerUsingSTE(Model.STE.Customer customer) { using (var ctx = new OrderIT.Model.STE.OrderITEntities()) { ctx.Companies.ApplyChanges(customer); ctx.SaveChanges(); return(customer.CompanyId); } }
public Model.STE.Customer ReadCustomerUsingSTE(int customerId) { using (var ctx = new OrderIT.Model.STE.OrderITEntities()) { return(ctx.Companies.OfType <OrderIT.Model.STE.Customer>().FirstOrDefault(c => c.CompanyId == customerId)); } }