public bool Add(OrderInfo model) { if (model != null) { IOrderInfoRepository iRepos = IoCContext.Container.Resolve<IOrderInfoRepository>(); return iRepos.Add(model, false) > 0; } else { return false; } }
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(); } } }
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; }
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; }
/// <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; }
/// <summary> /// Deprecated Method for adding a new object to the OrderInfoes EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToOrderInfoes(OrderInfo orderInfo) { base.AddObject("OrderInfoes", orderInfo); }