Esempio n. 1
0
        public ActionResult Add()
        {
            string        SnNum  = WebUtil.GetQueryStringValue <string>("SnNum", string.Empty);
            ProductEntity 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(ProductApiName.ProductApiName_Single, dic);
                DataResult <ProductEntity> dataResult = JsonConvert.DeserializeObject <DataResult <ProductEntity> >(result);
                entity = dataResult.Result;
            }

            entity         = entity.IsNull() ? new ProductEntity() : entity;
            ViewBag.Entity = entity;

            ViewBag.Unit    = DropDownHelper.GetUnit(entity.UnitNum, this.CompanyID);
            ViewBag.Cate    = DropDownHelper.GetCate(entity.CateNum, this.CompanyID);
            ViewBag.Storage = DropDownHelper.GetStorage(entity.StorageNum, this.CompanyID);
            return(View());
        }
Esempio n. 2
0
 public ActionResult List()
 {
     ViewBag.Cate = DropDownHelper.GetCate(string.Empty, this.CompanyID);
     return(View());
 }