⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 channel_class_del.ashx.cs

📁 易想商城系统
💻 CS
字号:
using System;
using System.Data;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using Shop.Web.UI;

namespace YXShop.Web.Admin.Article
{
    /// <summary>
    /// Summary description for $codebehindclassname$
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class Channel_Class_Del : IHttpHandler
    {
        BasePage bp = null;
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            //if (context.Session["admin"] == null)
            //{
            //    YXJob.Common.alert.RedirectUrl("Default.aspx");
            //}
            if (YXShop.Common.WebUtility.isNumeric(context.Request["ispower"])) 
            {
                bp = new BasePage();
                bp.PageError("对不起,你没有删除分类的权限!", "../index.aspx");
            }
           if (context.Request["Class_ID"] != "" && context.Request["action"] != "")
            {
                if (YXShop.Common.WebUtility.InputText((context.Request["Class_ID"] + "ok").ToString(), (context.Request["Class_ID"] + "ok").ToString().Length) != "ok" && (context.Request["action"] + "ok").ToString() == "delok")
                {
                    Delete_Class(YXShop.Common.WebUtility.InputText(context.Request["Class_ID"].ToString(), context.Request["Class_ID"].ToString().Length), context.Request["action"].ToString());
                }
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }

        #region 执行删除文章分类操作
        public void Delete_Class(string ClassId, string action)
        {
            if ((ClassId != "") && (action == "del"))
            {
                YXShop.BLL.YixiangChannelClass bll = new YXShop.BLL.YixiangChannelClass();
                if (bll.DeleteChannelClass(ClassId) == 0)
                {
                    HttpContext.Current.Response.Redirect(HttpContext.Current.Request.UrlReferrer.ToString());
                }
                else if (bll.DeleteChannelClass(ClassId) == 1)
                {
                    YXShop.Common.alert.show("对不起!该分类下有子分类,不能删除,删除失败!");
                }
                else
                {
                    YXShop.Common.alert.show("出现异常!删除失败!");
                }                
            }
        }
        #endregion
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -