• 03Del.ashx(删除班级)


    03Del.ashx

    数据库里定义个BOOL型,TRUE表示正常FALSE表示删除
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text.RegularExpressions;
    using System.Web;
    
    namespace AspNetAshx
    {
        /// <summary>
        /// 班级删除页面
        /// </summary>
        public class _03Del : IHttpHandler
        {
    
            public void ProcessRequest(HttpContext context)
            {
                context.Response.ContentType = "text/html";
                //1.获取浏览器get传递过来的要删除的班级id
                string strId = context.Request.QueryString["id"];
                //2.验证id是否是数值
                if (CommonHelper.IsNum(strId))//验证通过
                {
                    //3.删除对应的班级数据
                    int res = SqlHelper.ExcuteNoneQuery("update Classes set CIsDel = 1 where CId = " + strId);
                    if (res > 0)
                    { //删除成功
                        CommonHelper.WriteJs("删除成功~!", "01List.ashx");
                    }
                    else
                    { //删除失败
                        CommonHelper.WriteJs("删除失败~!如果您是美女,请联系管理员~~~qq:111111", "01List.ashx");
                    }
                }
                else {//4.验证失败 
                    //通过输出js 先让浏览器用户看到错误消息,然后再直接通过js控制浏览器跳转到 列表页面(再次请求服务器的列表页面)
                    context.Response.Write("<script>alert('您的参数有误!您什么意思~~!');window.location='01List.ashx';</script>");
                }
            }
    
            public bool IsReusable
            {
                get
                {
                    return false;
                }
            }
        }
    }
  • 相关阅读:
    Oracle死锁
    Oracle forall bulk collect批量数据更新
    Oracle组合索引与回表
    查看Oracle执行计划
    Oracle 用户、角色、权限(系统权限、对象权限)的数据字典表
    Oracle计算两个时间戳相差秒数,精确到毫秒
    关于Oracle的疑问
    Oracle update和order by
    Oracle Connect by与递归with
    关于Oracle表连接
  • 原文地址:https://www.cnblogs.com/hehehehehe/p/5105879.html
Copyright © 2020-2023  润新知