Esempio n. 1
0
        public void ProcessRequest(HttpContext context)
        {
            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 (bllMall.GetCount <WXMallCategory>(string.Format("  WebsiteOwner='{0}' AND AutoID in ({1}) And IsSys=1", bllMall.WebsiteOwner, categoryIds)) > 0)
            {
                resp.errmsg  = "无法删除系统分类";
                resp.errcode = 1;
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            if (bllMall.Delete(new WXMallCategory(), string.Format(" WebsiteOwner='{0}' AND AutoID in ({1})", bllMall.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));
        }
Esempio n. 2
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string FieldDelete(HttpContext context)
        {
            string autoIds = context.Request["autoIds"];

            if (bllMall.Delete(new TableFieldMapping(), string.Format(" AutoId in({0})", autoIds)) > 0)
            {
                apiResp.status = true;
            }
            return(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
        }
Esempio n. 3
0
        public void ProcessRequest(HttpContext context)
        {
            string ids = context.Request["ids"];

            if (bllMall.Delete(new ProductPriceConfig(), string.Format(" AutoId in({0}) And WebsiteOwner='{1}'", ids, bllMall.WebsiteOwner)) == ids.Split(',').Count())
            {
                apiResp.status = true;
                apiResp.msg    = "ok";
            }
            else
            {
                apiResp.code = -1;
                apiResp.msg  = "操作失败";
            }
            context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
        }