Exemplo n.º 1
0
 private void Create(int customerId)
 {
     using (BypassPropertyChecks)
     {
         Id         = -1;
         CustomerId = customerId;
         OrderDate  = DateTime.Today;
         LastEdit   = DateTime.Today;
     }
     OrderLineItems = DataPortal.CreateChild <OrderLineItems>();
     BusinessRules.CheckRules();
 }
Exemplo n.º 2
0
        private void Fetch(int id, [Inject] DataAccess.IOrderDal dal)
        {
            var data = dal.Fetch(id);

            data.Read();
            using (BypassPropertyChecks)
            {
                Id         = data.GetInt32("Id");
                CustomerId = data.GetInt32("CustomerId");
                OrderDate  = data.GetDateTime("OrderDate");
                LastEdit   = data.GetDateTime("OrderEditDate");
            }
            OrderLineItems = DataPortal.FetchChild <OrderLineItems>(id);
        }
Exemplo n.º 3
0
 private void Delete(int id, [Inject] DataAccess.IOrderDal dal)
 {
     dal.Delete(id);
     // cascading delete removed all data, so recreate child collection
     OrderLineItems = DataPortal.CreateChild <OrderLineItems>();
 }