示例#1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         HappyMilesProgram hmp = new HappyMilesProgram();
         grdAirlines.DataSource = hmp.GetHappyMilesDataForAllAirlines();
         grdAirlines.DataBind();
     }
 }
示例#2
0
        protected void btnAddAirlines_Click(object sender, EventArgs e)
        {
            HappyMilesProgram hmp = new HappyMilesProgram();
            int    aid            = Convert.ToInt32(txtAirlineID.Text);
            double mAmt           = Convert.ToDouble(txtMinAmt.Text);
            double eAmt           = Convert.ToDouble(txtExmptAmt.Text);

            hmp.AddAirline(aid, mAmt, eAmt);

            grdAirlines.DataSource = hmp.GetHappyMilesDataForAllAirlines();
            grdAirlines.DataBind();
        }