コード例 #1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string categoryIds = context.Request["category_ids"];

            if (string.IsNullOrEmpty(categoryIds))
            {
                resp.errmsg  = "category_ids 为必填项,请检查";
                resp.errcode = 1;
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            if (bll.Delete(new ArticleCategory(), string.Format(" WebsiteOwner='{0}' AND CategoryType='article' AND AutoID in ({1})", bll.WebsiteOwner, categoryIds)) == categoryIds.Split(',').Length)
            {
                resp.errmsg    = "ok";
                resp.errcode   = 0;
                resp.isSuccess = true;
            }
            else
            {
                resp.errcode = 1;
                resp.errmsg  = "删除文章分类出错";
            }
            context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
        }
コード例 #2
0
        public void ProcessRequest(HttpContext context)
        {
            string expressIds = context.Request["express_company_ids"];

            resp.errcode = 1;
            resp.errmsg  = "暂不支持删除";
            context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
            return;

            if (string.IsNullOrEmpty(expressIds))
            {
                resp.errcode = 1;
                resp.errmsg  = "express_company_ids 为必填项,请检查";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }

            if (bll.Delete(new ExpressInfo(), string.Format(" WebsiteOwner='{0}' and AutoID in ({1}) ", bll.WebsiteOwner, expressIds)) == expressIds.Split(',').Length)
            {
                resp.errcode   = 0;
                resp.errmsg    = "ok";
                resp.isSuccess = true;
            }
            else
            {
                resp.errcode = -1;
                resp.errmsg  = "删除出错";
            }
            context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
            return;
        }
コード例 #3
0
 /// <summary>
 /// 删除
 /// </summary>
 private static string Delete(HttpContext context)
 {
     try
     {
         var ids   = context.Request["id"].Split(',');
         int count = 0;
         foreach (var item in ids)
         {
             if (bll.Delete(new ModuleFilterInfo(), string.Format("PagePath ='{0}' ", item)) > 0)
             {
                 count++;
             }
         }
         UpdateRedis();
         if (count == ids.Length)
         {
             return("true");
         }
         else
         {
             return("false");
         }
     }
     catch (Exception ex)
     {
         return(ex.Message);
     }
 }
コード例 #4
0
ファイル: Delete.ashx.cs プロジェクト: uvbs/mmp
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string slideIds = context.Request["slide_ids"];

            if (string.IsNullOrEmpty(slideIds))
            {
                resp.errcode = 1;
                resp.errmsg  = "slide_ids 为必填项,请检查";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            if (bll.Delete(new ZentCloud.BLLJIMP.Model.Slide(), string.Format(" WebsiteOwner='{0}' AND AutoID in ({1}) ", bll.WebsiteOwner, slideIds)) == slideIds.Split(',').Length)
            {
                resp.errmsg    = "ok";
                resp.errcode   = 0;
                resp.isSuccess = true;
            }
            else
            {
                resp.errcode = 1;
                resp.errmsg  = "删除广告出错";
            }
            context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
        }
コード例 #5
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string userlevelIds = context.Request["level_ids"];

            if (string.IsNullOrEmpty(userlevelIds))
            {
                resp.errmsg  = "level_ids为必填项,请检查";
                resp.errcode = 1;
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            if (bll.Delete(new UserLevelConfig(), string.Format(" WebsiteOwner='{0}' AND AutoID in ({1}) ", bll.WebsiteOwner, userlevelIds)) == userlevelIds.Split(',').Length)
            {
                resp.errcode   = 0;
                resp.errmsg    = "ok";
                resp.isSuccess = true;
            }
            else
            {
                resp.errmsg  = "删除出错";
                resp.errcode = -1;
            }
            context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
        }
コード例 #6
0
        /// <summary>
        /// 删除文章评论
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string DeleteArticleReview(HttpContext context)
        {
            if (!bll.IsLogin)
            {
                resp1.errcode = (int)errcode.UnLogin;
                resp1.errmsg  = "尚未登录";
                goto outoff;
            }
            string          id     = context.Request["id"];
            ReplyReviewInfo review = bll.Get <ReplyReviewInfo>(string.Format(" AutoID={0} And UserId='{1}'", id, currentUserInfo.UserID));

            if (review == null)
            {
                resp1.errcode = 1;
                resp1.errmsg  = "无权删除";
                goto outoff;
            }
            if (bll.Delete(review) == 0)
            {
                resp1.errcode = 2;
                resp1.errmsg  = "删除失败";
                goto outoff;
            }
            resp1.errmsg = "删除成功";
            //bll.Delete(new ReplyReviewInfo(), string.Format(" PraentId={0}", Review.AutoId));
outoff:
            return(Common.JSONHelper.ObjectToJson(resp1));
        }
コード例 #7
0
        /// <summary>
        /// 删除
        /// </summary>
        private static string Delete(HttpContext context)
        {
            string ids   = context.Request["id"];
            var    count = 0;

            count = bll.Delete(new UserRemind(), string.Format("RemindID in({0}) And UserID='{1}'", ids, Comm.DataLoadTool.GetCurrUserID()));
            if (count == ids.Split(',').Length)
            {
                return("true");
            }
            return("false");
        }
コード例 #8
0
 public void ProcessRequest(HttpContext context)
 {
     if (bll.Delete(new PcPage(), string.Format(" PageId in({0})", context.Request["ids"])) > 0)
     {
         apiResp.status = true;
     }
     else
     {
         apiResp.msg = "删除失败";
     }
     bll.ContextResponse(context, apiResp);
 }
コード例 #9
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string activityId = context.Request["activity_id"];
            string fieldIndex = context.Request["field_index"];

            if (string.IsNullOrEmpty(activityId))
            {
                resp.errmsg  = "activity_id 为必填,请检查";
                resp.errcode = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            if (string.IsNullOrEmpty(fieldIndex))
            {
                resp.errmsg  = "field_index 为必填,请检查";
                resp.errcode = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            JuActivityInfo juActivity = bllJuActivity.GetJuActivity(int.Parse(activityId), false);

            if (juActivity == null)
            {
                resp.errcode = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                resp.errmsg  = "没有找到该活动";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            ActivityFieldMappingInfo fieldMap = bll.Get <ActivityFieldMappingInfo>(string.Format(" ActivityID={0} AND ExFieldIndex={1}", juActivity.SignUpActivityID, fieldIndex));

            if (fieldMap == null)
            {
                resp.errcode = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                resp.errmsg  = "没有找到该条记录";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            if (bll.Delete(new ActivityFieldMappingInfo(), string.Format(" ActivityID={0} AND ExFieldIndex={1}", juActivity.SignUpActivityID, fieldIndex)) > 0)
            {
                resp.isSuccess = true;
                resp.errmsg    = "ok";
            }
            else
            {
                resp.errmsg  = "删除出错";
                resp.errcode = (int)BLLJIMP.Enums.APIErrCode.OperateFail;
            }
            context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
        }
コード例 #10
0
        /// <summary>
        /// 删除
        /// </summary>
        private static string Delete(HttpContext context)
        {
            //if (!_isedit)
            //{
            //    return null;
            //}

            string ids = context.Request["id"];

            if (bll.Delete(new WeixinMsgSourceInfo(), string.Format("SourceID in({0}) ", ids)) > 0)
            {
                return("true");
            }

            return("false");
        }
コード例 #11
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string Delete(HttpContext context)
        {
            var ids = context.Request["ids"];

            if (bll.Delete(new BarCodeInfo(), string.Format(" AutoId In({0})", ids)) > 0)
            {
                apiResp.status = true;
            }
            else
            {
                apiResp.msg = "删除失败";
            }


            return(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
        }
コード例 #12
0
 /// <summary>
 /// 删除
 /// </summary>
 private static string Delete(HttpContext context)
 {
     try
     {
         string ids = context.Request["id"];
         if (bll.Delete(new UserSignHistory(), string.Format("SignID in({0}) And UserID='{1}' ", ids, Comm.DataLoadTool.GetCurrUserID())) > 0)
         {
             return("true");
         }
         return("false");
     }
     catch (Exception ex)
     {
         return(ex.Message);
     }
 }
コード例 #13
0
ファイル: AdminHandler.ashx.cs プロジェクト: uvbs/mmp
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string DeleteCrowdFundInfo(HttpContext context)
        {
            string        ids = context.Request["ids"];
            CrowdFundInfo model;

            foreach (var item in ids.Split(','))
            {
                model = bllBase.Get <CrowdFundInfo>(string.Format("AutoId={0}", item));
                if (model == null || (!model.WebSiteOwner.Equals(bllBase.WebsiteOwner)))
                {
                    return("无权删除");
                }
            }
            int count = bllBase.Delete(new CrowdFundInfo(), string.Format("AutoId in ({0})", ids));

            return(string.Format("成功删除了 {0} 条数据", count));
        }
コード例 #14
0
        public void ProcessRequest(HttpContext context)
        {
            string componentId = context.Request["component_id"];

            if (string.IsNullOrEmpty(componentId))
            {
                apiResp.msg  = "component_id 为必填项,请检查";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                bll.ContextResponse(context, apiResp);
                return;
            }

            BLLJIMP.Model.Component model = bll.Get <BLLJIMP.Model.Component>(string.Format(" WebsiteOwner='{0}' AND AutoId={1}", bll.WebsiteOwner, componentId));
            if (model == null)
            {
                apiResp.msg  = "没有找到";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                bll.ContextResponse(context, apiResp);
                return;
            }
            if (!string.IsNullOrWhiteSpace(model.ComponentKey))
            {
                apiResp.msg  = "禁止删除";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.OperateFail;
                bll.ContextResponse(context, apiResp);
                return;
            }

            if (bll.Delete(new BLLJIMP.Model.Component(), string.Format(" WebsiteOwner='{0}' AND AutoId={1}", bll.WebsiteOwner, componentId)) > 0)
            {
                apiResp.status = true;
                apiResp.msg    = "ok";
            }
            else
            {
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.OperateFail;
                apiResp.msg  = "删除出错";
            }
            bll.ContextResponse(context, apiResp);
        }
コード例 #15
0
        public void ProcessRequest(HttpContext context)
        {
            string typeIds = context.Request["type_ids"];

            if (string.IsNullOrEmpty(typeIds))
            {
                apiResp.code = (int)APIErrCode.PrimaryKeyIncomplete;
                apiResp.msg  = "type_ids 为必填项,请检查";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
                return;
            }
            if (bll.Delete(new ZentCloud.BLLJIMP.Model.TypeInfo(), string.Format(" WebsiteOwner='{0}' and TypeId in ({1}) ", bll.WebsiteOwner, typeIds)) == typeIds.Split(',').Length)
            {
                apiResp.status = true;
                apiResp.msg    = "ok";
            }
            else
            {
                apiResp.msg = "删除失败";
            }
            context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
        }
コード例 #16
0
        public void ProcessRequest(HttpContext context)
        {
            string navigationIds = context.Request["navigation_ids"];

            if (string.IsNullOrEmpty(navigationIds))
            {
                resp.errcode = 1;
                resp.errmsg  = "navigation_id 为空,请检查";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            if (bll.Delete(new ZentCloud.BLLJIMP.Model.Navigation(), string.Format(" WebsiteOwner='{0}' AND AutoID in ({1})", bll.WebsiteOwner, navigationIds)) == navigationIds.Split(',').Length)
            {
                resp.errcode   = 0;
                resp.errmsg    = "ok";
                resp.isSuccess = true;
            }
            else
            {
                resp.errcode = -1;
                resp.errmsg  = "删除导航出错";
            }
            context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
        }
コード例 #17
0
        /// <summary>
        /// 删除
        /// </summary>
        private static string Delete(HttpContext context)
        {
            //    if (!_isedit)
            //    {
            //        return null;
            //    }

            string stepids = context.Request["StepID"];
            string flowid  = context.Request["FlowID"];

            try
            {
                //删除
                if (bll.Delete(new WXFlowStepInfo(), string.Format(" FlowID={0} And StepID in({1}) ", flowid, stepids)) > 0)
                {
                    //重排序号
                    var steplist = bll.GetList <WXFlowStepInfo>(string.Format("FlowID={0} Order by StepID ASC", flowid));
                    int index    = 0;
                    foreach (var item in steplist)
                    {
                        //item.StepID=index;
                        index++;
                        // bll.Update(item,);
                        bll.Update(item, string.Format("StepID='{0}'", index), string.Format("FlowID={0} And StepID={1}", flowid, item.StepID));
                    }
                    //重排序号
                    return("true");
                }

                return("false");
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }
        }
コード例 #18
0
        /// <summary>
        /// 删除基地信息
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public string DeleteBaseInfo(HttpContext context)
        {
            string ids = context.Request["ids"];

            return(string.Format("成功删除 {0} 个基地信息", bll.Delete(new WBBaseInfo(), string.Format("AutoID in ({0}) And WebsiteOwner='{1}'", ids, bll.WebsiteOwner))));
        }