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


C# Inventory.GetColumn方法代码示例

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


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

示例1: CreateReceiveDocForInventory

        private ReceiveDoc CreateReceiveDocForInventory(Inventory inventory, int confirmationStatusID, decimal foundQty, int receiptID, DateTime convertedEthDate, User user,string remark)
        {
            ReceiveDoc newReceiveDoc = new ReceiveDoc();
            newReceiveDoc.AddNew();

            newReceiveDoc.SetColumn("BatchNo", inventory.GetColumn("BatchNo"));
            newReceiveDoc.ItemID = inventory.ItemID;
            newReceiveDoc.ManufacturerId = inventory.ManufacturerID;
            newReceiveDoc.SetColumn("UnitID", inventory.UnitID);
            if (!inventory.IsColumnNull("SupplierID"))
                newReceiveDoc.SupplierID = inventory.SupplierID;
            BLL.ItemUnit iu = new ItemUnit();
            iu.LoadByPrimaryKey(inventory.UnitID);
            newReceiveDoc.Quantity = newReceiveDoc.QuantityLeft = foundQty*iu.QtyPerUnit;
            newReceiveDoc.NoOfPack = foundQty;
            newReceiveDoc.InvoicedNoOfPack = foundQty;
            newReceiveDoc.QtyPerPack = iu.QtyPerUnit;
            newReceiveDoc.Date = convertedEthDate;
            newReceiveDoc.SetColumn("ExpDate", inventory.GetColumn("ExpiryDate"));
            newReceiveDoc.Out = false;
            newReceiveDoc.ReceivedBy = user.UserName;
            newReceiveDoc.StoreID = inventory.ActivityID;
            newReceiveDoc.SetColumn("LocalBatchNo", inventory.GetColumn("BatchNo"));
            newReceiveDoc.RefNo = receiptID.ToString();
            newReceiveDoc.SetColumn("Cost", inventory.GetColumn("Cost"));
            newReceiveDoc.SetColumn("IsApproved", DBNull.Value);
            newReceiveDoc.EurDate = DateTimeHelper.ServerDateTime;
            newReceiveDoc.SetColumn("SellingPrice", inventory.GetColumn("SellingPrice"));
            newReceiveDoc.SetColumn("UnitCost", inventory.GetColumn("Cost"));
            newReceiveDoc.SetColumn("Cost", inventory.GetColumn("Cost"));
            newReceiveDoc.SetColumn("PricePerPack", inventory.GetColumn("Cost"));
            newReceiveDoc.SetColumn("DeliveryNote", DBNull.Value);
            newReceiveDoc.Confirmed = true;
            newReceiveDoc.ConfirmedDateTime = DateTimeHelper.ServerDateTime;
            newReceiveDoc.ReturnedStock = false;
            newReceiveDoc.ReceiptID = receiptID;
            newReceiveDoc.SetColumn("Margin", inventory.GetColumn("Margin"));
            newReceiveDoc.RefNo = "BeginningBalance";
            if(!string.IsNullOrEmpty(remark))
            newReceiveDoc.IsDamaged = false;
            if (!string.IsNullOrEmpty(remark))
            {
                newReceiveDoc.Remark = remark;
            }
            newReceiveDoc.Save();

            //Now Save the ReceiveDocConfirmation

            ReceiveDocConfirmation rdConf = new ReceiveDocConfirmation();
            rdConf.AddNew();
            rdConf.ReceiveDocID = newReceiveDoc.ID;
            rdConf.ReceivedByUserID = user.ID;
            rdConf.ReceiptConfirmationStatusID = confirmationStatusID;
            rdConf.Save();

            return newReceiveDoc;
        }
开发者ID:USAID-DELIVER-PROJECT,项目名称:ethiopia-hcmis-warehouse,代码行数:57,代码来源:ReceiveService.cs

示例2: CreateInventoryReceive

        public ReceiveDoc CreateInventoryReceive(Inventory inventory,int receiptID,Inventory.QuantityType quantityType,DateTime ethiopianDate,User user)
        {
            ItemUnit itemUnit = new ItemUnit();
            itemUnit.LoadByPrimaryKey(inventory.UnitID);

            ReceiveDoc receiveDoc = new ReceiveDoc();
            receiveDoc.AddNew();
            receiveDoc.ItemID = inventory.ItemID;
            receiveDoc.UnitID = inventory.UnitID;
            receiveDoc.ManufacturerId = inventory.ManufacturerID;

            receiveDoc.StoreID = inventory.ActivityID;
            receiveDoc.Date = ethiopianDate;
            receiveDoc.EurDate = DateTimeHelper.ServerDateTime;
            receiveDoc.PhysicalStoreID = inventory.PhysicalStoreID;
            receiveDoc.SetColumn("BatchNo", inventory.GetColumn("BatchNo"));
            decimal quantity = quantityType == Inventory.QuantityType.Sound
                                   ? inventory.InventorySoundQuantity
                                   : quantityType == Inventory.QuantityType.Damaged
                                    ? inventory.InventoryDamagedQuantity :inventory.InventoryExpiredQuantity;

            if(quantityType == Inventory.QuantityType.Damaged) receiveDoc.ShortageReasonID = ShortageReasons.Constants.DAMAGED;
            receiveDoc.Quantity = receiveDoc.QuantityLeft = quantity * itemUnit.QtyPerUnit;
            receiveDoc.NoOfPack = receiveDoc.InvoicedNoOfPack = quantity;
            receiveDoc.QtyPerPack = itemUnit.QtyPerUnit;
            receiveDoc.SetColumn("ExpDate", inventory.GetColumn("ExpiryDate"));

            receiveDoc.Out = false;

            receiveDoc.ReceivedBy = user.UserName;

            receiveDoc.StoreID = inventory.ActivityID;
            receiveDoc.RefNo = "BeginningBalance";
            decimal cost = 0;
            decimal margin = 0;

            if (!inventory.IsColumnNull("Cost"))
            {
                cost = inventory.Cost;
            }

            if(!inventory.IsColumnNull("Margin"))
            {
                margin = inventory.Margin;
            }

            receiveDoc.Cost = Convert.ToDouble(cost);
            receiveDoc.PricePerPack = Convert.ToDouble(cost);
            receiveDoc.UnitCost = cost;
            receiveDoc.Margin = Convert.ToDouble(margin);
            receiveDoc.SellingPrice = Convert.ToDouble(BLL.Settings.IsCenter ? cost : cost * (1 + margin));
            receiveDoc.SupplierID = 2; //TODO: HARDCODE WARNING WARNING WARNING
            receiveDoc.DeliveryNote = false;
            receiveDoc.Confirmed = true;
            receiveDoc.ConfirmedDateTime = DateTimeHelper.ServerDateTime;
            receiveDoc.ReturnedStock = false;
            receiveDoc.ReceiptID = receiptID;
            receiveDoc.RefNo = "BeginningBalance";
            receiveDoc.InventoryPeriodID = inventory.InventoryPeriodID;
            receiveDoc.IsDamaged = (quantityType == Inventory.QuantityType.Damaged ||
                                   quantityType == Inventory.QuantityType.Expired);
            receiveDoc.Save();

            //Now Save the ReceiveDocConfirmation

            ReceiveDocConfirmation rdConf = new ReceiveDocConfirmation();
            rdConf.AddNew();
            rdConf.ReceiveDocID = receiveDoc.ID;
            rdConf.ReceivedByUserID = user.ID;
            rdConf.ReceiptConfirmationStatusID = ReceiptConfirmationStatus.Constants.RECEIVE_QUANTITY_CONFIRMED;
            rdConf.Save();

            //TODO: Create Receive Pallet Here
            PalletLocation palletLocation = new PalletLocation();

            palletLocation.LoadByPrimaryKey(quantityType != Inventory.QuantityType.Damaged
                                                ? inventory.PalletLocationID
                                                : inventory.DamagedPalletLocationID);

            ReceivePallet receivePallet = new ReceivePallet();
            receivePallet.AddNew();
            receivePallet.Balance = quantity * itemUnit.QtyPerUnit;
            receivePallet.ReceivedQuantity = quantity * itemUnit.QtyPerUnit;
            receivePallet.ReservedStock = 0;
            receivePallet.ReceiveID = receiveDoc.ID;

            if(palletLocation.IsColumnNull("PalletID"))
            {
                Pallet pallet = new Pallet();
                pallet.AddNew();
                pallet.Save();
                palletLocation.PalletID = pallet.ID;
                palletLocation.Save();
            }

            receivePallet.PalletID = palletLocation.PalletID;
            receivePallet.PalletLocationID =palletLocation.ID;
            receivePallet.BoxSize = 0;
            receivePallet.IsOriginalReceive = true;
            receivePallet.Save();
//.........这里部分代码省略.........
开发者ID:USAID-DELIVER-PROJECT,项目名称:ethiopia-hcmis-warehouse,代码行数:101,代码来源:ReceiveService.cs


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