/// <summary> /// 更改活動使用狀態 /// </summary> /// <returns>數據庫操作結果</returns> public JsonResult UpdateActive() { _promoadditionproceMgr = new PromoAdditionalPriceMgr(mySqlConnectionString); int id = Convert.ToInt32(Request.Params["id"]); string currentUser = (System.Web.HttpContext.Current.Session["caller"] as Caller).user_id.ToString(); string muser = string.Empty; int activeValue = Convert.ToInt32(Request.Params["active"]); if (!string.IsNullOrEmpty(Request.Params["muser"])) { muser = (Request.Params["muser"]); } if (currentUser == muser && activeValue == 1) { return Json(new { success = "stop" }); } PromoAdditionalPriceQuery model = _promoadditionproceMgr.Select(id); if (model.url_by == 1) { model.category_link_url = _produCateMgr.GetModelById(Convert.ToUInt32(model.category_id)).category_link_url; } model.active = Convert.ToBoolean(activeValue); model.id = id; //model.event_id = GetEventId(model.event_type, model.id.ToString()); model.muser =currentUser; model.modified = DateTime.Now; if (_promoadditionproceMgr.ChangeActive(model) > 0) { return Json(new { success = "true", msg = "" }); } else { return Json(new { success = "false", msg = "" }); } }