public ActionResult AddSupplier()
 {
     string SupNum = WebUtil.GetQueryStringValue<string>("SupNum");
     if (SupNum.IsEmpty())
     {
         ViewBag.Supplier = new SupplierEntity();
         ViewBag.SupType = EnumHelper.GetOptions<ESupType>((int)ESupType.Invented, "请选择供应商类型");
         return View();
     }
     else
     {
         SupplierProvider provider = new SupplierProvider();
         SupplierEntity entity = provider.GetSupplier(SupNum);
         entity = entity == null ? new SupplierEntity() : entity;
         ViewBag.SupType = EnumHelper.GetOptions<ESupType>(entity.SupType,"请选择供应商类型");
         ViewBag.Supplier = entity;
         return View();
     }
 }
        public ActionResult SupplierReportTOP10()
        {
            int queryTime = WebUtil.GetFormValue<int>("QueryTime", 0);
            int pageIndex = 1;
            int pageSize = 10;
            string storageNum = this.DefaultStore;

            InStorageProvider provider = new InStorageProvider();
            PageInfo pageInfo = new PageInfo() { PageIndex = pageIndex, PageSize = pageSize };

            List<InStorageEntity> listResult = provider.GetListTOP10(queryTime, storageNum);
            listResult = listResult.IsNull() ? new List<InStorageEntity>() : listResult;
            SupplierProvider cusProvider = new SupplierProvider();
            foreach (InStorageEntity item in listResult)
            {
                SupplierEntity tempItem = cusProvider.GetSupplier(item.SupNum);
                item.SupName = tempItem.SupName;
                item.Description = tempItem.Description;
            }
            /*******************************************订单数量排名前十的供应商饼图数据****************************************************/
            StringBuilder sb = new StringBuilder();
            sb.Append("<pie>");
            listResult.ForEach(a =>
            {
                if (a.Num > 0)
                {
                    sb.AppendFormat("<slice title=\"{0}\">{1}</slice>", a.SupName, a.Num.ToString());
                }
            });
            sb.Append("</pie>");
            this.ReturnJson.AddProperty("InStorageData", sb.ToString());
            string json = ConvertJson.ListToJson<InStorageEntity>(listResult, "List");
            this.ReturnJson.AddProperty("Data", new JsonObject(json));
            this.ReturnJson.AddProperty("RowCount", pageInfo.RowCount);
            return Content(this.ReturnJson.ToString());
        }