public ActionResult SetProduct(int?id)
        {
            var obj  = PrivilegeOrderService.GetObj(id, false);
            var data = SysDataDictService.Find(o => o.DicSN == obj.ModeSN);

            if (obj != null)
            {
                obj.ModeTitle = data.Title;
            }
            List <DropdownItem> parents = null;

            if (obj.SupplierIds.IsNullOrEmpty())
            {
                parents = ProductCategoryService.GetParentTypes().Select(o => new DropdownItem()
                {
                    Value = o.CategorySN.ToString(), Text = o.Title
                }).ToList();
            }
            else
            {
                var sp   = obj.SupplierIds.Split(',').ToList();
                var bars = BaseService <ProductMultSupplier> .FindList(o => sp.Contains(o.SupplierId)).Select(o => o.Barcode).Distinct().ToList();

                var categorys = BaseService <VwProduct> .FindList(o => sp.Contains(o.SupplierId) || bars.Contains(o.Barcode)).Select(o => o.CategorySN).Distinct().ToList();

                parents = ProductCategoryService.GetRootSNs(categorys).Select(o => new DropdownItem()
                {
                    Value = o.CategorySN.ToString(), Text = o.Title
                }).ToList();;
            }
            parents.Insert(0, new DropdownItem("", "请选择"));
            ViewBag.parenttypes = parents.ToJson();
            ViewBag.types       = PrivilegeOrderService.LoadTypeDetailJson(id);
            ViewBag.products    = PrivilegeOrderService.LoadProductDetailJson(id);
            return(View(obj.ModeSN == 46 ? "SetProduct2" : "SetProduct", obj.IsNullThrow()));
        }