public HttpResponseBase QuerySingleProPrice() { string json = string.Empty; _priceMasterMgr = new PriceMasterMgr(connectionString); if (!string.IsNullOrEmpty(Request.Params["product_id"])) { try { if (int.Parse(Request.Params["Price_type"]) == 2) { var singleList = new List<SelfSingleProductPrice>(); singleList = _priceMasterMgr.SingleProductPriceQuery(uint.Parse(Request.Params["product_id"])); json = "{data:" + JsonConvert.SerializeObject(singleList) + "}"; } else { var singleList = new List<SingleProductPrice>(); singleList = _priceMasterMgr.SingleProductPriceQuery(uint.Parse(Request.Params["product_id"]), int.Parse(Request.Params["pile_id"])); json = "{data:" + JsonConvert.SerializeObject(singleList) + "}"; } } 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 = "[]"; } } this.Response.Clear(); this.Response.Write(json); this.Response.End(); return this.Response; }
public HttpResponseBase QuerySingleProPrice() { string json = string.Empty; try { if (!string.IsNullOrEmpty(Request.Params["product_id"])) { uint product_id = 0; if (uint.TryParse(Request.Form["product_id"], out product_id)) //正式表數據 { _priceMasterMgr = new PriceMasterMgr(connectionString); List<SingleProductPrice> singleList = _priceMasterMgr.SingleProductPriceQuery(uint.Parse(Request.Params["product_id"]), int.Parse(Request.Params["pile_id"])); json = "{data:" + JsonConvert.SerializeObject(singleList) + "}"; } else//臨時表數據處理 { _pMasterTempMgr = new PriceMasterTempMgr(connectionString); List<SingleProductPriceTemp> singleList = _pMasterTempMgr.SingleProductPriceQueryByVendor(Request.Params["product_id"], int.Parse(Request.Params["pile_id"])); json = "{data:" + JsonConvert.SerializeObject(singleList) + "}"; } } } 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 = "[]"; } this.Response.Clear(); this.Response.Write(json); this.Response.End(); return this.Response; }