예제 #1
0
        /// <summary>
        /// 根据成本Id 和仓库Id 获取相应的 仓库SN 信息
        /// </summary>
        public void GetWareSnByCostWare(HttpContext context, long cost_pro_id)
        {
            // cost_pro_id
            var thisCostPro = new ctt_contract_cost_product_dal().FindNoDeleteById(cost_pro_id);

            if (thisCostPro != null)
            {
                var snType = context.Request.QueryString["snType"];
                if (snType == "conPro")
                {
                    var thisSnlist = new ctt_contract_cost_product_sn_dal().GetListByCostProId(thisCostPro.id);
                    if (thisSnlist != null && thisSnlist.Count > 0)
                    {
                        if (thisCostPro.quantity != thisSnlist.Count)
                        {
                            thisSnlist = thisSnlist.Take(thisCostPro.quantity).ToList();
                        }
                        context.Response.Write(new Tools.Serialize().SerializeJson(thisSnlist));
                    }
                }
                else
                {
                    var thisSnlist = new ivt_warehouse_product_sn_dal().GetListByCostProId(thisCostPro.id);
                    if (thisSnlist != null && thisSnlist.Count > 0)
                    {
                        if (thisCostPro.quantity != thisSnlist.Count)
                        {
                            thisSnlist = thisSnlist.Take(thisCostPro.quantity).ToList();
                        }
                        context.Response.Write(new Tools.Serialize().SerializeJson(thisSnlist));
                    }
                }
            }
        }