本文整理汇总了C#中OrderDetail.IsColumnNull方法的典型用法代码示例。如果您正苦于以下问题:C# OrderDetail.IsColumnNull方法的具体用法?C# OrderDetail.IsColumnNull怎么用?C# OrderDetail.IsColumnNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OrderDetail
的用法示例。
在下文中一共展示了OrderDetail.IsColumnNull方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPalletLocationChoice
/// <summary>
/// Generate the pick list
/// </summary>
/// <param name="orderId">The order id.</param>
/// <param name="bgWorker">The bg worker.</param>
/// <returns></returns>
public DataView GetPalletLocationChoice(int userID, int orderId, BackgroundWorker bgWorker)
{
var order = new Order();
// Load the order
order.LoadByPrimaryKey(orderId);
//TODO: check if the order is already approved or not.
// if not please return from here
// Load the order details
var orderDetail = new OrderDetail();
orderDetail.LoadAllByOrderID(orderId);
orderDetail.AddColumn("ActivityConcat", typeof(string));
// prepare the pick list data table with the proper fields
_pickList = GetPickListTable();
_replenishmentList = new DataTable();
_replenishmentList.Columns.Add("ItemID", typeof(int));
_replenishmentList.Columns.Add("StoreID", typeof(int));
int count = 0;
// iterate through the order detail and make the pick list
while (!orderDetail.EOF)
{
DateTime startTime = DateTime.Now;
System.Console.WriteLine("Processing - " + orderDetail.ItemID);
// check if there are enough priced items of the same or more quantity in the store
int? unitID = null;
if (!orderDetail.IsColumnNull("UnitID"))
{
unitID = orderDetail.UnitID;
}
if (!orderDetail.IsColumnNull("StockedOut") && (!orderDetail.StockedOut ||(orderDetail.ApprovedQuantity > 0 && orderDetail.Quantity > orderDetail.ApprovedQuantity)))
{
DateTime? preferredExpiry = new DateTime();
if (orderDetail.IsColumnNull("PreferredManufacturerID"))
orderDetail.PreferredManufacturerID = -1;
if (orderDetail.IsColumnNull("PreferredPhysicalStoreID"))
orderDetail.PreferredPhysicalStoreID = -1;
if (orderDetail.IsColumnNull("PreferredExpiryDate"))
preferredExpiry = null;
else
{
preferredExpiry = orderDetail.PreferredExpiryDate;
}
if (!orderDetail.IsColumnNull("ApprovedQuantity") && (orderDetail.ApprovedQuantity > 0 && !orderDetail.IsColumnNull("StoreID")))
{
AddToPickListFor(userID, orderDetail.ID, orderDetail.ItemID, unitID, orderDetail.ApprovedQuantity, orderDetail.StoreID,
orderDetail.PreferredManufacturerID, orderDetail.PreferredPhysicalStoreID,
!orderDetail.IsColumnNull("DeliveryNote") && orderDetail.DeliveryNote,
preferredExpiry);
}
}
System.Console.WriteLine(string.Format("Took - {0}:{1} for Item ID = {2}", DateTime.Now.Subtract(startTime).Minutes, DateTime.Now.Subtract(startTime).Seconds, orderDetail.ItemID));
orderDetail.MoveNext();
count++;
bgWorker.ReportProgress(count, null);
}
// A quick hack just to show the pallet location on the order form
var pl = new PalletLocation();
var im = new ItemManufacturer();
foreach (DataRowView drv in _pickList.DefaultView)
{
int plid = Convert.ToInt32(drv["PalletLocationID"]);
pl.LoadByPrimaryKey(plid);
drv["PalletLocation"] = pl.FullName;
im.LoadIMbyLevel(Convert.ToInt32(drv["ItemID"]), Convert.ToInt32(drv["ManufacturerID"]),
Convert.ToInt32(drv["BoxLevel"]));
drv["QtyInSKU"] = im.RowCount > 0
? Convert.ToDecimal(drv["Pack"]) * im.QuantityInSku
: Convert.ToDecimal(drv["Pack"]);
drv["BoxSizeDisplay"] = im.RowCount > 0 ? im.LevelView2 : ""; //im.RightName;
drv["WarehouseName"] = pl.WarehouseName;
drv["PhysicalStoreName"] = pl.PhysicalStoreName;
var activity = new Activity();
activity.LoadByPrimaryKey(Convert.ToInt32(drv["StoreID"]));
drv["ActivityConcat"] = activity.FullActivityName;
drv["AccountName"] = activity.AccountName;
}
//foreach (DataRowView v in _pickList.DefaultView)
//{
//}
return _pickList.DefaultView;
}
示例2: ComputeStockCalculationsForAnOrderDetail
/// <summary>
/// Computes the stock calculations for an order detail.
/// </summary>
/// <param name="currentMonth">The current month.</param>
/// <param name="currentYear">The current year.</param>
/// <param name="userID">The user ID.</param>
/// <param name="orderDetail">The order detail.</param>
/// <returns></returns>
public DataRow ComputeStockCalculationsForAnOrderDetail(int currentMonth, int currentYear, int userID, OrderDetail orderDetail)
{
if (!IsOrderDetailTableReady(orderDetail))
{
PrepareOrderDetailTable(orderDetail);
}
int? preferredManufacturer;
int? preferredPhysicalStoreID;
decimal usableStock;
decimal approved;
decimal availableQuantity;
Balance bal = new Balance();
ItemManufacturer imf = new ItemManufacturer();
int? unitid = null;
PriceSettings priceSettings = BLL.Settings.HandleDeliveryNotes ? PriceSettings.BOTH : PriceSettings.PRICED_ONLY;
BLL.Order parentOrder = new Order();
parentOrder.LoadByPrimaryKey(orderDetail.OrderID);
unitid = orderDetail.UnitID;
preferredManufacturer = orderDetail.IsColumnNull("PreferredManufacturerID") ? null : new int?(orderDetail.PreferredManufacturerID);
preferredPhysicalStoreID = orderDetail.IsColumnNull("PreferredPhysicalStoreID") ? null : new int?(orderDetail.PreferredPhysicalStoreID);
if (orderDetail.IsColumnNull("StoreID"))
{
orderDetail.StoreID = BLL.Activity.GetActivityUsingFEFO(this.FromStore, orderDetail.ItemID, orderDetail.UnitID);
orderDetail.Save();
}
Activity storeObject = new Activity();
availableQuantity = storeObject.LoadOptionsForOrderDetail(userID, orderDetail.ID, priceSettings, bal, false, out usableStock, out approved);
orderDetail.SetColumn("AvailableStores", storeObject.DefaultView);
if (storeObject.RowCount == 1)
{
orderDetail.StoreID = storeObject.ID;
// Avoid error if the column IsDeliveryNote doesn't exsit at all.
orderDetail.DeliveryNote = storeObject.DefaultView.Table.Columns.IndexOf("IsDeliveryNote") >= 0 &&
!storeObject.IsColumnNull("IsDeliveryNote") &&
Convert.ToBoolean(storeObject.GetColumn("IsDeliveryNote"));
availableQuantity = Convert.ToDecimal(storeObject.GetColumn("AvailableSKU"));
}
else if (storeObject.RowCount > 1)
{
//TOCLEAN: Lord have mercy.
//
// check if the default activity is selected
// if it has been selected, then do a good job and select it.
storeObject.Rewind();
while (
!storeObject.EOF
&&
(
(
storeObject.ID == orderDetail.StoreID
&& !orderDetail.IsColumnNull("DeliveryNote")
&& orderDetail.DeliveryNote
&& !Convert.ToBoolean(storeObject.GetColumn("IsDeliveryNote"))
)
||
storeObject.ID != orderDetail.StoreID
)
)
{
storeObject.MoveNext();
}
// the selected store is found, don't worry.
if (!storeObject.EOF)
{
availableQuantity = Convert.ToDecimal(storeObject.GetColumn("AvailableSKU"));
}
else
{
// the selected store is not found, please do select the first store.
storeObject.Rewind();
orderDetail.StoreID = storeObject.ID;
orderDetail.DeliveryNote = (storeObject.DefaultView.Table.Columns.IndexOf("IsDeliveryNote") >= 0 &&
!storeObject.IsColumnNull("IsDeliveryNote") &&
Convert.ToBoolean(storeObject.GetColumn("IsDeliveryNote")));
availableQuantity = Convert.ToDecimal(storeObject.GetColumn("AvailableSKU"));
}
}
orderDetail.SetColumn("HasStores", (storeObject.RowCount > 1) ? "*" : "");
// Precaution ... to hide -ve available quantity.
if (availableQuantity < 0)
{
availableQuantity = 0;
//.........这里部分代码省略.........
示例3: 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);
//.........这里部分代码省略.........