protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         AirTicketWeb.BLL.TInfotype bll = new AirTicketWeb.BLL.TInfotype();
         DropDownList1.DataSource     = bll.GetAllList();
         DropDownList1.DataTextField  = "name";
         DropDownList1.DataValueField = "id";
         DropDownList1.DataBind();
     }
 }
示例#2
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string name = this.txtname.Text;

        AirTicketWeb.Model.TInfotype model = new AirTicketWeb.Model.TInfotype();
        model.name = name;

        AirTicketWeb.BLL.TInfotype bll = new AirTicketWeb.BLL.TInfotype();
        bll.Add(model);
        Maticsoft.DBUtility.js.AlertAndRedirect("Success!", "TInfoType.aspx");
    }