SystemManage/ClassAdd.aspx.cs

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class SystemManage_ClassAdd : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.Cookies["roleid"] != null)
        {
            Authority myauthority = new Authority();
            int RoleID = Convert.ToInt16(Server.HtmlEncode(Request.Cookies["roleid"].Value));
            int ModuleID =30;
            if (myauthority.QXExists(RoleID, ModuleID))
            {
                //AjaxPro.Utility.RegisterTypeForAjax(typeof(SystemManage_ClassAdd));
            }
            else
            {
                MessageBox.ShowAndRedirect(this.Page, "对不起!您无权操作此版块。", "../Main.aspx");
            }
        }
        else
        {
            MessageBox.ShowAndRedirect(this.Page, "对不起!您还没有登录系统。", "../Logout.aspx");
        }
    }
    //[AjaxPro.AjaxMethod]
    //public int Verify(string txtName)
    //{
    //    Class my = new Class();
    //    if (txtName == "")
    //        return 1;
    //    else if (my.Exists(txtName))
    //        return 0;
    //    else
    //        return -1;
    //}
    protected void butAdd_Click(object sender, ImageClickEventArgs e)
    {
        Class my = new Class();
        my.CName = this.tb_name.Text;
        my.CNum = Convert.ToInt16( this.txtNum.Text);

        if (my.Exists(this.tb_name.Text.Trim()))
        {
            MessageBox.errorShow(this.Page, "班级名称已存在!");
        }
        else
        {
            my.Add();

            //添加完毕
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "a", "window.onload=function(){close();W.AA();}", true);
        }
       
后面还有 3 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读 AI

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。