Ejemplo n.º 1
0
 public ActionResult SelectType2()
 {
     ViewBag.parenttypes = ListToSelect(ProductCategoryService.GetParentTypes().Select(o => new SelectListItem()
     {
         Value = o.CategorySN.ToString(), Text = o.Title
     }), emptyTitle: "请选择");
     return(View());
 }
Ejemplo n.º 2
0
        //
        // GET: /ProductType/

        public ActionResult Index()
        {
            ViewBag.parenttypes = ListToSelect(ProductCategoryService.GetParentTypes().Select(o => new SelectListItem()
            {
                Value = o.CategorySN.ToString(), Text = o.Title
            }), emptyTitle: "全部");
            ViewBag.states = EnumToSelect(typeof(EnableState), emptyTitle: "全部");
            return(View());
        }
Ejemplo n.º 3
0
 public ActionResult ProductWeight()
 {
     ViewBag.parenttypes = ListToSelect(ProductCategoryService.GetParentTypes().Select(o => new SelectListItem()
     {
         Value = o.CategorySN.ToString(), Text = o.Title
     }), emptyTitle: "全部");
     ViewBag.brands = ListToSelect(ProductBrandService.GetList().Select(o => new SelectListItem()
     {
         Value = o.BrandSN.ToString(), Text = o.Title
     }), emptyTitle: "全部");
     return(View());
 }
Ejemplo n.º 4
0
 public ActionResult Index()
 {
     ViewBag.parenttypes = ListToSelect(ProductCategoryService.GetParentTypes().Select(o => new SelectListItem()
     {
         Value = o.CategorySN.ToString(), Text = o.Title
     }), emptyTitle: "全部");
     //ViewBag.suppliers = ListToSelect(SupplierService.GetList().Where(o => o.BusinessType == 1).Select(o => new SelectListItem() { Value = o.Id, Text = o.Title }), emptyTitle: "全部");
     ViewBag.brands = ListToSelect(ProductBrandService.GetList().Select(o => new SelectListItem()
     {
         Value = o.BrandSN.ToString(), Text = o.Title
     }), emptyTitle: "全部");
     return(View());
 }
Ejemplo n.º 5
0
        public ActionResult SaveProductIntegral(int?id)
        {
            var customers = EnumToSelect(typeof(Pharos.Logic.CustomerType), selectValue: 0);

            customers.Remove(customers.FirstOrDefault(o => o.Selected));
            ViewBag.customers = customers;
            var parents = ProductCategoryService.GetParentTypes().Select(o => new DropdownItem()
            {
                Value = o.CategorySN.ToString(), Text = o.Title
            }).ToList();

            parents.Insert(0, new DropdownItem("", "请选择"));
            ViewBag.parenttypes = parents.ToJson();
            var obj = id.HasValue ? MemberIntegralSetService.FindById(id.Value) : new MemberIntegralSet()
            {
                Scale = 10, Nature = 2
            };

            return(View(obj.IsNullThrow()));
        }
        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()));
        }