//public HttpResponseBase PromoAdditionalPriceList() //{ // PromoAdditionalPriceQuery query = new PromoAdditionalPriceQuery(); // List<PromoAdditionalPriceQuery> store = new List<PromoAdditionalPriceQuery>(); // string json = string.Empty; // try // { // query.Start = Convert.ToInt32(Request.Params["start"] ?? "0"); // if (!string.IsNullOrEmpty(Request.Params["limit"])) // { // query.Limit = Convert.ToInt32(Request.Params["limit"]); // } // if (!string.IsNullOrEmpty(Request.Params["ddlSel"])) // { // query.expired = Convert.ToInt32(Request.Params["ddlSel"]); // } // query.event_type = Request.Params["event_type"]; // _promoadditionproceMgr = new PromoAdditionalPriceMgr(mySqlConnectionString); // int totalCount = 0; // store = _promoadditionproceMgr.Query(query, out totalCount); // IsoDateTimeConverter timeConverter = new IsoDateTimeConverter(); // //这里使用自定义日期格式,如果不使用的话,默认是ISO8601格式 // timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; // foreach (var item in store) // { // if (item.banner_image != "") // { // item.banner_image = imgServerPath + promoPath + item.banner_image; // } // else // { // item.banner_image = defaultImg; // } // } // json = "{success:true,totalCount:" + totalCount + ",data:" + JsonConvert.SerializeObject(store, Formatting.Indented, timeConverter) + "}";//返回json數據 // } // 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 = "{success:false,totalCount:0,data:[]}"; // } // this.Response.Clear(); // this.Response.Write(json); // this.Response.End(); // return this.Response; //} #endregion #region 不同商品固定價 同品加固定價 不同品加不同價格 刪除+HttpResponseBase PromoAdditionalPriceDelete() public HttpResponseBase PromoAdditionalPriceDelete() { PromoAdditionalPrice pap = new PromoAdditionalPrice(); string jsonStr = String.Empty; _promoadditionproceMgr = new PromoAdditionalPriceMgr(mySqlConnectionString); if (!String.IsNullOrEmpty(Request.Params["rowID"])) { try { foreach (string rid in Request.Params["rowID"].ToString().Split('|')) { if (rid != null) { int id = 0; try { id = Convert.ToInt32(rid); } catch (Exception) { } pap = _promoadditionproceMgr.GetModel(id); var eventid = CommonFunction.GetEventId(pap.event_type, pap.id.ToString()); if (!string.IsNullOrEmpty(rid)) { if (_promoadditionproceMgr.Delete(Convert.ToInt32(rid), eventid) > 0) { jsonStr = "{success:true}"; } else { jsonStr = "{success:false}"; } } } } jsonStr = "{success:true}"; } 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); jsonStr = "{success:false}"; } } this.Response.Clear(); this.Response.Write(jsonStr); this.Response.End(); return this.Response; }