本文整理汇总了C#中Inventory.IsColumnNull方法的典型用法代码示例。如果您正苦于以下问题:C# Inventory.IsColumnNull方法的具体用法?C# Inventory.IsColumnNull怎么用?C# Inventory.IsColumnNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Inventory
的用法示例。
在下文中一共展示了Inventory.IsColumnNull方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateReceiveEntriesForInventory
/// <summary>
///
/// </summary>
/// <param name="inventory"></param>
/// <param name="palletLocation">Please note that the pallet location passed here is going to be used for the sound qty. A quarantine location in the physical store that the pallet location exists is chosen for the damaged location. For now, we're using the same pallet location for the expired quantity as well. (Only if the location type is free)</param>
/// <param name="confirmationStatusID"></param>
/// <param name="receipt"></param>
/// <param name="user"></param>
/// <param name="convertedEthDate"></param>
/// <param name="remark"></param>
internal void CreateReceiveEntriesForInventory(Inventory inventory, PalletLocation palletLocation, int confirmationStatusID, Receipt receipt, User user, DateTime convertedEthDate, string remark)
{
//Now Save the receive doc entry
decimal soundQty = inventory.IsColumnNull("InventorySoundQuantity") ? 0 : inventory.InventorySoundQuantity;
decimal damagedQty = inventory.IsColumnNull("InventoryDamagedQuantity") ? 0 : inventory.InventoryDamagedQuantity;
decimal expQty = inventory.IsColumnNull("InventoryExpiredQuantity") ? 0 : inventory.InventoryExpiredQuantity;
//As per the design of the Inventory object, expired and sound cannot be passed using a single object: Why? There's a data memeber for Expiry Date which can only hold one value.
decimal soundOrExpiredQty = soundQty + expQty;
decimal totalFoundQty = soundOrExpiredQty + damagedQty;
ReceiveDoc newReceiveDoc = CreateReceiveDocForInventory(inventory, confirmationStatusID, totalFoundQty,
receipt.ID, convertedEthDate, user, remark);
ReceivePallet newReceivePallet = new ReceivePallet();
BLL.ItemUnit iu = new ItemUnit();
iu.LoadByPrimaryKey(inventory.UnitID);
if (soundOrExpiredQty > 0)
{
newReceivePallet.AddNew();
newReceivePallet.ReceiveID = newReceiveDoc.ID;
newReceivePallet.ReceivedQuantity = newReceivePallet.Balance = soundOrExpiredQty*iu.QtyPerUnit;
newReceivePallet.ReservedStock = 0;
newReceivePallet.PalletID = palletLocation.PalletID;
newReceivePallet.PalletLocationID = palletLocation.ID;
}
if(damagedQty>0)
{
newReceivePallet.AddNew();
newReceivePallet.ReceiveID = newReceiveDoc.ID;
newReceivePallet.ReceivedQuantity = newReceivePallet.Balance = damagedQty*iu.QtyPerUnit;
newReceivePallet.ReservedStock = 0;
if(palletLocation.StorageTypeID==Convert.ToInt32(BLL.StorageType.Quaranteen)) //Was the original pallet stored in a quarantine location?
{
newReceivePallet.PalletID = palletLocation.PalletID;
newReceivePallet.PalletLocationID = palletLocation.ID;
}
else //The original pallet was not marked as a quarantine or suspension location. Meaning we need to choose a quarantine location in the same physical store as the original pallet location.
{
BLL.PalletLocation plQuarantine = new PalletLocation();
plQuarantine.LoadFirstOrDefault(palletLocation.PhysicalStoreID,
Convert.ToInt32((StorageType.Quaranteen)));
if(plQuarantine.RowCount>0) //There is already quarantine location.
{
//Pick the first quarantine location.
if(plQuarantine.IsColumnNull("PalletID"))
{
//TODO: Create a Pallet.
}
newReceivePallet.PalletID = plQuarantine.PalletID;
newReceivePallet.PalletLocationID = plQuarantine.ID;
}
else
{
//There is no quarantine locaiton in the physical store: This is basically bad news. We let them know that this is unacceptable.
throw new Exception("Please create a quarantine storage location for this store");
}
}
}
newReceivePallet.IsOriginalReceive = true;
newReceivePallet.Save();
}
示例2: CreateReceiveDocForInventory
private ReceiveDoc CreateReceiveDocForInventory(Inventory inventory, int confirmationStatusID, decimal foundQty, int receiptID, DateTime convertedEthDate, User user,string remark)
{
ReceiveDoc newReceiveDoc = new ReceiveDoc();
newReceiveDoc.AddNew();
newReceiveDoc.SetColumn("BatchNo", inventory.GetColumn("BatchNo"));
newReceiveDoc.ItemID = inventory.ItemID;
newReceiveDoc.ManufacturerId = inventory.ManufacturerID;
newReceiveDoc.SetColumn("UnitID", inventory.UnitID);
if (!inventory.IsColumnNull("SupplierID"))
newReceiveDoc.SupplierID = inventory.SupplierID;
BLL.ItemUnit iu = new ItemUnit();
iu.LoadByPrimaryKey(inventory.UnitID);
newReceiveDoc.Quantity = newReceiveDoc.QuantityLeft = foundQty*iu.QtyPerUnit;
newReceiveDoc.NoOfPack = foundQty;
newReceiveDoc.InvoicedNoOfPack = foundQty;
newReceiveDoc.QtyPerPack = iu.QtyPerUnit;
newReceiveDoc.Date = convertedEthDate;
newReceiveDoc.SetColumn("ExpDate", inventory.GetColumn("ExpiryDate"));
newReceiveDoc.Out = false;
newReceiveDoc.ReceivedBy = user.UserName;
newReceiveDoc.StoreID = inventory.ActivityID;
newReceiveDoc.SetColumn("LocalBatchNo", inventory.GetColumn("BatchNo"));
newReceiveDoc.RefNo = receiptID.ToString();
newReceiveDoc.SetColumn("Cost", inventory.GetColumn("Cost"));
newReceiveDoc.SetColumn("IsApproved", DBNull.Value);
newReceiveDoc.EurDate = DateTimeHelper.ServerDateTime;
newReceiveDoc.SetColumn("SellingPrice", inventory.GetColumn("SellingPrice"));
newReceiveDoc.SetColumn("UnitCost", inventory.GetColumn("Cost"));
newReceiveDoc.SetColumn("Cost", inventory.GetColumn("Cost"));
newReceiveDoc.SetColumn("PricePerPack", inventory.GetColumn("Cost"));
newReceiveDoc.SetColumn("DeliveryNote", DBNull.Value);
newReceiveDoc.Confirmed = true;
newReceiveDoc.ConfirmedDateTime = DateTimeHelper.ServerDateTime;
newReceiveDoc.ReturnedStock = false;
newReceiveDoc.ReceiptID = receiptID;
newReceiveDoc.SetColumn("Margin", inventory.GetColumn("Margin"));
newReceiveDoc.RefNo = "BeginningBalance";
if(!string.IsNullOrEmpty(remark))
newReceiveDoc.IsDamaged = false;
if (!string.IsNullOrEmpty(remark))
{
newReceiveDoc.Remark = remark;
}
newReceiveDoc.Save();
//Now Save the ReceiveDocConfirmation
ReceiveDocConfirmation rdConf = new ReceiveDocConfirmation();
rdConf.AddNew();
rdConf.ReceiveDocID = newReceiveDoc.ID;
rdConf.ReceivedByUserID = user.ID;
rdConf.ReceiptConfirmationStatusID = confirmationStatusID;
rdConf.Save();
return newReceiveDoc;
}
示例3: CreateInventoryReceive
public ReceiveDoc CreateInventoryReceive(Inventory inventory,int receiptID,Inventory.QuantityType quantityType,DateTime ethiopianDate,User user)
{
ItemUnit itemUnit = new ItemUnit();
itemUnit.LoadByPrimaryKey(inventory.UnitID);
ReceiveDoc receiveDoc = new ReceiveDoc();
receiveDoc.AddNew();
receiveDoc.ItemID = inventory.ItemID;
receiveDoc.UnitID = inventory.UnitID;
receiveDoc.ManufacturerId = inventory.ManufacturerID;
receiveDoc.StoreID = inventory.ActivityID;
receiveDoc.Date = ethiopianDate;
receiveDoc.EurDate = DateTimeHelper.ServerDateTime;
receiveDoc.PhysicalStoreID = inventory.PhysicalStoreID;
receiveDoc.SetColumn("BatchNo", inventory.GetColumn("BatchNo"));
decimal quantity = quantityType == Inventory.QuantityType.Sound
? inventory.InventorySoundQuantity
: quantityType == Inventory.QuantityType.Damaged
? inventory.InventoryDamagedQuantity :inventory.InventoryExpiredQuantity;
if(quantityType == Inventory.QuantityType.Damaged) receiveDoc.ShortageReasonID = ShortageReasons.Constants.DAMAGED;
receiveDoc.Quantity = receiveDoc.QuantityLeft = quantity * itemUnit.QtyPerUnit;
receiveDoc.NoOfPack = receiveDoc.InvoicedNoOfPack = quantity;
receiveDoc.QtyPerPack = itemUnit.QtyPerUnit;
receiveDoc.SetColumn("ExpDate", inventory.GetColumn("ExpiryDate"));
receiveDoc.Out = false;
receiveDoc.ReceivedBy = user.UserName;
receiveDoc.StoreID = inventory.ActivityID;
receiveDoc.RefNo = "BeginningBalance";
decimal cost = 0;
decimal margin = 0;
if (!inventory.IsColumnNull("Cost"))
{
cost = inventory.Cost;
}
if(!inventory.IsColumnNull("Margin"))
{
margin = inventory.Margin;
}
receiveDoc.Cost = Convert.ToDouble(cost);
receiveDoc.PricePerPack = Convert.ToDouble(cost);
receiveDoc.UnitCost = cost;
receiveDoc.Margin = Convert.ToDouble(margin);
receiveDoc.SellingPrice = Convert.ToDouble(BLL.Settings.IsCenter ? cost : cost * (1 + margin));
receiveDoc.SupplierID = 2; //TODO: HARDCODE WARNING WARNING WARNING
receiveDoc.DeliveryNote = false;
receiveDoc.Confirmed = true;
receiveDoc.ConfirmedDateTime = DateTimeHelper.ServerDateTime;
receiveDoc.ReturnedStock = false;
receiveDoc.ReceiptID = receiptID;
receiveDoc.RefNo = "BeginningBalance";
receiveDoc.InventoryPeriodID = inventory.InventoryPeriodID;
receiveDoc.IsDamaged = (quantityType == Inventory.QuantityType.Damaged ||
quantityType == Inventory.QuantityType.Expired);
receiveDoc.Save();
//Now Save the ReceiveDocConfirmation
ReceiveDocConfirmation rdConf = new ReceiveDocConfirmation();
rdConf.AddNew();
rdConf.ReceiveDocID = receiveDoc.ID;
rdConf.ReceivedByUserID = user.ID;
rdConf.ReceiptConfirmationStatusID = ReceiptConfirmationStatus.Constants.RECEIVE_QUANTITY_CONFIRMED;
rdConf.Save();
//TODO: Create Receive Pallet Here
PalletLocation palletLocation = new PalletLocation();
palletLocation.LoadByPrimaryKey(quantityType != Inventory.QuantityType.Damaged
? inventory.PalletLocationID
: inventory.DamagedPalletLocationID);
ReceivePallet receivePallet = new ReceivePallet();
receivePallet.AddNew();
receivePallet.Balance = quantity * itemUnit.QtyPerUnit;
receivePallet.ReceivedQuantity = quantity * itemUnit.QtyPerUnit;
receivePallet.ReservedStock = 0;
receivePallet.ReceiveID = receiveDoc.ID;
if(palletLocation.IsColumnNull("PalletID"))
{
Pallet pallet = new Pallet();
pallet.AddNew();
pallet.Save();
palletLocation.PalletID = pallet.ID;
palletLocation.Save();
}
receivePallet.PalletID = palletLocation.PalletID;
receivePallet.PalletLocationID =palletLocation.ID;
receivePallet.BoxSize = 0;
receivePallet.IsOriginalReceive = true;
receivePallet.Save();
//.........这里部分代码省略.........