public HttpResponseBase QueryProListForAddSta() { string json = string.Empty; try { QueryVerifyCondition query = new QueryVerifyCondition(); #region 查询条件填充 query.IsPage = true; query.Start = int.Parse(Request.Form["start"] ?? "0"); if (!string.IsNullOrEmpty(Request.Form["limit"])) { query.Limit = Convert.ToInt32(Request.Form["limit"]); } if (!string.IsNullOrEmpty(Request.Form["brand_id"])) { query.brand_id = uint.Parse(Request.Form["brand_id"]); } if (!string.IsNullOrEmpty(Request.Form["comboProCate_hide"])) { query.cate_id = Request.Form["comboProCate_hide"].Trim(); } if (!string.IsNullOrEmpty(Request.Form["comboFrontCage_hide"])) { query.category_id = uint.Parse(Request.Form["comboFrontCage_hide"]); query.category_id = query.category_id == 2 ? 0 : query.category_id; } if (!string.IsNullOrEmpty(Request.Form["combination"])) { query.combination = int.Parse(Request.Form["combination"]); } if (!string.IsNullOrEmpty(Request.Form["product_status"])) { query.product_status = int.Parse(Request.Form["product_status"]); } if (!string.IsNullOrEmpty(Request.Form["product_freight_set"])) { query.freight = uint.Parse(Request.Form["product_freight_set"]); } if (!string.IsNullOrEmpty(Request.Form["product_mode"])) { query.mode = uint.Parse(Request.Form["product_mode"]); } if (!string.IsNullOrEmpty(Request.Form["tax_type"])) { query.tax_type = uint.Parse(Request.Form["tax_type"]); } query.date_type = Request.Form["date_type"] ?? ""; if (!string.IsNullOrEmpty(Request.Form["time_start"])) { query.time_start = CommonFunction.GetPHPTime(Convert.ToDateTime(Request.Form["time_start"]).ToString("yyyy/MM/dd 00:00:00")).ToString(); } if (!string.IsNullOrEmpty(Request.Form["time_end"])) { query.time_end = CommonFunction.GetPHPTime(Convert.ToDateTime(Request.Form["time_end"]).ToString("yyyy/MM/dd 23:59:59")).ToString(); } query.name_number = Request.Form["key"] ?? ""; if (query.price_check) { if (!string.IsNullOrEmpty(Request.Form["site_id"])) { query.site_id = uint.Parse(Request.Form["site_id"]); } if (!string.IsNullOrEmpty(Request.Form["user_level"])) { query.user_level = uint.Parse(Request.Form["user_level"]); } if (!string.IsNullOrEmpty(Request.Form["price_status"])) { query.price_status = uint.Parse(Request.Form["price_status"]); } } if (!string.IsNullOrEmpty(Request.Form["price_type"])) { query.price_type = int.Parse(Request.Form["price_type"]); } #endregion _prodMgr = new ProductMgr(connectionString); int totalCount = 0; List<QueryandVerifyCustom> pros = _prodMgr.QueryForStation(query, out totalCount); foreach (var item in pros) { if (item.product_image != "") { item.product_image = imgServerPath + prod50Path + GetDetailFolder(item.product_image) + item.product_image; } else { item.product_image = defaultImg; } } json = "{succes:true,totalCount:" + totalCount + ",item:" + JsonConvert.SerializeObject(pros) + "}"; } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); json = "{succes:true,totalCount:0,item:[]}"; } this.Response.Clear(); this.Response.Write(json); this.Response.End(); return this.Response; }
public HttpResponseBase QueryProListForAddSta() { string json = string.Empty; try { QueryVerifyCondition query = new QueryVerifyCondition(); #region 查询条件填充 query.IsPage = true; query.Start = int.Parse(Request.Form["start"] ?? "0"); if (!string.IsNullOrEmpty(Request.Form["limit"])) { query.Limit = Convert.ToInt32(Request.Form["limit"]); } if (!string.IsNullOrEmpty(Request.Form["brand_id"])) { query.brand_id = uint.Parse(Request.Form["brand_id"]); } if (!string.IsNullOrEmpty(Request.Form["comboProCate_hide"])) { query.cate_id = Request.Form["comboProCate_hide"].Trim(); } if (!string.IsNullOrEmpty(Request.Form["comboFrontCage_hide"])) { query.category_id = uint.Parse(Request.Form["comboFrontCage_hide"]); query.category_id = query.category_id == 2 ? 0 : query.category_id; } if (!string.IsNullOrEmpty(Request.Form["combination"])) { query.combination = int.Parse(Request.Form["combination"]); } if (!string.IsNullOrEmpty(Request.Form["product_status"])) { query.product_status = int.Parse(Request.Form["product_status"]); } if (!string.IsNullOrEmpty(Request.Form["product_freight_set"])) { query.freight = uint.Parse(Request.Form["product_freight_set"]); } if (!string.IsNullOrEmpty(Request.Form["product_mode"])) { query.mode = uint.Parse(Request.Form["product_mode"]); } if (!string.IsNullOrEmpty(Request.Form["tax_type"])) { query.tax_type = uint.Parse(Request.Form["tax_type"]); } query.date_type = Request.Form["date_type"] ?? ""; if (!string.IsNullOrEmpty(Request.Form["time_start"])) { query.time_start = CommonFunction.GetPHPTime(Convert.ToDateTime(Request.Form["time_start"]).ToString("yyyy/MM/dd HH:mm:ss")).ToString(); } if (!string.IsNullOrEmpty(Request.Form["time_end"])) { query.time_end = CommonFunction.GetPHPTime(Convert.ToDateTime(Request.Form["time_end"]).ToString("yyyy/MM/dd HH:mm:ss")).ToString(); } query.name_number = Request.Form["key"] ?? ""; //增加查詢值 按鈕選中 add by zhuoqin0830w 2015/02/10 if (!string.IsNullOrEmpty(Request.Form["priceCondition"])) { query.priceCondition = int.Parse(Request.Form["priceCondition"]); } //add by zhuoqin0830w 2015/03/11 已買斷商品的篩選功能 if (!string.IsNullOrEmpty(Request.Form["productPrepaid"])) { query.Prepaid = int.Parse(Request.Form["productPrepaid"]); } #endregion _prodMgr = new ProductMgr(connectionString); int totalCount = 0; List<QueryandVerifyCustom> pros = _prodMgr.QueryForStation(query, out totalCount); pros.ForEach(p => p.CanDo = p.product_id.ToString().Length > 4 ? "0" : "1");//edit by xiangwang 2014/09/11 foreach (var item in pros) { if (item.product_image != "") { item.product_image = imgServerPath + prod50Path + GetDetailFolder(item.product_image) + item.product_image; } else { item.product_image = defaultImg; } item.product_name = item.product_name.Replace(Product.L_KH + item.prod_sz + Product.R_KH, ""); } json = "{succes:true,totalCount:" + totalCount + ",item:" + JsonConvert.SerializeObject(pros) + "}"; } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); json = "{succes:true,totalCount:0,item:[]}"; } this.Response.Clear(); this.Response.Write(json); this.Response.End(); return this.Response; }