Esempio n. 1
0
        public ActionResult Add()
        {
            string cateNum = WebUtil.GetQueryStringValue <string>("cateNum", string.Empty);
            ProductCategoryEntity entity = null;

            if (!cateNum.IsEmpty())
            {
                ProductCategoryProvider provider = new ProductCategoryProvider();
                entity = provider.GetSingle(cateNum);
            }
            entity           = entity.IsNull() ? new ProductCategoryEntity() : entity;
            ViewBag.Category = entity;
            return(View());
        }
        public ActionResult Add()
        {
            string SnNum = WebUtil.GetQueryStringValue <string>("SnNum", string.Empty);
            ProductCategoryEntity entity = null;
            ITopClient            client = new TopClientDefault();

            if (!SnNum.IsEmpty())
            {
                Dictionary <string, string> dic = new Dictionary <string, string>();
                dic.Add("CompanyID", CompanyID);
                dic.Add("SnNum", SnNum);

                string result = client.Execute(ProductCategoryApiName.ProductCategoryApiName_Single, dic);
                DataResult <ProductCategoryEntity> dataResult = JsonConvert.DeserializeObject <DataResult <ProductCategoryEntity> >(result);
                entity = dataResult.Result;
            }

            entity            = entity.IsNull() ? new ProductCategoryEntity() : entity;
            ViewBag.Entity    = entity;
            ViewBag.ParentNum = DropDownHelper.GetCate(string.Empty, this.CompanyID);
            return(View());
        }