/// <summary>
        /// 获取产品信息
        /// </summary>
        public QueryProductsModel QueryProduct(int oid)
        {
            QueryProductsModel result = null;

            try
            {
                result = handler.QueryProduct(oid);
                if (result != null)
                {
                    var data = dbScopeManagerBI.Execute(conn => ProductLibraryConfigDAL.QueryProductSalesInfoByPID(conn, result.PID));
                    if (data != null)
                    {
                        result.cy_list_price = data.OfficialWebsitePrice;
                        result.cy_cost       = data.Cost;
                        result.Maoli         = data.OfficialWebsitePrice - data.Cost;
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Log(Level.Error, ex.ToString());
                return(null);
            }
            return(result);
        }
Пример #2
0
        public ProductSalesPredic QueryProductSalesInfoByPID(string pid)
        {
            Func <SqlConnection, ProductSalesPredic> action = (connection)
                                                              => ProductLibraryConfigDAL.QueryProductSalesInfoByPID(connection, pid);

            return(dbManager.Execute(action));
        }