public ActionResult SavePromoAmountDiscount()
        {
            try
            {
                string promoAmountDiscountStr = Request.Params["promoAmountDiscountStr"];
                string promoDiscountDetailStr = Request.Params["promoDiscountDetailStr"];
                string condiType = Request.Params["condiType"];
                EventPromoAmountDiscount promoAmountGiftModel = JsonConvert.DeserializeObject<EventPromoAmountDiscount>(promoAmountDiscountStr);
                List<EventPromoDiscount> promoDetails = JsonConvert.DeserializeObject<List<EventPromoDiscount>>(promoDiscountDetailStr);
                iepaDiscountMgr = new EventPromoAmountDiscountMgr(mySqlConnectionString);
                return Json(new { success = iepaDiscountMgr.SavePromoAmountDiscount(promoAmountGiftModel, promoDetails, condiType) });
            }
            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);
                return Json(new { success = false });
            }

        }
        public JsonResult UpdateActiveDiscount()
        {
            try
            {
                int currentUser = (System.Web.HttpContext.Current.Session["caller"] as Caller).user_id;
                int activeValue = Convert.ToInt32(Request.Params["active"]);
                if (Convert.ToInt32(Request.Params["mo_user"]) == currentUser && activeValue == 1)
                {
                    return Json(new { success = "stop" });
                }
                else
                {


                    string event_id = Request.Params["event_id"].ToString();
                    EventPromoAmountDiscount model = new EventPromoAmountDiscount();
                    model.modify_user = currentUser;
                    model.modify_time = DateTime.Now;
                    model.event_id = event_id;
                    model.event_status = activeValue;
                    model.condition_type = Convert.ToInt32(Request.Params["type"]);
                    iepaDiscountMgr = new EventPromoAmountDiscountMgr(mySqlConnectionString);

                    if (iepaDiscountMgr.UpdateActive(model))
                    {
                        return Json(new { success = "true" });
                    }
                    else
                    {
                        return Json(new { success = "false" });
                    }
                }
            }
            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);
                return Json(new { success = "false" });
            }

        }
        public HttpResponseBase GetPromoAmountDiscount()
        {
            string jsonStr = "{success:false}";
            try
            {
                EventPromoAmountDiscountQuery query = new EventPromoAmountDiscountQuery();
                query.Start = Convert.ToInt32(Request.Params["start"] ?? "0");
                query.Limit = Convert.ToInt32(Request.Params["limit"] ?? "0");

                if (!string.IsNullOrEmpty(Request.Params["event_id"]))
                {
                    query.event_id = Request.Params["event_id"];
                }
                if (!string.IsNullOrEmpty(Request.Params["event_name"]))
                {
                    query.event_name = Request.Params["event_name"];
                }
                int totalCount = 0;

                iepaDiscountMgr = new EventPromoAmountDiscountMgr(mySqlConnectionString);
                List<EventPromoAmountDiscountQuery> _list = iepaDiscountMgr.GetList(query, out totalCount);

                IsoDateTimeConverter timeConverter = new IsoDateTimeConverter();
                //这里使用自定义日期格式,如果不使用的话,默认是ISO8601格式     
                timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
                jsonStr = "{success:true,totalCount:" + totalCount + ",item:" + JsonConvert.SerializeObject(_list, 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);
            }
            this.Response.Clear();
            this.Response.Write(jsonStr.ToString());
            this.Response.End();
            return this.Response;
        }