Пример #1
0
        public JsonResult UpdateStatus()
        {
            string jsonStr = string.Empty;
            try
            {  
                int spec_id=0;
                int spec_status=0;
                if (!string.IsNullOrEmpty(Request.Params["spec_id"]))
                {
                    spec_id = Convert.ToInt32(Request.Params["spec_id"]);
                }
                if (!string.IsNullOrEmpty(Request.Params["spec_status"]))
                {
                    spec_status = Convert.ToInt32(Request.Params["spec_status"]);
                }
                _IProductMgr = new ProductMgr(mySqlConnectionString);

                if (_IProductMgr.UpdateStatus(spec_id, spec_status) == true)
                {
                    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" });
            }

        }