本文整理汇总了C#中BLL.ReceiveDoc.GetLastReceivedCost方法的典型用法代码示例。如果您正苦于以下问题:C# ReceiveDoc.GetLastReceivedCost方法的具体用法?C# ReceiveDoc.GetLastReceivedCost怎么用?C# ReceiveDoc.GetLastReceivedCost使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BLL.ReceiveDoc
的用法示例。
在下文中一共展示了ReceiveDoc.GetLastReceivedCost方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OverStockedItems
public DataTable OverStockedItems(int storeId, int year, int month, string selectedType, BackgroundWorker bw)
{
DataTable dtBal = new DataTable();
GeneralInfo pipline = new GeneralInfo();
Items itm = new Items();
Balance bal = new Balance();
IssueDoc iss = new IssueDoc();
ReceiveDoc rec = new ReceiveDoc();
string[] str = { "FullItemName", "SOH", "AMC", "MOS", "Min", "Max", "ExcessQty", "ExcessAmount", "CategoryId", "SubCategoryID", "ID" };
foreach (string s in str)
{
dtBal.Columns.Add(s);
}
pipline.LoadAll();
int min = pipline.Min;
int max = pipline.Max;
double eop = pipline.EOP;
DataTable dtItem = new DataTable();
dtItem = ((selectedType == "Drug") ? itm.GetAllItems(1) : itm.GetAllSupply());
int i = 1;
foreach (DataRow dr in dtItem.Rows)
{
string itemName = dr["FullItemName"].ToString();
int yer = (month < 11) ? year : year - 1;
Int64 AMC = bal.CalculateAMC(Convert.ToInt32(dr["ID"]), storeId, month, yer);
Int64 MinCon = AMC * min;
Int64 maxCon = AMC * max;
Int64 SOH = bal.GetSOH(Convert.ToInt32(dr["ID"]), storeId, month, yer);
if (SOH > maxCon)
{
decimal MOS = (AMC != 0) ? (Convert.ToDecimal(SOH) / Convert.ToDecimal(AMC)) : 0;
MOS = Decimal.Round(MOS, 1);
Int64 excessQty = SOH - maxCon;
double price = rec.GetLastReceivedCost(Convert.ToInt32(dr["ID"]), storeId);
double excessAmount = price * excessQty;
object[] obj = { itemName, SOH, AMC, MOS, MinCon, maxCon, excessQty, excessAmount, Convert.ToInt32(dr["CategoryId"]), Convert.ToInt32(dr["SubCategoryID"]), Convert.ToInt32(dr["ID"]) };
dtBal.Rows.Add(obj);
}
bw.ReportProgress(Convert.ToInt32((Convert.ToDouble(i++) / dtItem.Rows.Count) * 100));
}
return dtBal;
}