本文整理汇总了C#中BLL.ReceiveDoc.GetBatchWithValue方法的典型用法代码示例。如果您正苦于以下问题:C# ReceiveDoc.GetBatchWithValue方法的具体用法?C# ReceiveDoc.GetBatchWithValue怎么用?C# ReceiveDoc.GetBatchWithValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BLL.ReceiveDoc
的用法示例。
在下文中一共展示了ReceiveDoc.GetBatchWithValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildStoreInventoryList
private void BuildStoreInventoryList(int year, int storeId, DataTable dtItm)
{
string[] str = { "Item Name", "Batch No.", "Remark" };
foreach (string co in str)
{
dtBB.Columns.Add(co);
}
str = new string[] { "ItemId", "No.", "Beginning Balance", "Ending Balance(SOH)", "Physical Inventory", "ID", "RecID"};//, "Change Since Sene 30" };
foreach (string co in str)
{
dtBB.Columns.Add(co, typeof(int));
}
int count = 1;
var yProcess = new YearEnd();
var bal = new Balance();
dtDate.Value = DateTime.Now;
DateTime dtCurent = new DateTime();
dtDate.CustomFormat = "MM/dd/yyyy";
dtCurent = ConvertDate.DateConverter(dtDate.Text);
var recDoc = new ReceiveDoc();
int month = dtCurent.Month;
//btnSave.Enabled = true;
//CALENDAR:
//if ((dtCurent.Month == 10 && dtCurent.Day == 30) || dtCurent.Month == 11)
//{
// //btnSave.Enabled = ((!yProcess.IsInventoryComplete(year, storeId)));
// btnSave.Enabled =true;
// month = 10;
//}
//else
// btnSave.Enabled = false;
var yEnd = new YearEnd();
foreach (DataRow dr in dtItm.Rows)//For each item
{
string itemName = dr["ItemName"].ToString() + " - " + dr["DosageForm"].ToString() + " - " + dr["Strength"].ToString();
int itemID = Convert.ToInt32(dr["ID"]);
bool BalanceExists = (yProcess.DoesBalanceExist(year, storeId, itemID, false));
//We don't want to display those items whose inventory has already been done.
if (BalanceExists)
continue;
//bereket
//Int64 soh = bal.GetSOH(Convert.ToInt32(dr["ID"]), storeId, month, year);
Int64 soh = bal.GetSOHOptimized(Convert.ToInt32(dr["ID"]), storeId, month, year);
Int64 bbal = yEnd.GetBBalance(year, storeId, Convert.ToInt32(dr["ID"]), month);
yProcess.GetBalanceByItemId(year, storeId, Convert.ToInt32(dr["ID"]));
Int64 BB = (yProcess.RowCount > 0) ? yProcess.BBalance : bbal;
Int64 EB = ((yProcess.RowCount > 0 && yProcess.EBalance != 0) ? yProcess.EBalance : soh);
//Now if the physical inventory is chosen to be default value, we set it to the ending balance of last year.
string Phy = (yProcess.RowCount > 0) ? yProcess.PhysicalInventory.ToString() : (_defaultValueToPhysicalInventory ? EB.ToString() : "");
int id = (yProcess.RowCount > 0) ? yProcess.ID : 0;
string remark = (yProcess.RowCount > 0) ? yProcess.Remark : "";
//object[] obj = {Convert.ToInt32(dr["ID"]),count,itemName,"",BB,((EB != 0)?EB.ToString("#,###"):"0"),Phy,remark,id,-1};
//dtBB.Rows.Add(obj);
DataRowView drv = dtBB.DefaultView.AddNew();
if (yProcess.RowCount > 0)
{
drv["ID"] = yProcess.ID;
}
drv["ItemId"] = dr["ID"];
drv["No."] = count;
drv["Item Name"] = itemName;
drv["Beginning Balance"] = BB;
drv["Ending Balance(SOH)"] = EB;
if (Phy != "")
{
drv["Physical Inventory"] = Phy;
}
drv["RecID"] = -1;
drv["Remark"] = remark;
var ethioDate = new EthiopianDate.EthiopianDate(year, 1, 1);
//drv["Change Since Sene 30"] = BLL.Balance.GetChangeAfterDate(itemID, storeId, ethioDate.EndOfFiscalYear.ToGregorianDate());
count++;
//if (!BalanceExists)
//{
int theLastBalance = 0;
DataTable dtBatchs = recDoc.GetBatchWithValue(storeId, Convert.ToInt32(dr["ID"]), dtCurent);
foreach (DataRow drBatch in dtBatchs.Rows) //For each batch
{
if (drBatch["QuantityLeft"] != DBNull.Value && Convert.ToInt64(drBatch["QuantityLeft"]) != 0)
{
drv = dtBB.DefaultView.AddNew();
drv["Item Name"] = ">>";
drv["Batch No."] = drBatch["BatchNo"];
drv["Ending Balance(SOH)"] = Convert.ToInt64(drBatch["QuantityLeft"]);
//Now if the physical inventory is chosen to be default value, we set it to the ending balance of last year.
if (_defaultValueToPhysicalInventory)
drv["Physical Inventory"] = drBatch["QuantityLeft"].ToString();
//.........这里部分代码省略.........