本文整理汇总了C#中OrderDetail.LoadByPrimaryKey方法的典型用法代码示例。如果您正苦于以下问题:C# OrderDetail.LoadByPrimaryKey方法的具体用法?C# OrderDetail.LoadByPrimaryKey怎么用?C# OrderDetail.LoadByPrimaryKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OrderDetail
的用法示例。
在下文中一共展示了OrderDetail.LoadByPrimaryKey方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadOptionsForOrderDetail
/// <summary>
/// The code supports manufacturer preference here too but we choose not to prefer manufacturers when looking into the stores.
/// </summary>
/// <param name="userID"></param>
/// <param name="orderDetailID"></param>
/// <param name="pricedUnpricedBoth"></param>
/// <param name="bal"> </param>
/// <param name="markStockoutBit"> </param>
/// <param name="usableStock"> </param>
/// <param name="approved"> </param>
public decimal LoadOptionsForOrderDetail(int userID, int orderDetailID, PriceSettings pricedUnpricedBoth, Balance bal, bool markStockoutBit, out decimal usableStock, out decimal approved)
{
decimal avQuantity = 0;
BLL.OrderDetail orderDetail = new OrderDetail();
orderDetail.LoadByPrimaryKey(orderDetailID);
BLL.Order order = new Order();
order.LoadByPrimaryKey(orderDetail.OrderID);
Institution ru = new Institution();
ru.LoadByPrimaryKey(order.RequestedBy);
int month = EthiopianDate.EthiopianDate.Now.Month;
int year = EthiopianDate.EthiopianDate.Now.Year;
decimal availableQty = 0;
usableStock = 0;
approved = 0;
int? manufacturerPrefrence = null, unitID = null;
if (!orderDetail.IsColumnNull("PreferredManufacturerID"))
{
manufacturerPrefrence = orderDetail.PreferredManufacturerID;
}
DateTime? expPreferrence = null;
if(!orderDetail.IsColumnNull("PreferredExpiryDate"))
{
expPreferrence = orderDetail.PreferredExpiryDate;
}
int? preferredPhysicalStoreID = null;
if (!orderDetail.IsColumnNull("PreferredPhysicalStoreID"))
{
preferredPhysicalStoreID = orderDetail.PreferredPhysicalStoreID;
}
//--------------------------------------------------------------------------
//manufacturerPrefrence = null; //We are overriding the manufacturer preference.
//expPreferrence = null;
//--------------------------------------------------------------------------
if (!orderDetail.IsColumnNull("UnitID"))
{
unitID = orderDetail.UnitID;
}
BLL.UserActivity userStore = new UserActivity();
// Definitely a danger zone
userStore.LoadByUserIDAndStoreType(userID, order.FromStore, orderDetail.ItemID, unitID.Value);
while (!userStore.EOF)
{
var activity = new Activity();
activity.LoadByPrimaryKey(userStore.ActivityID);
if(order.FromStore == Mode.Constants.RDF && !BLL.Settings.IsCenter && !BLL.Settings.PrivateCanGetFromMDGAndPBS && ru.Ownership == OwnershipType.Constants.Private && activity.IsSubsidized ){
userStore.MoveNext();
continue;
}
// Load the Activity Selection that has PRiced Commodities.
Balance balance = new Balance();
if (pricedUnpricedBoth == PriceSettings.PRICED_ONLY || pricedUnpricedBoth == PriceSettings.BOTH)
{
BLL.Order.MakeStockCalculations(userID, month, year, PriceSettings.PRICED_ONLY, orderDetail,
userStore.ActivityID, orderDetail.ItemID, order, balance, unitID,
manufacturerPrefrence, expPreferrence, preferredPhysicalStoreID, out usableStock, out approved,
out availableQty, markStockoutBit);
avQuantity += availableQty;
if (availableQty > 0)
{
this.AddNew();
this.ID = userStore.ActivityID;
this.Name = string.Format("{0} ({1})", activity.FullActivityName, availableQty.ToString("#,##0"));
PrepareColumnsForApproval();
this.SetColumn("AvailableSKU", availableQty);
this.SetColumn("IsDeliveryNote", false);
this.SetColumn("TextID",string.Format("N{0}",this.ID));
}
}
// Load Activity Selections for Delivery Note Items.
if (pricedUnpricedBoth == PriceSettings.DELIVERY_NOTE_ONLY || pricedUnpricedBoth == PriceSettings.BOTH)
{
BLL.Order.MakeStockCalculations(userID, month, year, PriceSettings.DELIVERY_NOTE_ONLY, orderDetail,
userStore.ActivityID, orderDetail.ItemID, order, balance, unitID,
manufacturerPrefrence, expPreferrence, preferredPhysicalStoreID, out usableStock, out approved,
out availableQty, markStockoutBit);
//.........这里部分代码省略.........