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;

public partial class N38_AddNewUser : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void ibtnok_Click(object sender, ImageClickEventArgs e)
    {
        if (Page.IsValid)
        {
            string realname = tbrealname.Text.Trim();
            string name = tbname.Text.Trim();
            string type = rbltype.SelectedValue;
            N38_User myUser = new N38_User();
            bool result=myUser.InsertUser(name, realname, type);
            if (result)
            {
                Response.Write("<script>alert('用户添加成功')</script>");
                tbrealname.Text = tbname.Text = "";
            }
            else
            {
                Response.Write("<script>alert('用户添加失败，可能用户名已存在')</script>");
            }
        }
    }
}
