当前位置: 首页>>代码示例>>C#>>正文


C# JsonObject.AddProperty方法代码示例

本文整理汇总了C#中JsonObject.AddProperty方法的典型用法代码示例。如果您正苦于以下问题:C# JsonObject.AddProperty方法的具体用法?C# JsonObject.AddProperty怎么用?C# JsonObject.AddProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JsonObject的用法示例。


在下文中一共展示了JsonObject.AddProperty方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AutoProduct

 public ActionResult AutoProduct(string productName)
 {
     ProductProvider provider = new ProductProvider();
     List<ProductEntity> list = provider.GetListByCache();
     if (!list.IsNullOrEmpty() && !productName.IsEmpty())
     {
         list = list.Where(a => a.ProductName.Contains(productName) || a.BarCode.Contains(productName) || a.SnNum.Contains(productName)).ToList();
     }
     list = list.IsNull() ? new List<ProductEntity>() : list;
     StringBuilder sb = new StringBuilder();
     JsonObject jsonObject = null;
     foreach (ProductEntity t in list)
     {
         jsonObject = new JsonObject();
         jsonObject.AddProperty("BarCode", t.BarCode);
         jsonObject.AddProperty("ProductName", t.ProductName);
         jsonObject.AddProperty("SnNum", t.SnNum);
         jsonObject.AddProperty("CateNum", t.CateNum);
         jsonObject.AddProperty("CateName", t.CateName);
         jsonObject.AddProperty("InPrice", t.InPrice);
         jsonObject.AddProperty("Unit", t.UnitNum);
         jsonObject.AddProperty("UnitName", t.UnitName);
         jsonObject.AddProperty("Size", t.Size);
         jsonObject.AddProperty("Num", t.Num);
         sb.Append(jsonObject.ToString() + "\n");
     }
     if (sb.Length == 0)
     {
         sb.Append("\n");
     }
     return Content(sb.ToString());
 }
开发者ID:ZhangHanLong,项目名称:gitwms,代码行数:32,代码来源:GoodsAjaxController.cs

示例2: Auto

 public ActionResult Auto(string supName)
 {
     SupplierProvider provider = new SupplierProvider();
     List<SupplierEntity> list = provider.GetList();
     if (!list.IsNullOrEmpty() && !supName.IsEmpty())
     {
         list = list.Where(a => a.SupNum.Contains(supName) || a.SupName.Contains(supName)).ToList();
     }
     list = list.IsNull() ? new List<SupplierEntity>() : list;
     StringBuilder sb = new StringBuilder();
     JsonObject jsonObject = null;
     foreach (SupplierEntity t in list)
     {
         jsonObject = new JsonObject();
         jsonObject.AddProperty("SupNum", t.SupNum);
         jsonObject.AddProperty("SupName", t.SupName);
         jsonObject.AddProperty("ContactName", t.ContactName);
         jsonObject.AddProperty("Phone", t.Phone);
         sb.Append(jsonObject.ToString() + "\n");
     }
     if (sb.Length == 0)
     {
         sb.Append("\n");
     }
     return Content(sb.ToString());
 }
开发者ID:ZhangHanLong,项目名称:gitwms,代码行数:26,代码来源:SupplierAjaxController.cs

示例3: SetJsonProperties

        protected override void SetJsonProperties(JsonObject json)
        {
            if (json == null) throw new ArgumentNullException("json");

            json.AddProperty("v", new GoogleValue(DataType, Value));
            if (Formatted != null) json.AddProperty("f", Formatted);
        }
开发者ID:paultyng,项目名称:GoogleVisualization,代码行数:7,代码来源:GoogleDataTable.cs

示例4: AutoOrder

        public ActionResult AutoOrder(string productName)
        {
            string orderNum = WebUtil.GetFormValue<string>("orderNum", string.Empty);
            PageInfo page = new PageInfo { PageIndex = 1, PageSize = 5 };
            Bill<OrdersEntity, OrderDetailEntity> bill = new OrderBill();
            OrdersEntity entity = new OrdersEntity();
            if (orderNum != string.Empty)
            {
                entity.Where("OrderNum", ECondition.Like, "%" + orderNum + "%");
            }
            entity.Where(a => a.AuditeStatus == (int)EAudite.Pass).And(a => a.Status != (int)EOrderStatus.AllDelivery);
            List<OrdersEntity> list = bill.GetList(entity, ref page);

            list = list.IsNull() ? new List<OrdersEntity>() : list;
            StringBuilder sb = new StringBuilder();
            JsonObject jsonObject = null;
            foreach (OrdersEntity t in list)
            {
                jsonObject = new JsonObject();
                jsonObject.AddProperty("OrderNum", t.OrderNum);
                jsonObject.AddProperty("CusName", t.CusName);
                sb.Append(jsonObject.ToString() + "\n");
            }
            if (sb.Length == 0)
            {
                sb.Append("\n");
            }
            return Content(sb.ToString());
        }
开发者ID:ZhangHanLong,项目名称:gitwms,代码行数:29,代码来源:ProductAjaxController.cs

示例5: AutoSinProduct

 public ActionResult AutoSinProduct(string ProductNum)
 {
     ProductProvider provider = new ProductProvider();
     List<ProductEntity> list = provider.GetListByCache();
     ProductEntity entity = null;
     if (!list.IsNullOrEmpty() && !ProductNum.IsEmpty())
     {
         entity = list.FirstOrDefault(a => a.SnNum == ProductNum);
     }
     entity = entity.IsNull() ? new ProductEntity() : entity;
     List<ProductEntity> listSource = new List<ProductEntity>();
     listSource.Add(entity);
     StringBuilder sb = new StringBuilder();
     JsonObject jsonObject = null;
     foreach (ProductEntity t in listSource)
     {
         jsonObject = new JsonObject();
         jsonObject.AddProperty("BarCode", t.BarCode);
         jsonObject.AddProperty("ProductName", t.ProductName);
         jsonObject.AddProperty("SnNum", t.SnNum);
         jsonObject.AddProperty("CateNum", t.CateNum);
         jsonObject.AddProperty("CateName", t.CateName);
         jsonObject.AddProperty("InPrice", t.InPrice);
         jsonObject.AddProperty("Unit", t.UnitNum);
         jsonObject.AddProperty("UnitName", t.UnitName);
         jsonObject.AddProperty("Size", t.Size.Escape());
         jsonObject.AddProperty("Num", t.Num);
         sb.Append(jsonObject.ToString() + "\n");
     }
     if (sb.Length == 0)
     {
         sb.Append("\n");
     }
     return Content(sb.ToString());
 }
开发者ID:ZhangHanLong,项目名称:gitwms,代码行数:35,代码来源:GoodsAjaxController.cs

示例6: SetJsonProperties

 protected override void SetJsonProperties(JsonObject json)
 {
     json.AddProperty("v", new GoogleValue(DataType, Value));
     if (Formatted != null) json.AddProperty("f", Formatted);
 }
开发者ID:Thinking-Beard,项目名称:civilsalary,代码行数:5,代码来源:GoogleDataTable.cs


注:本文中的JsonObject.AddProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。