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

📄 article_action.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 Article_Action : IHttpHandler
    {
        BasePage bp = null;
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/html";
            if (context.Request["actionDel"] == "del")
            {
                if (YXShop.Common.WebUtility.isNumeric(context.Request.QueryString["ispower"]))
                {
                    if (Convert.ToInt32(context.Request.QueryString["ispower"]) == 0)
                    {
                        bp = new BasePage();
                        bp.PageError("对不起,你没有删除文章的权限!", "../index.aspx");
                    }
                }
                if (context.Request["articleId"] != "")
                {
                    Action_Articles(context.Request["articleId"]);
                }
            }
            else
            {
                if (YXShop.Common.WebUtility.isNumeric(context.Request.QueryString["ispower"]))
                {
                    if (Convert.ToInt32(context.Request.QueryString["ispower"]) ==1)
                    {
                        bp = new BasePage();
                        bp.PageError("对不起,你没有审核/置顶/推荐的权限!", "../index.aspx");
                    }
                }
                if (context.Request["articleId"] != "" && context.Request["action"] != ""  && context.Request["typeId"] != "")
                {
                    if (YXShop.Common.WebUtility.InputText((context.Request["articleId"] + "ok").ToString(), (context.Request["articleId"] + "ok").ToString().Length) != "ok")
                    {
                        Action_Article(YXShop.Common.WebUtility.InputText(context.Request["articleId"].ToString(), context.Request["articleId"].ToString().Length), context.Request["action"].ToString(), context.Request["typeId"].ToString());
                        HttpContext.Current.Response.Redirect(HttpContext.Current.Request.UrlReferrer.ToString());
                    }
                }
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
 
        #region 执行更新置顶、推荐、审核
        public void Action_Article(string articleId, string action, string typeId)
        {
            if (!string.IsNullOrEmpty(articleId) && !string.IsNullOrEmpty(action) && !string.IsNullOrEmpty(typeId))
            { 
                YXShop.BLL.YixiangArticle bllArt=new YXShop.BLL.YixiangArticle();
                try
                {
                    bllArt.Action_Article(articleId, action, typeId);
                }
                catch { }
            }
        }
        #endregion

        #region 执行删除
        public void Action_Articles(string articleId)
        {
            try
            {
                if (!string.IsNullOrEmpty(articleId))
                {
                    YXShop.BLL.YixiangArticle bllArt = new YXShop.BLL.YixiangArticle();
                    if (bllArt.Del_Article(articleId) == 1)
                    {
                        HttpContext.Current.Response.Redirect(HttpContext.Current.Request.UrlReferrer.ToString());
                    }
                    else
                    {
                        YXShop.Common.alert.show("出现异常!删除失败!");
                    }
                }
            }
            catch { }
        }
        #endregion
    }
}

⌨️ 快捷键说明

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