Beispiel #1
0
        public string Delete(HttpContext pContext)
        {
            try
            {
                WMaterialTextBLL bll    = new WMaterialTextBLL(CurrentUserInfo);
                string           textID = pContext.Request["textID"];
                var server = new WMenuMTextMappingBLL(CurrentUserInfo);
                var entity = server.QueryByEntity(new WMenuMTextMappingEntity {
                    TextId = textID, IsDelete = 0
                }, null).FirstOrDefault();
                if (entity != null)
                {
                    return(string.Format("{{\"success\":'false',\"msg\":\"图文信息已被引用,不能删除\"}}"));
                }

                object[] obi = new object[] { textID };
                bll.Delete(obi);
                return(string.Format("{{\"success\":'true'}}"));
            }
            catch (Exception)
            {
                return(string.Format("{{\"success\":'false',\"msg\":\"操作异常,删除失败\"}}"));

                throw;
            }
        }