当前位置: 首页>>代码示例>>C#>>正文


C# ReceiveDoc.GetLastReceivedCost方法代码示例

本文整理汇总了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;
        }
开发者ID:USAID-DELIVER-PROJECT,项目名称:ethiopia-hcmis-facility,代码行数:45,代码来源:Balance.cs


注:本文中的BLL.ReceiveDoc.GetLastReceivedCost方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。