本文整理汇总了C#中BLL.ReceiveDoc.GetDistinctUnitIDFromReceivedDoc方法的典型用法代码示例。如果您正苦于以下问题:C# ReceiveDoc.GetDistinctUnitIDFromReceivedDoc方法的具体用法?C# ReceiveDoc.GetDistinctUnitIDFromReceivedDoc怎么用?C# ReceiveDoc.GetDistinctUnitIDFromReceivedDoc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BLL.ReceiveDoc
的用法示例。
在下文中一共展示了ReceiveDoc.GetDistinctUnitIDFromReceivedDoc方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateAutomaticInventoryByUnit
public void GenerateAutomaticInventoryByUnit()
{
var ethDate = new EthiopianDate.EthiopianDate();
var stores = new Stores();
stores.GetActiveStores();
var rec = new ReceiveDoc();
var itm = new Items();
var yearEnd = new YearEnd();
var balance = new Balance();
if (!InventoryRequiredForHandlingUnit(false)) return;
while (!stores.EOF) //This needs to be done for each store and for each item
{
//bereket
//itm.ExcludeNeverReceivedItemsNoCategoryForHandlingUnit(stores.ID);
itm.ExcludeNeverReceivedItemsNoCategoryForHandlingUnitOptimized(stores.ID, ethDate.Year);
while (!itm.EOF) //For each item
{
var receivedoc = rec.GetDistinctUnitIDFromReceivedDoc(itm.ID);
foreach (var dr in receivedoc.Rows.Cast<DataRow>().Where(dr =>!DoesBalanceExistByUnit(ethDate.Year, itm.ID, stores.ID, true,Convert.ToInt32(dr["UnitID"]))))
{
//need optimization
//we can exclude the already calculated items when we exclude never recieved items
yearEnd.LoadByItemIDStoreAndYearAndUnit(itm.ID, stores.ID, ethDate.Year, true, Convert.ToInt32(dr["UnitID"]));
if (yearEnd.RowCount > 0) continue;
yearEnd.AddNew();
yearEnd.ItemID = itm.ID;
yearEnd.StoreID = stores.ID;
yearEnd.Year = ethDate.Year;
//need optimization
//atleast we can get the value directly by filtering using storeid and itemid rather than
//selecting all items in all stores and filter it by code
//yearEnd.EBalance = balance.GetSOHByUnit(itm.ID, stores.ID, ethDate.Month, ethDate.Year, Convert.ToInt32(dr["UnitID"]));
yearEnd.EBalance = balance.GetSOHByUnitOptimized(itm.ID, stores.ID, ethDate.Month, ethDate.Year, Convert.ToInt32(dr["UnitID"]));
yearEnd.PhysicalInventory = yearEnd.EBalance;
yearEnd.AutomaticallyEntered = true;
yearEnd.UnitID = Convert.ToInt32(dr["UnitID"]);
yearEnd.Save();
}
itm.MoveNext();
}
stores.MoveNext();
}
}