コード例 #1
0
 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));
     }
 }
コード例 #2
0
 public void UpdateCustomerUsingSTE(Model.STE.Customer customer)
 {
     using (var ctx = new OrderIT.Model.STE.OrderITEntities()) {
         ctx.Companies.ApplyChanges(customer);
         ctx.SaveChanges();
     }
 }
コード例 #3
0
 public void DeleteOrderUsingSTE(OrderIT.Model.STE.Order order)
 {
     using (var ctx = new OrderIT.Model.STE.OrderITEntities())
     {
         ctx.Orders.ApplyChanges(order);
         ctx.SaveChanges();
     }
 }
コード例 #4
0
 /*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);
     }
 }
コード例 #5
0
 /*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);
     }
 }
コード例 #6
0
 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));
     }
 }