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


C# Dictionary.Any方法代码示例

本文整理汇总了C#中BLL.Dictionary.Any方法的典型用法代码示例。如果您正苦于以下问题:C# Dictionary.Any方法的具体用法?C# Dictionary.Any怎么用?C# Dictionary.Any使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BLL.Dictionary的用法示例。


在下文中一共展示了Dictionary.Any方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpdateQuantityAndPhysicalStores

        private void UpdateQuantityAndPhysicalStores()
        {
            var dataTable = gridPutAwayNonPalletized.DataSource as DataTable;
            decimal currentBonusInvQty = 0;
            string currentGuiParam = "";
            var orginalGuidCurrentInvQty = new Dictionary<string, decimal>();

            if (dataTable != null)
                foreach (DataRow drow in dataTable.Rows)
                {
                    if (drow["IsDamaged"] != DBNull.Value && Convert.ToBoolean(drow["IsDamaged"])) continue;
                    var dr = _dtRecGrid.Select(String.Format("GUID = '{0}'", Convert.ToString(drow["GUID"])))[0];

                    bool currentRowIsOrginal = (dr["Copy"].ToString() == "Orginal" || dr["Copy"] == DBNull.Value);
                    currentGuiParam = currentRowIsOrginal ? "GUID" : "Copy";

                    if (drow["PutAwayLocation"] != DBNull.Value)
                    {
                        var plocation = new PalletLocation();
                        plocation.LoadByPrimaryKey(Convert.ToInt32(drow["PutAwayLocation"]));
                        dr["Store"] = (plocation.PhysicalStoreID);
                    }
                    if (drow["Palletized Quantity"] != DBNull.Value)
                    {
                        dr["Pack Qty"] = drow["Palletized Quantity"];

                        bool hasBonus = !srm && dr["InvoicedQty"] != DBNull.Value &&
                                        (Convert.ToDecimal(dr["InvoicedQty"]) < Convert.ToDecimal(drow["Pack Qty"]));

                        if (hasBonus && !orginalGuidCurrentInvQty.Any())
                            GetCurrentBonusInvQty(out orginalGuidCurrentInvQty);
                        if (!hasBonus)
                        {
                            dr["InvoicedQty"] = (currentRowIsOrginal)
                                ? Convert.ToDecimal(dr["Pack Qty"]) +
                                  HasShortageQty(dr["GUID"].ToString())
                                : Convert.ToDecimal(dr["Pack Qty"]);
                        }
                        else
                        {

                            currentBonusInvQty = orginalGuidCurrentInvQty[dr[currentGuiParam].ToString()];

                            if (Convert.ToDecimal(dr["Pack Qty"]) >= currentBonusInvQty && currentBonusInvQty >= 0)
                            {
                                dr["InvoicedQty"] = currentBonusInvQty;
                                orginalGuidCurrentInvQty[dr[currentGuiParam].ToString()] -=
                                    Convert.ToDecimal(dr["Pack Qty"]);

                            }
                            else
                            {
                                if (currentBonusInvQty <= 0)
                                    dr["InvoicedQty"] = 0;
                                else
                                {
                                    dr["InvoicedQty"] = (currentBonusInvQty >= Convert.ToDecimal(dr["Pack Qty"]))
                                        ? Convert.ToDecimal(dr["Pack Qty"])
                                        : currentBonusInvQty;
                                    orginalGuidCurrentInvQty[dr[currentGuiParam].ToString()] -=
                                        Convert.ToDecimal(dr["Pack Qty"]);
                                }
                            }
                        }
                    }
                }
        }
开发者ID:USAID-DELIVER-PROJECT,项目名称:ethiopia-hcmis-warehouse,代码行数:67,代码来源:Receipt.cs


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