protected void Page_Load(object sender, EventArgs e) { int storeId = HiContext.Current.Manager.StoreId; string storeSlideImagesByStoreId = DepotHelper.GetStoreSlideImagesByStoreId(storeId); this.hidOldImages.Value = storeSlideImagesByStoreId; IList <StoreFloorInfo> storeFloorList = StoresHelper.GetStoreFloorList(storeId, FloorClientType.O2OApplet); int pageIndex = 1; int pageSize = 1000000000; DbQueryResult showProductList = WeChartAppletHelper.GetShowProductList(0, pageIndex, pageSize, storeId, ProductType.ServiceProduct); DataTable data = showProductList.Data; StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < data.Rows.Count; i++) { if (stringBuilder.Length > 0) { stringBuilder.Insert(0, data.Rows[i]["ProductId"] + "|||" + data.Rows[i]["ProductName"] + ",,,"); } else { stringBuilder.Append(data.Rows[i]["ProductId"] + "|||" + data.Rows[i]["ProductName"]); } } this.hidSelectProducts.Value = stringBuilder.ToString(); this.lkbAddAppletFloor.Click += this.lkbAddAppletFloor_Click; }
private DataGridViewModel<Dictionary<string, object>> GetDataList(HttpContext context) { DataGridViewModel<Dictionary<string, object>> dataGridViewModel = new DataGridViewModel<Dictionary<string, object>>(); int num = 1; int num2 = 10; num = context.Request["page"].ToInt(0); if (num < 1) { num = 1; } num2 = context.Request["rows"].ToInt(0); if (num2 < 1) { num2 = 10; } DbQueryResult showProductList = WeChartAppletHelper.GetShowProductList(0, num, num2, 0, ProductType.PhysicalProduct); dataGridViewModel.rows = DataHelper.DataTableToDictionary(showProductList.Data); dataGridViewModel.total = showProductList.TotalRecords; foreach (Dictionary<string, object> row in dataGridViewModel.rows) { ProductInfo productInfo = row.ToObject<ProductInfo>(); if (productInfo.ProductName.Length >= 26) { row.Add("SubProductName", productInfo.ProductName.Substring(0, 26) + "..."); } else { row.Add("SubProductName", productInfo.ProductName); } if (string.IsNullOrEmpty(productInfo.ThumbnailUrl160)) { row["ThumbnailUrl160"] = base.CurrentSiteSetting.DefaultProductThumbnail1; } } return dataGridViewModel; }