예제 #1
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                pilotHandler pHandler = new pilotHandler();
                lblDisplay.Text = "the total number of hours flown on all charters: ";
                //ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "ClientScript", "alert('Success')", true);
                lblDisplay.Text     += pHandler.GetTotalHours(int.Parse(txtPilotID.Text)).ToString();
                lblDisplay.ForeColor = System.Drawing.Color.Red;
            }
            catch (Exception ex)
            {
                //ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "ClientScript", "alert('Fail')", true);
                lblDisplay.Text = ex.Message;
            }


            //List<double> totalHours = new List<double>();
            //totalHours.Add(double.Parse(pHandler.GetPilot(int.Parse(txtPilotID.Text)).ToString()));
            //lblDisplay.Text = totalHours.ToString();



            //dgvSearchPilot.DataSource = pHandler.GetPilot(int.Parse(txtPilotID.Text));
            //dgvSearchPilot.DataBind();
            //dgvSearchPilot.Visible = true;
        }
        protected void btnDate_Click(object sender, EventArgs e)
        {
            pilotHandler pHandler = new pilotHandler();

            List <DateTime> myDate = new List <DateTime>();

            drpDate.DataSource    = pHandler.GetPilotDates(DateTime.Parse(txtDate.Text));
            drpDate.DataTextField = "FullName";
            drpDate.DataBind();
        }