コード例 #1
0
        /// <summary>
        /// 根据ID获取采购单信息
        /// </summary>
        /// <param name="purchaseOrderID">采购单ID</param>
        /// <returns>采购单信息</returns>
        public PurchaseOrderInfo GetPurchaseOrderByID(int purchaseOrderID)
        {
            PurchaseOrderInfo info = this.purchaseOrderDao.GetPurchaseOrderByID(purchaseOrderID);

            info.Components  = new List <InvComponentInfo>();
            info.Consumables = new List <InvConsumableInfo>();

            List <InvComponentInfo> components = this.purchaseOrderDao.GetComponents(purchaseOrderID);

            info.Components = components;
            foreach (InvComponentInfo component in components)
            {
                component.Equipment = this.equipmentDao.GetEquipmentByID(component.Equipment.ID);
            }

            List <InvConsumableInfo> consumables = this.purchaseOrderDao.GetConsumables(purchaseOrderID);

            info.Consumables = consumables;

            info.Services = this.purchaseOrderDao.GetServices(purchaseOrderID);
            foreach (InvServiceInfo service in info.Services)
            {
                service.FujiClass2 = this.fujiClassDao.GetFujiClass2ByID(service.FujiClass2.ID);
            }

            List <HistoryInfo> histories = this.historyDao.GetHistories(ObjectTypes.PurchaseOrder, purchaseOrderID);

            if (histories != null && histories.Count > 0)
            {
                foreach (HistoryInfo history in histories)
                {
                    history.Action.Name = PurchaseOrderInfo.Actions.GetDesc(history.Action.ID);
                }
                info.Histories = histories;
                info.SetHis4Comments();
            }

            return(info);
        }
コード例 #2
0
        /// <summary>
        /// 根据ID获取采购单信息
        /// </summary>
        /// <param name="purchaseOrderID">采购单ID</param>
        /// <returns>采购单信息</returns>
        public PurchaseOrderInfo GetPurchaseOrder4Ended(int purchaseOrderID)
        {
            PurchaseOrderInfo info = this.purchaseOrderDao.GetPurchaseOrderByID(purchaseOrderID);

            info.Components = this.invComponentDao.QueryComponentsByPurchaseID(purchaseOrderID);

            info.Consumables = this.invConsumableDao.QueryConsumablesByPurchaseID(purchaseOrderID);

            info.Services = this.invServiceDao.QueryServicesByPurchaseID(purchaseOrderID);

            List <HistoryInfo> histories = this.historyDao.GetHistories(ObjectTypes.PurchaseOrder, purchaseOrderID);

            if (histories != null && histories.Count > 0)
            {
                foreach (HistoryInfo history in histories)
                {
                    history.Action.Name = PurchaseOrderInfo.Actions.GetDesc(history.Action.ID);
                }
                info.Histories = histories;
                info.SetHis4Comments();
            }

            return(info);
        }