private void BindImageData() { int type = Globals.RequestQueryNum("type"); this.pageIndex = this.pager.PageIndex; this.orderby = Globals.RequestQueryNum("orderby"); switch (this.orderby) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: this.ImageOrder.SelectedValue = new int?(this.orderby); break; } PhotoListOrder order = (PhotoListOrder)Enum.ToObject(typeof(PhotoListOrder), this.orderby); DbQueryResult result = GalleryHelper.GetPhotoList(this.keyWordIName, this.typeId, this.pageIndex, order, type, 0x12); this.rptList.DataSource = result.Data; this.rptList.DataBind(); this.pager.TotalRecords = result.TotalRecords; this.lblImageData.Text = this.pager.TotalRecords.ToString(); }
public string GetImgTypeJson(int type) { StringBuilder builder = new StringBuilder(); DataTable photoCategories = null; if (type == 3) { IList <CategoryInfo> mainCategories = CatalogHelper.GetMainCategories(); for (int i = 0; i < mainCategories.Count; i++) { builder.Append("{"); builder.Append("\"name\":\"" + mainCategories[i].Name + "\","); builder.Append("\"parent_id\":" + mainCategories[i].ParentCategoryId + ","); builder.Append("\"id\":" + mainCategories[i].CategoryId + ","); builder.Append("\"picNum\":" + ProductHelper.GetProductsImgList(this.GetProductQuery(mainCategories[i].CategoryId)).TotalRecords); builder.Append("},"); } } else { photoCategories = GalleryHelper.GetPhotoCategories(type); for (int j = 0; j < photoCategories.Rows.Count; j++) { builder.Append("{"); builder.Append("\"name\":\"" + photoCategories.Rows[j]["CategoryName"] + "\","); builder.Append("\"parent_id\":0,"); builder.Append("\"id\":" + photoCategories.Rows[j]["CategoryId"] + ","); builder.Append("\"picNum\":" + GalleryHelper.GetPhotoList("", new int?(Convert.ToInt32(photoCategories.Rows[j]["CategoryId"])), 10, PhotoListOrder.UploadTimeDesc, type, 20).TotalRecords); builder.Append("},"); } } return(builder.ToString().TrimEnd(new char[] { ',' })); }
public string GetListJson(HttpContext context) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("{\"status\":1,"); stringBuilder.Append("\"data\":["); int num = 1; PhotoListOrder order = PhotoListOrder.UpdateTimeDesc; if (!string.IsNullOrEmpty(context.Request.Form["sortby"])) { order = (PhotoListOrder)Enum.Parse(typeof(PhotoListOrder), context.Request.Form["sortby"]); } int supplierId = 0; if (!string.IsNullOrEmpty(context.Request.Form["supplierId"])) { supplierId = context.Request.Form["supplierId"].ToInt(0); } DbQueryResult photoList = GalleryHelper.GetPhotoList(context.Request.Form["file_Name"], context.Request.Form["id"].ToInt(0), context.Request.Form["p"].ToInt(0), 36, order, supplierId); int pageCount = TemplatePageControl.GetPageCount(photoList.TotalRecords, 36); stringBuilder.Append(this.GetImgItemsJson(photoList, context)); string str = stringBuilder.ToString().TrimEnd(','); str += "],"; str = str + "\"page\": \"" + this.GetPageHtml(pageCount, context) + "\","; str += "\"msg\": \"\""; return(str + "}"); }
public string GetTreeListJson(HttpContext context) { try { int supplierId = 0; if (!string.IsNullOrEmpty(context.Request.Form["supplierId"])) { supplierId = context.Request.Form["supplierId"].ToInt(0); } StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("{\"status\":1,"); stringBuilder.Append("\"data\":{"); stringBuilder.Append("\"total\":" + GalleryHelper.GetPhotoList("", 0, 10, PhotoListOrder.UploadTimeDesc, supplierId).TotalRecords + ","); stringBuilder.Append("\"tree\":["); stringBuilder.Append(this.GetImgTypeJson(supplierId)); stringBuilder.Append("]"); stringBuilder.Append("},"); stringBuilder.Append("\"msg\":\"\""); stringBuilder.Append("}"); return(stringBuilder.ToString()); } catch (Exception ex) { NameValueCollection param = new NameValueCollection { context.Request.Form, context.Request.QueryString }; Globals.WriteExceptionLog_Page(ex, param, "GetTreeListJson"); return(""); } }
public string GetListJson(System.Web.HttpContext context) { int num = 21; System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); stringBuilder.Append("{\"status\":1,"); stringBuilder.Append("\"data\":["); int num2 = Globals.RequestFormNum("type"); int num3 = Globals.RequestFormNum("id"); string keyword = Globals.RequestFormStr("file_name"); int pageCount; if (num2 == 3) { DbQueryResult goodsTable = this.GetGoodsTable(context, num, keyword, num3); pageCount = TemplatePageControl.GetPageCount(goodsTable.TotalRecords, num); stringBuilder.Append(this.GetGoodsListJson(goodsTable)); } else { DbQueryResult photoList = GalleryHelper.GetPhotoList(keyword, new int?(num3), System.Convert.ToInt32(context.Request.Form["p"]), num, PhotoListOrder.UploadTimeDesc, num2); pageCount = TemplatePageControl.GetPageCount(photoList.TotalRecords, num); stringBuilder.Append(this.GetImgItemsJson(photoList, context)); } string str = stringBuilder.ToString().TrimEnd(new char[] { ',' }); str += "],"; str = str + "\"page\": \"" + this.GetPageHtml(pageCount, context) + "\","; str += "\"msg\": \"\""; return(str + "}"); }
public string GetListJson(HttpContext context) { int pagesize = 0x15; StringBuilder builder = new StringBuilder(); builder.Append("{\"status\":1,"); builder.Append("\"data\":["); int type = Globals.RequestFormNum("type"); int maincategoryid = Globals.RequestFormNum("id"); string keyword = Globals.RequestFormStr("file_name"); int pageCount = 0; if (type == 3) { DbQueryResult goodsTable = this.GetGoodsTable(context, pagesize, keyword, maincategoryid); pageCount = TemplatePageControl.GetPageCount(goodsTable.TotalRecords, pagesize); builder.Append(this.GetGoodsListJson(goodsTable)); } else { DbQueryResult mamagerRecordset = GalleryHelper.GetPhotoList(keyword, new int?(maincategoryid), Convert.ToInt32(context.Request.Form["p"]), pagesize, PhotoListOrder.UploadTimeDesc, type); pageCount = TemplatePageControl.GetPageCount(mamagerRecordset.TotalRecords, pagesize); builder.Append(this.GetImgItemsJson(mamagerRecordset, context)); } return(((builder.ToString().TrimEnd(new char[] { ',' }) + "],") + "\"page\": \"" + this.GetPageHtml(pageCount, context) + "\",") + "\"msg\": \"\"" + "}"); }
private int GetImgCount(int type) { if (type == 3) { return(ProductHelper.GetProductsImgList(this.GetProductQuery(0)).TotalRecords); } return(GalleryHelper.GetPhotoList("", 0, 10, PhotoListOrder.UploadTimeDesc, type, 20).TotalRecords); }
private void BindImageData() { this.pageIndex = this.pager.PageIndex; PhotoListOrder order = PhotoListOrder.UploadTimeDesc; DbQueryResult photoList = GalleryHelper.GetPhotoList(this.keyWordIName, this.typeId, this.pageIndex, order, 0, 20); this.photoDataList.DataSource = photoList.Data; this.photoDataList.DataBind(); this.pager.TotalRecords = photoList.TotalRecords; }
public string GetListJson(HttpContext context) { StringBuilder builder = new StringBuilder(); builder.Append("{\"status\":1,"); builder.Append("\"data\":["); DbQueryResult mamagerRecordset = GalleryHelper.GetPhotoList(context.Request.Form["file_Name"], new int?(Convert.ToInt32(context.Request.Form["id"])), Convert.ToInt32(context.Request.Form["p"]), 0x1c, PhotoListOrder.UploadTimeDesc); int pageCount = TemplatePageControl.GetPageCount(mamagerRecordset.TotalRecords, 0x1c); builder.Append(this.GetImgItemsJson(mamagerRecordset, context)); return(((builder.ToString().TrimEnd(new char[] { ',' }) + "],") + "\"page\": \"" + this.GetPageHtml(pageCount, context) + "\",") + "\"msg\": \"\"" + "}"); }
private int GetImgCount(int type) { int totalRecords; if (type == 3) { totalRecords = ProductHelper.GetProductsImgList(this.GetProductQuery(0)).TotalRecords; } else { totalRecords = GalleryHelper.GetPhotoList("", new int?(0), 10, PhotoListOrder.UploadTimeDesc, type, 20).TotalRecords; } return(totalRecords); }
public string GetTreeListJson() { StringBuilder builder = new StringBuilder(); builder.Append("{\"status\":1,"); builder.Append("\"data\":{"); builder.Append("\"total\":" + GalleryHelper.GetPhotoList("", 0, 10, PhotoListOrder.UploadTimeDesc).TotalRecords + ","); builder.Append("\"tree\":["); builder.Append(this.GetImgTypeJson()); builder.Append("]"); builder.Append("},"); builder.Append("\"msg\":\"\""); builder.Append("}"); return(builder.ToString()); }
private DataGridViewModel <Dictionary <string, object> > GetListPhoto(string keyWordName, int typeId, int pageIndex, int pageSize, PhotoListOrder enumOrd) { DataGridViewModel <Dictionary <string, object> > dataGridViewModel = new DataGridViewModel <Dictionary <string, object> >(); DbQueryResult photoList = GalleryHelper.GetPhotoList(keyWordName, typeId, pageIndex, pageSize, enumOrd, 0); List <Dictionary <string, object> > list = DataHelper.DataTableToDictionary(photoList.Data); foreach (Dictionary <string, object> item in list) { PhotoGalleryInfo photoGalleryInfo = item.ToObject <PhotoGalleryInfo>(); item.Add("Globals", Globals.GetImageServerUrl()); item.Add("SubPhotoName", GalleryHelper.TruncStr(photoGalleryInfo.PhotoName, 20)); } dataGridViewModel.rows = list; dataGridViewModel.total = photoList.TotalRecords; return(dataGridViewModel); }
public string MoveImgByFolder(HttpContext context) { DbQueryResult result = GalleryHelper.GetPhotoList("", new int?(Convert.ToInt32(context.Request.Form["cid"])), 1, 0x5f5e100, PhotoListOrder.UploadTimeDesc); List <int> pList = new List <int>(); DataTable data = (DataTable)result.Data; for (int i = 0; i < data.Rows.Count; i++) { pList.Add(Convert.ToInt32(data.Rows[i]["PhotoId"])); } if (GalleryHelper.MovePhotoType(pList, Convert.ToInt32(context.Request.Form["cate_id"])) > 0) { return("{\"status\":1,\"msg\":\"\"}"); } return("{\"status\":0,\"msg\":\"请选择一个分类\"}"); }
public string MoveImgByFolder(System.Web.HttpContext context) { DbQueryResult photoList = GalleryHelper.GetPhotoList("", new int?(System.Convert.ToInt32(context.Request.Form["cid"])), 1, 100000000, PhotoListOrder.UploadTimeDesc, 0); System.Collections.Generic.List <int> list = new System.Collections.Generic.List <int>(); System.Data.DataTable dataTable = (System.Data.DataTable)photoList.Data; for (int i = 0; i < dataTable.Rows.Count; i++) { list.Add(System.Convert.ToInt32(dataTable.Rows[i]["PhotoId"])); } if (GalleryHelper.MovePhotoType(list, System.Convert.ToInt32(context.Request.Form["cate_id"])) > 0) { return("{\"status\":1,\"msg\":\"\"}"); } return("{\"status\":0,\"msg\":\"请选择一个分类\"}"); }
private void BindImageData() { this.pageIndex = this.pager.PageIndex; PhotoListOrder uploadTimeDesc = PhotoListOrder.UploadTimeDesc; if (this.enumOrder.HasValue) { uploadTimeDesc = (PhotoListOrder)Enum.ToObject(typeof(PhotoListOrder), this.enumOrder.Value); } DbQueryResult result = GalleryHelper.GetPhotoList(this.keyWordIName, this.typeId, this.pageIndex, uploadTimeDesc); this.photoDataList.DataSource = result.Data; this.photoDataList.DataBind(); this.pager.TotalRecords = result.TotalRecords; this.lblImageData.Text = "共" + this.pager.TotalRecords + "张"; }
public string GetImgTypeJson() { string str = ""; DataTable photoCategories = GalleryHelper.GetPhotoCategories(); for (int i = 0; i < photoCategories.Rows.Count; i++) { object obj2 = str + "{"; object obj3 = string.Concat(new object[] { obj2, "\"name\":\"", photoCategories.Rows[i]["CategoryName"], "\"," }) + "\"parent_id\":0,"; str = (string.Concat(new object[] { obj3, "\"id\":", photoCategories.Rows[i]["CategoryId"], "," }) + "\"picNum\":" + GalleryHelper.GetPhotoList("", new int?(Convert.ToInt32(photoCategories.Rows[i]["CategoryId"])), 10, PhotoListOrder.UploadTimeDesc).TotalRecords) + "},"; } return(str.TrimEnd(new char[] { ',' })); }