本文整理汇总了C#中OrderDetail.AddColumn方法的典型用法代码示例。如果您正苦于以下问题:C# OrderDetail.AddColumn方法的具体用法?C# OrderDetail.AddColumn怎么用?C# OrderDetail.AddColumn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OrderDetail
的用法示例。
在下文中一共展示了OrderDetail.AddColumn方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrepareOrderDetailTable
/// <summary>
/// Prepares the order detail table.
/// </summary>
/// <param name="ordDetail">The ord detail.</param>
public static void PrepareOrderDetailTable(OrderDetail ordDetail)
{
ordDetail.AddColumn("AvailableQuantity", typeof(decimal));
ordDetail.AddColumn("PricedQuantity", typeof(decimal));
ordDetail.AddColumn("UsableStock", typeof(decimal));
ordDetail.AddColumn("PApprovedStock", typeof(decimal));
ordDetail.AddColumn("RequestedSKU", typeof(decimal));
ordDetail.AddColumn("SKUBU", typeof(int));
ordDetail.AddColumn("AvailableSKU", typeof(decimal));
ordDetail.AddColumn("ApprovedSKU", typeof(decimal));
ordDetail.AddColumn("Consumption", typeof(decimal));
ordDetail.AddColumn("FacilityName", typeof(string));
ordDetail.AddColumn("Region", typeof(string));
ordDetail.AddColumn("Zone", typeof(string));
ordDetail.AddColumn("Woreda", typeof(string));
ordDetail.AddColumn("Warning", typeof(string));
ordDetail.AddColumn("AvailableStores", typeof(object));
ordDetail.AddColumn("HasStores", typeof(string));
ordDetail.AddColumn("AvailableManufacturer", typeof(object));
ordDetail.AddColumn("AvailableExpiry", typeof(object));
ordDetail.AddColumn("HasExpiryChoice", typeof(string));
ordDetail.AddColumn("HasManufacturers", typeof(string));
ordDetail.AddColumn("AvailablePhysicalStore", typeof(object));
ordDetail.AddColumn("HasPhysicalStoreChoice", typeof(string));
ordDetail.AddColumn("ExpiryDateString", typeof(string));
ordDetail.AddColumn("TextID", typeof(string));
ordDetail.AddColumn("GIT", typeof (decimal));
ordDetail.AddColumn("CRequested", typeof (decimal));
ordDetail.AddColumn("CApproved", typeof(decimal));
ordDetail.AddColumn("DOS", typeof(int));
ordDetail.AddColumn("TotalIssued", typeof(decimal));
ordDetail.AddColumn("FiscalYearDays", typeof(int));
ordDetail.AddColumn("AMC", typeof(decimal));
ordDetail.AddColumn("MOS", typeof(decimal));
ordDetail.AddColumn("TotalRequested", typeof (decimal));
try
{
ordDetail.AddColumn("Unit", typeof(string));
ordDetail.AddColumn("FullItemName", typeof(string));
ordDetail.AddColumn("StockCode", typeof(string));
ordDetail.AddColumn("CategoryType", typeof(string));
}
catch
{
}
}
示例2: 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;
}