Exemplo n.º 1
0
 public void MarkResolved(int issueId)
 {
     using (var context = new OrdersIssuesDataClassDataContext(_connectionString))
     {
         context.Issues.FirstOrDefault(i => i.Id == issueId).Resolved = true;
         context.SubmitChanges();
     }
 }
Exemplo n.º 2
0
 public void AddIssue(Issue issue)
 {
     using (var context = new OrdersIssuesDataClassDataContext(_connectionString))
     {
         context.Issues.InsertOnSubmit(issue);
         context.SubmitChanges();
     }
 }
Exemplo n.º 3
0
 public void MarkComplete(int OrderId)
 {
     using (var context = new OrdersIssuesDataClassDataContext(_connectionString))
     {
         context.Orders.FirstOrDefault(o => o.Id == OrderId).Completed = true;
         context.SubmitChanges();
     }
 }
Exemplo n.º 4
0
 public void AddOrder(Order order)
 {
     order.Date = DateTime.Now;
     using (var context = new OrdersIssuesDataClassDataContext(_connectionString))
     {
         context.Orders.InsertOnSubmit(order);
         context.SubmitChanges();
     }
 }
Exemplo n.º 5
0
 public IEnumerable <Issue> GetIssues(int orderId)
 {
     using (var context = new OrdersIssuesDataClassDataContext(_connectionString))
     {
         var loadOptions = new DataLoadOptions();
         loadOptions.LoadWith <Issue>(i => i.Order);
         context.LoadOptions = loadOptions;
         return(context.Issues.Where(i => i.OrderId == orderId).ToList());
     }
 }
Exemplo n.º 6
0
 public Order GetOrder(int orderId)
 {
     using (var context = new OrdersIssuesDataClassDataContext(_connectionString))
     {
         var loadOptions = new DataLoadOptions();
         loadOptions.LoadWith <Order>(o => o.Issues);
         context.LoadOptions = loadOptions;
         return(context.Orders.FirstOrDefault(o => o.Id == orderId));
     }
 }
Exemplo n.º 7
0
 public IEnumerable <Order> GetOrders()
 {
     using (var context = new OrdersIssuesDataClassDataContext(_connectionString))
     {
         var loadOptions = new DataLoadOptions();
         loadOptions.LoadWith <Order>(o => o.Issues);
         context.LoadOptions = loadOptions;
         return(context.Orders.ToList());
     }
 }