comparison Demo/Asp.Net/BusinessLogic/DataAccess/OrderAccessor.cs @ 0:f990fcb411a9

Копия текущей версии из github
author cin
date Thu, 27 Mar 2014 21:46:09 +0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f990fcb411a9
1 using System;
2 using System.Collections.Generic;
3
4 using BLToolkit.Data;
5 using BLToolkit.DataAccess;
6
7 namespace PetShop.BusinessLogic.DataAccess
8 {
9 using ObjectModel;
10
11 public abstract class OrderAccessor : AccessorBase<OrderAccessor.DB, OrderAccessor>
12 {
13 public class DB : DbManager { public DB() : base("OrderDB") {} }
14
15 [SqlQuery(@"INSERT INTO OrderStatus (OrderId, LineNum, Timestamp, Status) VALUES (@id, @id, GetDate(), 'P')")]
16 public abstract void InsertStatus(DbManager db, int @id);
17
18 [SqlQuery(@"
19 SELECT
20 o.*,
21 os.Status
22 FROM
23 Orders o
24 JOIN OrderStatus os ON os.OrderId = o.OrderId
25 ORDER BY
26 o.OrderId DESC")]
27 public abstract List<Order> GetAllOrderList();
28 }
29 }