Esempio n. 1
0
        public HttpResponseBase DeleteUserCondition()
        {
            string json = string.Empty;
            try
            {
                EventPromoUserConditionQuery query = new EventPromoUserConditionQuery();
                if (!string.IsNullOrEmpty(Request.Params["ids"]))
                {
                    string condition_id = Request.Params["ids"];
                    query.condition_id_tostring = condition_id.Substring(0, condition_id.LastIndexOf(','));
                }
                ipuConditionMgr = new EventpromoUserConditionMgr(mySqlConnectionString);
                int result = ipuConditionMgr.Delete(query);
                if (result > 0)
                {
                    json = "{success:true}";
                }
                else
                {
                    json = "{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);
                json = "{success:false,msg:\"" + "" + "\"}";
            }
            this.Response.Clear();
            this.Response.Write(json);
            this.Response.End();
            return this.Response;
        }