Esempio n. 1
0
 private void BindPilots()
 {
     FlightPilot pilots = new FlightPilot();
     pilots.GetPilotByFlightID(CurrentFlightReport.ReportID);
     uiGridViewPiolts.DataSource = pilots.DefaultView;
     uiGridViewPiolts.DataBind();
 }
Esempio n. 2
0
        protected void uiGridViewReports_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "EditReport")
            {
                Flight objData = new Flight();
                objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
                uiDropDownListAirCraftRegistration.SelectedValue = objData.AirCraft_AirPlaneID.ToString();
                uiTextBoxFlightNo.Text = objData.FlightNo;
                uiTextBoxDate.Text = objData.ReportDate.ToString("dd/MM/yyyy");
                uiCheckBoxIsHeavy.Checked = objData.IsHeavy;
                CurrentFlightReport = objData;
                uiPanelEdit.Visible = true;
                uiPanelViewAll.Visible = false;
                BindSectors();
                BindCrew();
                BindPilots();
            }

            else if (e.CommandName == "DeleteReport")
            {
                Flight objData = new Flight();
                objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
                FlightCrew crew = new FlightCrew();
                crew.GetCrewByFlightID(objData.ReportID);
                FlightPilot pilots = new FlightPilot();
                pilots.GetPilotByFlightID(objData.ReportID);
                Sector sectors = new Sector();
                sectors.GetSectorsByFlightID(objData.ReportID);

                pilots.DeleteAll();
                pilots.Save();

                crew.DeleteAll();
                crew.Save();

                sectors.DeleteAll();
                sectors.Save();

                objData.MarkAsDeleted();
                objData.Save();

                BindReportData();
            }
        }
Esempio n. 3
0
 /********************************** Crew Section *****************************************/
 protected void uiLinkButtonAddFlying_Click(object sender, EventArgs e)
 {
     FlightPilot Member = new FlightPilot();
     Member.AddNew();
     Member.ReportID = CurrentFlightReport.ReportID;
     Member.PositionID = Convert.ToInt32(uiDropDownListPilotPos.SelectedValue);
     Member.PilotID = Convert.ToInt32(uiDropDownListPilot.SelectedValue);
     Member.Save();
     BindPilots();
 }
Esempio n. 4
0
 protected void uiGridViewPiolts_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "DeletePiolt")
     {
         FlightPilot objData = new FlightPilot();
         objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
         objData.MarkAsDeleted();
         objData.Save();
         BindPilots();
     }
 }