Ejemplo n.º 1
0
        public HttpResponseMessage GetBaseItemListJson(string queryJson)
        {
            //EnCode:Client_StyleCodeOption 花型
            //EnCode:Client_ColorCodeOption 色号
            //EnCode:Client_OpPositionCodeOption 施工位置
            //EnCode:Client_PaymentState 施工位置
            var encode  = queryJson.ToJObject()["encode"].ToString();
            var keyword = queryJson.ToJObject()["keyword"].ToString();

            var data = busines.GetDataItemList().Where(t => t.EnCode == encode).OrderBy(t => t.ItemName);

            if (!string.IsNullOrEmpty(keyword))
            {
                data = busines.GetDataItemList().Where(t => t.EnCode == encode).Where(t => t.ItemCode == keyword).OrderBy(t => t.ItemName);
            }

            HttpResponseMessage ut = new HttpResponseMessage {
                Content = new StringContent(data.ToJson(), Encoding.GetEncoding("UTF-8"), "application/json")
            };


            if (encode == "Client_StyleCodeOption")
            {
                var dataprice = priceBLL.GetList("");

                var sg = from c in data
                         join t in dataprice
                         on new { id = c.ItemCode, id1 = c.ItemValue }
                equals new { id = t.ProductId, id1 = t.ItemDetailId }
                select new
                {
                    ItemDetailId = c.ItemDetailId,
                    ItemValue    = c.ItemValue,
                    ItemName     = c.ItemName,
                    Price        = t.SalePrice == null ? 0 : t.SalePrice
                };

                ut = new HttpResponseMessage {
                    Content = new StringContent(sg.ToJson(), Encoding.GetEncoding("UTF-8"), "application/json")
                };
            }

            return(ut);
        }
Ejemplo n.º 2
0
        public ActionResult GetListJson(string queryJson)
        {
            var data = pricebll.GetList(queryJson);

            return(ToJsonResult(data));
        }