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

📄 newrole.aspx.cs

📁 这是一个自动排课软件(包含源码,需求分析,详细设计).希望对你有所帮助.
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Web.Services;

public partial class UserManage_NewRole : System.Web.UI.Page
{HtmlLink link = new HtmlLink();
    protected void Page_Load(object sender, EventArgs e)
    {
        
        if (Request.Cookies["ThemeCss"] == null)
            link.Href = "../styles/VistaBlue.css";
        else
            link.Href = "../styles/" + Request.Cookies["ThemeCss"].Value;
        link.Attributes["rel"] = "stylesheet";
        link.Attributes["type"] = "text/css";
        Page.Header.Controls.Add(link);
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            if (labError.Text.ToString() == "")
            {
                BLL.BCropRole bCropRole = new BLL.BCropRole();
                Entities.CorpRole corpRole = new Entities.CorpRole();
                corpRole.RoleName = this.txtname.Text.ToString().Trim();
                corpRole.IsValid = cbkIsValid.Checked;
                if (bCropRole.Insert(corpRole) > -1)
                {
                    this.labError.Text = "添加成功";
                }
                
                Response.Write("<script>window.returnValue='';window.close();</script>");
            }
        }
    }

    [WebMethod]
    public static bool VerifyUser(string userName)
    {
        if (userName != null || userName != string.Empty)
        {
            Search.CorpRoleSearcher search = new Search.CorpRoleSearcher();
            search.RoleName = userName;
            search.RoleNameIsValid = true;

            ArrayList list = new BLL.BCropRole().Select(search);
            if (list != null && list.Count > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        else
            return false;
    }
    
}

⌨️ 快捷键说明

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