本文整理汇总了C#中BLL.ReceiveDoc.LoadByItemIDUnitIDStoreID方法的典型用法代码示例。如果您正苦于以下问题:C# ReceiveDoc.LoadByItemIDUnitIDStoreID方法的具体用法?C# ReceiveDoc.LoadByItemIDUnitIDStoreID怎么用?C# ReceiveDoc.LoadByItemIDUnitIDStoreID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BLL.ReceiveDoc
的用法示例。
在下文中一共展示了ReceiveDoc.LoadByItemIDUnitIDStoreID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChangeItemUnit
/// <summary>
/// Change the UnitID of one item to another UnitID.
/// </summary>
/// <param name="storeID"></param>
/// <param name="itemID"></param>
/// <param name="fromUnitID"></param>
/// <param name="toUnitID"></param>
public static void ChangeItemUnit(int storeID, int itemID, int fromUnitID, int toUnitID)
{
MyGeneration.dOOdads.TransactionMgr transaction = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr();
try
{
transaction.BeginTransaction();
ItemUnit iuFrom = new ItemUnit(), iuTo = new ItemUnit(), iuExecute = new ItemUnit();
iuFrom.LoadByPrimaryKey(fromUnitID);
iuTo.LoadByPrimaryKey(toUnitID);
var receiveTableFilterQuery = HCMIS.Repository.Queries.ItemUnit.SelectChangeItemUnit(storeID, itemID, iuFrom.ID);
string query;
// Update Issue Doc
query =
HCMIS.Repository.Queries.ItemUnit.UpdateChangeItemUnitIssueDoc(iuTo.QtyPerUnit, iuFrom.QtyPerUnit, receiveTableFilterQuery);
iuExecute.LoadFromRawSql(query);
// Update disposal table
query =
HCMIS.Repository.Queries.ItemUnit.UpdateChangeItemUnitLossAndAdjustment(iuTo.QtyPerUnit, iuFrom.QtyPerUnit, receiveTableFilterQuery);
iuExecute.LoadFromRawSql(query);
// Update Order.
query =
HCMIS.Repository.Queries.ItemUnit.UpdateChangeItemUnitOrderDetail(itemID, iuFrom.ID, iuFrom.QtyPerUnit, iuTo.QtyPerUnit);
iuExecute.LoadFromRawSql(query);
// Update Pick List Detail
query =
HCMIS.Repository.Queries.ItemUnit.UpdateChangeItemUnitPickListDetail(iuTo.QtyPerUnit, iuFrom.QtyPerUnit, receiveTableFilterQuery);
iuExecute.LoadFromRawSql(query);
// change the Weighted Average Log
try
{
query = HCMIS.Repository.Queries.ItemUnit.UpdateChangeItemUnitMovingAverageHistory(storeID, iuTo.ID, iuFrom.ID);
iuExecute.LoadFromRawSql(query);
}
catch
{
}
BLL.ReceiveDoc rd = new ReceiveDoc();
rd.LoadByItemIDUnitIDStoreID(itemID, iuFrom.ID, storeID);
rd.ChangeUnitID(iuTo.ID);
//Change the YearEnd
//If there is already an entry with the other UnitID, we need to merge the two.
BLL.YearEnd yEndFrom = new YearEnd();
yEndFrom.Where.UnitID.Value = iuFrom.ID;
yEndFrom.Where.ItemID.Value = itemID;
yEndFrom.Where.StoreID.Value = storeID;
yEndFrom.Query.Load();
if (yEndFrom.RowCount > 0)
{
//There is a year end entry.
//If there is one by the new UnitID, we merge them. If there is no entry by the new UnitID, we just change the values.
BLL.YearEnd yEndTo = new YearEnd();
yEndTo.Where.UnitID.Value = iuTo.ID;
yEndTo.Where.ItemID.Value = itemID;
yEndTo.Where.StoreID.Value = storeID;
yEndTo.Query.Load();
if (yEndTo.RowCount > 0)
{
//We need to merge.
if (!yEndTo.IsColumnNull("EndingPrice"))
yEndTo.EndingPrice += yEndFrom.EndingPrice;
else
yEndTo.EndingPrice = yEndFrom.EndingPrice;
if (!yEndTo.IsColumnNull("EBalance"))
yEndTo.EBalance += yEndFrom.EBalance;
else
yEndTo.EBalance = yEndFrom.EBalance;
if (!yEndTo.IsColumnNull("PhysicalInventory"))
yEndTo.PhysicalInventory += yEndFrom.PhysicalInventory;
else
yEndTo.PhysicalInventory = yEndFrom.PhysicalInventory;
if (!yEndTo.IsColumnNull("PhysicalInventoryPrice"))
yEndTo.PhysicalInventoryPrice += yEndFrom.PhysicalInventoryPrice;
else
yEndTo.PhysicalInventoryPrice = yEndFrom.PhysicalInventoryPrice;
yEndTo.Save();
yEndFrom.MarkAsDeleted();
yEndFrom.Save();
//.........这里部分代码省略.........