Esempio n. 1
0
        /// <summary>
        /// 返回销售商品数量
        /// </summary>
        /// <param name="where"></param>
        /// <returns></returns>
        public static int ProductCount(string where)
        {
            string sum = B_Lebi_Order_Product.GetValue("sum(Count)", "Order_id in (select id from Lebi_Order where " + where + ")");

            if (String.IsNullOrEmpty(sum))
            {
                sum = 0.ToString();
            }
            return(Convert.ToInt32(sum));
        }
Esempio n. 2
0
        /// <summary>
        /// 返回成本
        /// </summary>
        /// <param name="where"></param>
        /// <returns></returns>
        public static decimal Money_CostCount(string where)
        {
            List <Lebi_Order_Product> models = B_Lebi_Order_Product.GetList("Order_id in (select id from Lebi_Order where " + where + ") and Price_Cost = 0", "");

            if (models.Count > 0)
            {
                foreach (Lebi_Order_Product m in models)
                {
                    m.Price_Cost = Shop.Bussiness.EX_Product.GetProduct(m.Product_id).Price_Cost;
                    B_Lebi_Order_Product.Update(m);
                }
            }
            string sum = B_Lebi_Order_Product.GetValue("sum(Price_Cost * Count)", "Order_id in (select id from Lebi_Order where " + where + ")");

            if (String.IsNullOrEmpty(sum))
            {
                sum = 0.ToString();
            }
            return(Convert.ToDecimal(sum));
        }