private void BindOrgan() { IList <Organ> ds = new OrganBLL().GetModelList(""); Organ o = new Organ(); o.OrganID = 100; o.OrganName = "超级管理员"; ds.Add(o); //ddl_Superior.DataSource = ds; //ddl_Superior.DataTextField = "OrganName"; //ddl_Superior.DataValueField = "OrganID"; //ddl_Superior.DataBind(); }
protected void Button1_Click(object sender, EventArgs e) { Organ organ = new Organ(); //organ.OrganID = int.Parse(txt_ID.Text.Trim()); organ.OrganName = txt_Name.Text.Trim(); organ.Superior = Convert.ToInt32(ddl_Superior.SelectedValue); organ.Level = int.Parse(ddl_Level.SelectedValue.ToString()); organ.Remark = txt_Remark.Text; organ.InputBy = Session["UserID"].ToString(); bool re = organBLL.Add(organ); if (re) { Response.Write("添加成功!"); Response.Redirect("OrganMgr.aspx"); } else { Response.Write("添加失败!"); } }