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


C# Zippy.ColAdd方法代码示例

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


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

示例1: InOutDepot

        /// <summary>
        /// 采购出入库
        /// </summary>
        /// <param name="tenantID">租户</param>
        /// <param name="userID">操作者</param>
        /// <param name="oStatus">当前状态</param>
        /// <param name="hsItemCount">各个商品的具体入库数量</param>
        /// <param name="db"></param>
        /// <returns></returns>
        public bool InOutDepot(Guid tenantID, Guid userID, EAP.Logic.Z10.OrderStatus oStatus, Hashtable hsItemCount, Zippy.Data.IDalProvider db)
        {
            throw new Exception("这个入库方式需要商榷。");
            int orderSts = Z10Order.OrderStatus ?? 0;
            if ((orderSts & (int)EAP.Logic.Z10.OrderStatus.Outted) == (int)EAP.Logic.Z10.OrderStatus.Inned ||
                (orderSts & (int)EAP.Logic.Z10.OrderStatus.Finished) == (int)EAP.Logic.Z10.OrderStatus.Finished ||
                (orderSts & (int)EAP.Logic.Z10.OrderStatus.Archived) == (int)EAP.Logic.Z10.OrderStatus.Archived)
            {
                throw new Exception("已经出入库的订单,已经结束的订单和已经存档的订单不能出入库。");
            }

            Z10Order xorder = new Z10Order();
            xorder.OrderID = Z10Order.OrderID;

            if (oStatus == OrderStatus.Inned && ((Z10Order.OrderStatus ?? 0) & (int)OrderStatus.InnedSome) == (int)OrderStatus.InnedSome)
            {
                oStatus = oStatus & (~OrderStatus.InnedSome);
                xorder.OrderStatus = (Z10Order.OrderStatus ?? 0) & (~(int)OrderStatus.InnedSome);
                xorder.OrderStatus = (xorder.OrderStatus ?? 0) | (int)oStatus;
            }
            else if (oStatus == OrderStatus.Outted && ((Z10Order.OrderStatus ?? 0) & (int)OrderStatus.OuttedSome) == (int)OrderStatus.OuttedSome)
            {
                oStatus = oStatus & (~OrderStatus.OuttedSome);
                xorder.OrderStatus = (Z10Order.OrderStatus ?? 0) & (~(int)OrderStatus.OuttedSome);
                xorder.OrderStatus = (xorder.OrderStatus ?? 0) | (int)oStatus;
            }
            else
            {
                xorder.OrderStatus = (Z10Order.OrderStatus ?? 0) | (int)oStatus;
            }

            db.Update(xorder);

            Z10DepotFlow dflow = new Z10DepotFlow();
            foreach (Z10OrderItem item in Items)
            {
                decimal itemHappened = hsItemCount[item.ItemID].ToDecimal();

                if ((oStatus & OrderStatus.Outted) == OrderStatus.Outted || (oStatus & OrderStatus.OuttedSome) == OrderStatus.OuttedSome)
                    db.ColAdd<Z10OrderItem>("CountHappend2", itemHappened, item.ItemID);
                else
                    db.ColAdd<Z10OrderItem>("CountHappend", itemHappened, item.ItemID);

                if (item.CountHappend != 0 || item.CountHappend2 != 0)
                {
                    dflow.FlowID = null;
                    dflow.OrderID = Z10Order.OrderID;
                    dflow.Count = itemHappened;
                    dflow.DepotID = item.DepotID;
                    dflow.Creator = userID;
                    dflow.ProductID = item.ProductID;
                    dflow.TenantID = tenantID;
                    db.Insert(dflow);

                    if (!db.Exists<Z10DepotProduct>("[email protected] and [email protected] and [email protected]",
                        db.CreateParameter("ProductID", item.ProductID), db.CreateParameter("DepotID", item.DepotID), db.CreateParameter("TenantID", tenantID)))
                    {
                        Z10DepotProduct xProduct = new Z10DepotProduct();
                        xProduct.TenantID = tenantID;
                        xProduct.ProductID = item.ProductID;
                        xProduct.DepotID = item.DepotID;
                        xProduct.StockSum = itemHappened;
                        db.Insert(xProduct);
                    }
                    else
                    {
                        string sqlUpdateDepot = "update Z10DepotProduct set StockSum=StockSum + @itemHappened, InSum=InSum + @itemHappened" +
                            " where [email protected] and [email protected]";
                        db.ExecuteNonQuery(sqlUpdateDepot, db.CreateParameter("itemHappened", itemHappened),
                            db.CreateParameter("ProductID", item.ProductID), db.CreateParameter("DepotID", item.DepotID));

                    }
                }
            }
            return true;
        }
开发者ID:honj51,项目名称:EAP,代码行数:85,代码来源:Order.cs


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