using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using Model;
namespace ComResProSystem
{
    public partial class UserInput:BasePage
    {
        BaseBLL bll = new BaseBLL();
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void Ibt_Submit_Click(object sender, ImageClickEventArgs e)
        {

            Dictionary<string, string> dic = base.FindControls(this.form1);
            dic.Add("UserPos", Dd_UserPos.Text);
            dic.Add("Part", Dd_Part.Text);
            dic.Add("Sex", Rb_Man.Checked == true ? "1" : "0");
            object obj = bll.CreateObject(typeof(User), dic);
            if (bll.SaveObject(obj, "Users")== 0)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", "alert('数据添加成功！')", true);
                base.SetDefault(this.form1);
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", "alert('数据添加失败！')", true);
            }
        }
    }
}