Beispiel #1
0
 public bool Add(OrderInfo model)
 {
     if (model != null)
     {
         IOrderInfoRepository iRepos = IoCContext.Container.Resolve<IOrderInfoRepository>();
         return iRepos.Add(model, false) > 0;
     }
     else
     {
         return false;
     }
 }
Beispiel #2
0
        private void FixupOrderInfo(OrderInfo previousValue, bool skipKeys = false)
        {
            if (IsDeserializing)
            {
                return;
            }

            if (previousValue != null && previousValue.OrderDetails.Contains(this))
            {
                previousValue.OrderDetails.Remove(this);
            }

            if (OrderInfo != null)
            {
                if (!OrderInfo.OrderDetails.Contains(this))
                {
                    OrderInfo.OrderDetails.Add(this);
                }

                OrderId = OrderInfo.OrderId;
            }
            else if (!skipKeys)
            {
                OrderId = null;
            }

            if (ChangeTracker.ChangeTrackingEnabled)
            {
                if (ChangeTracker.OriginalValues.ContainsKey("OrderInfo")
                    && (ChangeTracker.OriginalValues["OrderInfo"] == OrderInfo))
                {
                    ChangeTracker.OriginalValues.Remove("OrderInfo");
                }
                else
                {
                    ChangeTracker.RecordOriginalValue("OrderInfo", previousValue);
                }
                if (OrderInfo != null && !OrderInfo.ChangeTracker.ChangeTrackingEnabled)
                {
                    OrderInfo.StartTracking();
                }
            }
        }
Beispiel #3
0
 private string GetUnitPrices(OrderInfo item)
 {
     string unitPrices = string.Empty;
     if (item.User != null)
     {
         foreach (var donateRecord in item.DonateRecords)
         {
             if (donateRecord.Goody != null)
             {
                 unitPrices += string.Format("{0:N2}", donateRecord.Goody.Price.Value) + ";";
             }
         }
     }
     return unitPrices;
 }
Beispiel #4
0
 private string GetGoodies(OrderInfo item)
 {
     string goodies = string.Empty;
     if (item.User != null)
     {
         foreach (var donateRecord in item.DonateRecords)
         {
             if (donateRecord.Goody != null)
             {
                 goodies += donateRecord.Goody.Title + ";";
             }
         }
     }
     return goodies;
 }
Beispiel #5
0
 /// <summary>
 /// Create a new OrderInfo object.
 /// </summary>
 /// <param name="orderId">Initial value of the OrderId property.</param>
 public static OrderInfo CreateOrderInfo(global::System.String orderId)
 {
     OrderInfo orderInfo = new OrderInfo();
     orderInfo.OrderId = orderId;
     return orderInfo;
 }
Beispiel #6
0
 /// <summary>
 /// Deprecated Method for adding a new object to the OrderInfoes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToOrderInfoes(OrderInfo orderInfo)
 {
     base.AddObject("OrderInfoes", orderInfo);
 }