public IActionResult Index(ProdItemSearchParam param)
 {
     var model = new ItemModel.Index();
     if (param.Keyword.IsMatch(@"^\d+$"))
     {
         param.Id = param.Keyword.AsInt();
     }
     else
     {
         param.Name = param.Keyword;
     }
     model.Param = param;
     model.Items = DefaultStorage.ProdItemSearch(param);
     return View(model);
 }
Beispiel #2
0
        public IActionResult Index(ProdItemSearchParam param)
        {
            var model = new ItemModel.Index();

            if (param.Keyword.IsMatch(@"^\d+$"))
            {
                param.Id = param.Keyword.AsInt();
            }
            else
            {
                param.Name = param.Keyword;
            }
            model.Param = param;
            model.Items = DefaultStorage.ProdItemSearch(param);
            return(View(model));
        }
Beispiel #3
0
        public IActionResult Index(int id = 0, int skuId = 0)
        {
            var model = new ItemModel.Index();
            var item  = DefaultStorage.ItemGet(id, true);

            if (item != null)
            {
                model.Item = item;
                if (skuId > 0)
                {
                    var sku = item.Skus.FirstOrDefault(x => x.Status == Prod.Status.Online && x.Id == skuId);
                    if (sku != null)
                    {
                        model.SelectdProps = sku.PropId.Split(';');
                    }
                }
            }
            return(View(model));
        }