private void BindSectors() { Sector Sectors = new Sector(); Sectors.GetSectorsByFlightID(CurrentFlightReport.ReportID); uiGridViewSectors.DataSource = Sectors.DefaultView; uiGridViewSectors.DataBind(); }
protected void uiLinkButtonSaveSector_Click(object sender, EventArgs e) { if (CurrentSector != null) { Sector objData = CurrentSector; objData.IsPAX = false; if (!string.IsNullOrEmpty(uiTextBoxFule.Text)) { objData.FuleUplifted = Convert.ToInt32(uiTextBoxFule.Text); } if (!string.IsNullOrEmpty(uiTextBoxActualBurn.Text)) { objData.ActualBurnOff = Convert.ToInt32(uiTextBoxActualBurn.Text); } if (!string.IsNullOrEmpty(uiTextBoxPlanBurnOff.Text)) { objData.StandardBurnOff = Convert.ToInt32(uiTextBoxPlanBurnOff.Text); } TimeSpan STD = new TimeSpan(Convert.ToInt32(uiDropDownListSTDHours.Text), Convert.ToInt32(uiDropDownListSTDMins.Text), 0); objData.STD = Convert.ToDateTime(STD.ToString()); TimeSpan ATD = new TimeSpan(Convert.ToInt32(uiDropDownListATDHours.Text), Convert.ToInt32(uiDropDownListATDMins.Text), 0); objData.ATD = Convert.ToDateTime(ATD.ToString()); TimeSpan ATA = new TimeSpan(Convert.ToInt32(uiDropDownListATAHours.Text), Convert.ToInt32(uiDropDownListATAMins.Text), 0); if (Convert.ToInt32(uiDropDownListATAHours.Text) < Convert.ToInt32(uiDropDownListATDHours.Text)) { objData.ATA = Convert.ToDateTime(ATA.ToString()).AddDays(1); } else { objData.ATA = Convert.ToDateTime(ATA.ToString()); } TimeSpan OFF = new TimeSpan(Convert.ToInt32(uiDropDownListOFFHours.Text), Convert.ToInt32(uiDropDownListOFFMins.Text), 0); objData.ChoxOff = Convert.ToDateTime(OFF.ToString()); TimeSpan On = new TimeSpan(Convert.ToInt32(uiDropDownListOnHours.Text), Convert.ToInt32(uiDropDownListOnMins.Text), 0); if (Convert.ToInt32(uiDropDownListOnHours.Text) < Convert.ToInt32(uiDropDownListOFFHours.Text)) { objData.ChoxOn = Convert.ToDateTime(On.ToString()).AddDays(1); } else { objData.ChoxOn = Convert.ToDateTime(On.ToString()); } TimeSpan STA = new TimeSpan(Convert.ToInt32(uiDropDownListSTAHours.Text), Convert.ToInt32(uiDropDownListSTAMins.Text), 0); if (Convert.ToInt32(uiDropDownListSTAHours.Text) < Convert.ToInt32(uiDropDownListSTDHours.Text)) { objData.STA = Convert.ToDateTime(STA.ToString()).AddDays(1); } else { objData.STA = Convert.ToDateTime(STA.ToString()); } if (!string.IsNullOrEmpty(uiDropDownListDelay1Code.SelectedValue)) { objData.DepDelayID1 = Convert.ToInt32(uiDropDownListDelay1Code.SelectedValue); TimeSpan Delay1 = new TimeSpan(Convert.ToInt32(uiDropDownListDelay1Hours.Text), Convert.ToInt32(uiDropDownListDelay1Mins.Text), 0); objData.DepDelayTime1 = Convert.ToDateTime(Delay1.ToString()); } if (!string.IsNullOrEmpty(uiDropDownListDelay2Code.SelectedValue)) { objData.DepDelayID2 = Convert.ToInt32(uiDropDownListDelay2Code.SelectedValue); TimeSpan Delay2 = new TimeSpan(Convert.ToInt32(uiDropDownListDelay2Hours.Text), Convert.ToInt32(uiDropDownListDelay2Mins.Text), 0); objData.DepDelayTime2 = Convert.ToDateTime(Delay2.ToString()); } if (!string.IsNullOrEmpty(uiDropDownListDelay3Code.SelectedValue)) { objData.DepDelayID3 = Convert.ToInt32(uiDropDownListDelay3Code.SelectedValue); TimeSpan Delay3 = new TimeSpan(Convert.ToInt32(uiDropDownListDelay3Hours.Text), Convert.ToInt32(uiDropDownListDelay3Mins.Text), 0); objData.DepDelayTime3 = Convert.ToDateTime(Delay3.ToString()); } if (!string.IsNullOrEmpty(uiDropDownListArrDelay1Code.SelectedValue)) { objData.ArrDelayID1 = Convert.ToInt32(uiDropDownListArrDelay1Code.SelectedValue); TimeSpan ArrDelay1 = new TimeSpan(Convert.ToInt32(uiDropDownListArrDelay1Hours.Text), Convert.ToInt32(uiDropDownListArrDelay1Mins.Text), 0); objData.ArrDelayTime1 = Convert.ToDateTime(ArrDelay1.ToString()); } if (!string.IsNullOrEmpty(uiDropDownListArrDelay2Code.SelectedValue)) { objData.ArrDelayID2 = Convert.ToInt32(uiDropDownListArrDelay2Code.SelectedValue); TimeSpan ArrDelay2 = new TimeSpan(Convert.ToInt32(uiDropDownListArrDelay2Hours.Text), Convert.ToInt32(uiDropDownListArrDelay2Mins.Text), 0); objData.ArrDelayTime2 = Convert.ToDateTime(ArrDelay2.ToString()); } if (!string.IsNullOrEmpty(uiDropDownListArrDelay3Code.SelectedValue)) { objData.ArrDelayID3 = Convert.ToInt32(uiDropDownListArrDelay3Code.SelectedValue); TimeSpan ArrDelay3 = new TimeSpan(Convert.ToInt32(uiDropDownListArrDelay3Hours.Text), Convert.ToInt32(uiDropDownListArrDelay3Mins.Text), 0); objData.ArrDelayTime3 = Convert.ToDateTime(ArrDelay3.ToString()); } TimeSpan Day = new TimeSpan(Convert.ToInt32(uiDropDownListDayHours.Text), Convert.ToInt32(uiDropDownListDayMins.Text), 0); objData.FlyAtDay = Convert.ToDateTime(Day.ToString()); TimeSpan Night = new TimeSpan(Convert.ToInt32(uiDropDownListNightHours.Text), Convert.ToInt32(uiDropDownListNightMins.Text), 0); objData.FlyAtNight = Convert.ToDateTime(Night.ToString()); if (!string.IsNullOrEmpty(uiTextBoxDepFuel.Text)) { objData.DepFule = Convert.ToInt32(uiTextBoxDepFuel.Text); } if (!string.IsNullOrEmpty(uiTextBoxArrFuel.Text)) { objData.ArrFule = Convert.ToInt32(uiTextBoxArrFuel.Text); } if (!string.IsNullOrEmpty(uiTextBoxNoOFPax_A.Text)) { objData.NoOfPax_A = Convert.ToInt32(uiTextBoxNoOFPax_A.Text); } if (!string.IsNullOrEmpty(uiTextBoxNoOFPax_CH.Text)) { objData.NoOfPax_C = Convert.ToInt32(uiTextBoxNoOFPax_CH.Text); } if (!string.IsNullOrEmpty(uiTextBoxNoOFPax_I.Text)) { objData.NoOfPax_I = Convert.ToInt32(uiTextBoxNoOFPax_I.Text); } if (!string.IsNullOrEmpty(uiTextBoxTOW.Text)) { objData.TOW = Convert.ToInt32(uiTextBoxTOW.Text); } if (!string.IsNullOrEmpty(uiTextBoxZFW.Text)) { objData.ZFW = Convert.ToInt32(uiTextBoxZFW.Text); } objData.Save(); } else { Sector objData = new Sector(); objData.AddNew(); objData.IsPAX = false; if (!string.IsNullOrEmpty(uiTextBoxFule.Text)) { objData.FuleUplifted = Convert.ToInt32(uiTextBoxFule.Text); } if (!string.IsNullOrEmpty(uiTextBoxActualBurn.Text)) { objData.ActualBurnOff = Convert.ToInt32(uiTextBoxActualBurn.Text); } if (!string.IsNullOrEmpty(uiTextBoxPlanBurnOff.Text)) { objData.StandardBurnOff = Convert.ToInt32(uiTextBoxPlanBurnOff.Text); } TimeSpan STD = new TimeSpan(Convert.ToInt32(uiDropDownListSTDHours.Text), Convert.ToInt32(uiDropDownListSTDMins.Text), 0); objData.STD = Convert.ToDateTime(STD.ToString()); TimeSpan ATD = new TimeSpan(Convert.ToInt32(uiDropDownListATDHours.Text), Convert.ToInt32(uiDropDownListATDMins.Text), 0); objData.ATD = Convert.ToDateTime(ATD.ToString()); TimeSpan ATA = new TimeSpan(Convert.ToInt32(uiDropDownListATAHours.Text), Convert.ToInt32(uiDropDownListATAMins.Text), 0); if (Convert.ToInt32(uiDropDownListATAHours.Text) < Convert.ToInt32(uiDropDownListATDHours.Text)) { objData.ATA = Convert.ToDateTime(ATA.ToString()).AddDays(1); } else { objData.ATA = Convert.ToDateTime(ATA.ToString()); } TimeSpan OFF = new TimeSpan(Convert.ToInt32(uiDropDownListOFFHours.Text), Convert.ToInt32(uiDropDownListOFFMins.Text), 0); objData.ChoxOff = Convert.ToDateTime(OFF.ToString()); TimeSpan On = new TimeSpan(Convert.ToInt32(uiDropDownListOnHours.Text), Convert.ToInt32(uiDropDownListOnMins.Text), 0); if (Convert.ToInt32(uiDropDownListOnHours.Text) < Convert.ToInt32(uiDropDownListOFFHours.Text)) { objData.ChoxOn = Convert.ToDateTime(On.ToString()).AddDays(1); } else { objData.ChoxOn = Convert.ToDateTime(On.ToString()); } TimeSpan STA = new TimeSpan(Convert.ToInt32(uiDropDownListSTAHours.Text), Convert.ToInt32(uiDropDownListSTAMins.Text), 0); if (Convert.ToInt32(uiDropDownListSTAHours.Text) < Convert.ToInt32(uiDropDownListSTDHours.Text)) { objData.STA = Convert.ToDateTime(STA.ToString()).AddDays(1); } else { objData.STA = Convert.ToDateTime(STA.ToString()); } if (!string.IsNullOrEmpty(uiDropDownListDelay1Code.SelectedValue)) { objData.DepDelayID1 = Convert.ToInt32(uiDropDownListDelay1Code.SelectedValue); TimeSpan Delay1 = new TimeSpan(Convert.ToInt32(uiDropDownListDelay1Hours.Text), Convert.ToInt32(uiDropDownListDelay1Mins.Text), 0); objData.DepDelayTime1 = Convert.ToDateTime(Delay1.ToString()); } if (!string.IsNullOrEmpty(uiDropDownListDelay2Code.SelectedValue)) { objData.DepDelayID2 = Convert.ToInt32(uiDropDownListDelay2Code.SelectedValue); TimeSpan Delay2 = new TimeSpan(Convert.ToInt32(uiDropDownListDelay2Hours.Text), Convert.ToInt32(uiDropDownListDelay2Mins.Text), 0); objData.DepDelayTime2 = Convert.ToDateTime(Delay2.ToString()); } if (!string.IsNullOrEmpty(uiDropDownListDelay3Code.SelectedValue)) { objData.DepDelayID3 = Convert.ToInt32(uiDropDownListDelay3Code.SelectedValue); TimeSpan Delay3 = new TimeSpan(Convert.ToInt32(uiDropDownListDelay3Hours.Text), Convert.ToInt32(uiDropDownListDelay3Mins.Text), 0); objData.DepDelayTime3 = Convert.ToDateTime(Delay3.ToString()); } if (!string.IsNullOrEmpty(uiDropDownListArrDelay1Code.SelectedValue)) { objData.ArrDelayID1 = Convert.ToInt32(uiDropDownListArrDelay1Code.SelectedValue); TimeSpan ArrDelay1 = new TimeSpan(Convert.ToInt32(uiDropDownListArrDelay1Hours.Text), Convert.ToInt32(uiDropDownListArrDelay1Mins.Text), 0); objData.ArrDelayTime1 = Convert.ToDateTime(ArrDelay1.ToString()); } if (!string.IsNullOrEmpty(uiDropDownListArrDelay2Code.SelectedValue)) { objData.ArrDelayID2 = Convert.ToInt32(uiDropDownListArrDelay2Code.SelectedValue); TimeSpan ArrDelay2 = new TimeSpan(Convert.ToInt32(uiDropDownListArrDelay2Hours.Text), Convert.ToInt32(uiDropDownListArrDelay2Mins.Text), 0); objData.ArrDelayTime2 = Convert.ToDateTime(ArrDelay2.ToString()); } if (!string.IsNullOrEmpty(uiDropDownListArrDelay3Code.SelectedValue)) { objData.ArrDelayID3 = Convert.ToInt32(uiDropDownListArrDelay3Code.SelectedValue); TimeSpan ArrDelay3 = new TimeSpan(Convert.ToInt32(uiDropDownListArrDelay3Hours.Text), Convert.ToInt32(uiDropDownListArrDelay3Mins.Text), 0); objData.ArrDelayTime3 = Convert.ToDateTime(ArrDelay3.ToString()); } TimeSpan Day = new TimeSpan(Convert.ToInt32(uiDropDownListDayHours.Text), Convert.ToInt32(uiDropDownListDayMins.Text), 0); objData.FlyAtDay = Convert.ToDateTime(Day.ToString()); TimeSpan Night = new TimeSpan(Convert.ToInt32(uiDropDownListNightHours.Text), Convert.ToInt32(uiDropDownListNightMins.Text), 0); objData.FlyAtNight = Convert.ToDateTime(Night.ToString()); if (!string.IsNullOrEmpty(uiTextBoxDepFuel.Text)) { objData.DepFule = Convert.ToInt32(uiTextBoxDepFuel.Text); } if (!string.IsNullOrEmpty(uiTextBoxArrFuel.Text)) { objData.ArrFule = Convert.ToInt32(uiTextBoxArrFuel.Text); } if (!string.IsNullOrEmpty(uiTextBoxNoOFPax_A.Text)) { objData.NoOfPax_A = Convert.ToInt32(uiTextBoxNoOFPax_A.Text); } if (!string.IsNullOrEmpty(uiTextBoxNoOFPax_CH.Text)) { objData.NoOfPax_C = Convert.ToInt32(uiTextBoxNoOFPax_CH.Text); } if (!string.IsNullOrEmpty(uiTextBoxNoOFPax_I.Text)) { objData.NoOfPax_I = Convert.ToInt32(uiTextBoxNoOFPax_I.Text); } if (!string.IsNullOrEmpty(uiTextBoxTOW.Text)) { objData.TOW = Convert.ToInt32(uiTextBoxTOW.Text); } if (!string.IsNullOrEmpty(uiTextBoxZFW.Text)) { objData.ZFW = Convert.ToInt32(uiTextBoxZFW.Text); } objData.Save(); } ClearSectorFields(); Response.Redirect("~/Operation/SectorsList.aspx?" + Request.QueryString.ToString()); }
protected void uiLinkButtonBack_Click(object sender, EventArgs e) { ClearSectorFields(); CurrentSector = null; uiPanelEdit.Visible = false; uiPanelViewAll.Visible = true; SearchSectors(); }
protected void uiLinkButtonSaveSector_Click(object sender, EventArgs e) { if (CurrentSector != null) { Sector objData = CurrentSector; objData.ReportID = CurrentFlightReport.ReportID; objData.From_AirportID = Convert.ToInt32(uiDropDownListSectorFrom.SelectedValue); objData.To_AirportID = Convert.ToInt32(uiDropDownListSectorTo.SelectedValue); objData.FlightNo = CurrentFlightReport.FlightNo; objData.IsPAX = true; objData.Save(); } else { Sector objData = new Sector(); objData.AddNew(); objData.ReportID = CurrentFlightReport.ReportID; objData.From_AirportID = Convert.ToInt32(uiDropDownListSectorFrom.SelectedValue); objData.To_AirportID = Convert.ToInt32(uiDropDownListSectorTo.SelectedValue); objData.FlightNo = CurrentFlightReport.FlightNo; objData.IsPAX = true; objData.Save(); } ClearSectorFields(); CurrentSector = null; BindSectors(); }
protected void uiLinkButtonSave_Click(object sender, EventArgs e) { if (!IsEdit) { CurrentSector = new Sector(); CurrentSector.AddNew(); } CurrentSector.AirCraft_AirPlaneID = 1; CurrentSector.FlightNo = uiTextBoxSectorFlightNo.Text; CurrentSector.SectorDate = DateTime.ParseExact(uiTextBoxDate.Text, "dd/MM/yyyy", null); CurrentSector.IsPAX = true; CurrentSector.From_AirportID = Convert.ToInt32(uiDropDownListSectorFrom.SelectedValue); CurrentSector.To_AirportID = Convert.ToInt32(uiDropDownListSectorTo.SelectedValue); CurrentSector.Save(); if (IsEdit) { SectorPilot Oldpilots = new SectorPilot(); Oldpilots.GetPilotBySectorID(CurrentSector.SectorID); Oldpilots.DeleteAll(); Oldpilots.Save(); SectorCrew OldCrew = new SectorCrew(); OldCrew.GetCrewBySectorID(CurrentSector.SectorID); OldCrew.DeleteAll(); OldCrew.Save(); } CurrentPilots = new SectorPilot(); for(int i=0 ;i< CurrentPilotsTable.Rows.Count ; i++) { CurrentPilots.AddNew(); CurrentPilots.SectorID = CurrentSector.SectorID; CurrentPilots.PilotID = Convert.ToInt32(CurrentPilotsTable.Rows[i]["PilotID"]); // CurrentPilots.PositionID = Convert.ToInt32(CurrentPilotsTable.Rows[i]["PositionID"]); } CurrentPilots.Save(); CurrentCrew = new SectorCrew(); for (int i = 0; i < CurrentCrewTable.Rows.Count; i++) { CurrentCrew.AddNew(); CurrentCrew.SectorID = CurrentSector.SectorID; CurrentCrew.CrewID = Convert.ToInt32(CurrentCrewTable.Rows[i]["CrewID"]); // CurrentCrew.PositionID = Convert.ToInt32(CurrentCrewTable.Rows[i]["PositionID"]); } CurrentCrew.Save(); if (MasterSector != null) { MasterSector.ReturnSectorID = CurrentSector.SectorID; CurrentSector.IsReturnSector = true; MasterSector.Save(); CurrentSector.Save(); } BindReportData(); uiPanelViewAll.Visible = true; uiPanelEdit.Visible = false; MasterSector = null; CurrentSector = null; CurrentCrew = null; CurrentPilots = null; CurrentCrewTable = null; CurrentPilotsTable = null; }
private void BindReportData() { Sector AllSectors = new Sector(); AllSectors.GetPAXSectors(); AllSectors.Sort = "SectorDate Desc"; //uiGridViewReports.DataSource = AllReports.DefaultView; //uiGridViewReports.DataBind(); uiRadGrid.DataSource = AllSectors.DefaultView; uiRadGrid.MasterTableView.FilterExpression = "([IsReturnSector] is null) OR ([IsReturnSector] = false)"; uiRadGrid.DataBind(); }
protected void uiLinkButtonAdd_Click(object sender, EventArgs e) { CurrentSector = null; Response.Redirect("~/Operation/InitiateSector.aspx?F=" + uiRadDatePickerFrom.SelectedDate.Value.ToString("dd/MM/yyyy") + "&T=" + uiRadDatePickerTo.SelectedDate.Value.ToString("dd/MM/yyyy")); }
protected void uiLinkButtonAdd_Click(object sender, EventArgs e) { uiPanelViewAll.Visible = false; uiPanelEdit.Visible = true; IsEdit = false; ClearFields(); CurrentSector = new Sector(); //CurrentFlightReport = new Flight(); }
protected void uiLinkButtonSaveSector_Click(object sender, EventArgs e) { if (CurrentSector != null) { Sector objData = CurrentSector; //objData.ReportID = CurrentFlightReport.ReportID; objData.SectorDate = DateTime.ParseExact(uiTextBoxDate.Text, "dd/MM/yyyy", null); objData.From_AirportID = Convert.ToInt32(uiDropDownListSectorFrom.SelectedValue); objData.To_AirportID = Convert.ToInt32(uiDropDownListSectorTo.SelectedValue); objData.FlightNo = uiTextBoxSectorFlightNo.Text; objData.IsHeavy = uiCheckBoxIsHeavy.Checked; objData.AirCraft_AirPlaneID = Convert.ToInt32(uiDropDownListAirCraftRegistration.SelectedValue); objData.IsPAX = false; TimeSpan STD = new TimeSpan(Convert.ToInt32(uiDropDownListSTDHours.Text), Convert.ToInt32(uiDropDownListSTDMins.Text), 0); objData.STD = Convert.ToDateTime(STD.ToString()); TimeSpan STA = new TimeSpan(Convert.ToInt32(uiDropDownListSTAHours.Text), Convert.ToInt32(uiDropDownListSTAMins.Text), 0); if (Convert.ToInt32(uiDropDownListSTAHours.Text) < Convert.ToInt32(uiDropDownListSTDHours.Text)) { objData.STA = Convert.ToDateTime(STA.ToString()).AddDays(1); } else { objData.STA = Convert.ToDateTime(STA.ToString()); } if (uiDropDownListClients.SelectedIndex > -1) { if (uiDropDownListClients.SelectedValue != "0") objData.ClientID = Convert.ToInt32(uiDropDownListClients.SelectedValue); else objData.SetColumnNull("ClientID"); } objData.Save(); } else { Sector objData = new Sector(); objData.AddNew(); //objData.ReportID = CurrentFlightReport.ReportID; objData.SectorDate = DateTime.ParseExact(uiTextBoxDate.Text, "dd/MM/yyyy", null); objData.From_AirportID = Convert.ToInt32(uiDropDownListSectorFrom.SelectedValue); objData.To_AirportID = Convert.ToInt32(uiDropDownListSectorTo.SelectedValue); objData.AirCraft_AirPlaneID = Convert.ToInt32(uiDropDownListAirCraftRegistration.SelectedValue); objData.FlightNo = uiTextBoxSectorFlightNo.Text; objData.IsHeavy = uiCheckBoxIsHeavy.Checked; objData.IsPAX = false; TimeSpan STD = new TimeSpan(Convert.ToInt32(uiDropDownListSTDHours.Text), Convert.ToInt32(uiDropDownListSTDMins.Text), 0); objData.STD = Convert.ToDateTime(STD.ToString()); TimeSpan STA = new TimeSpan(Convert.ToInt32(uiDropDownListSTAHours.Text), Convert.ToInt32(uiDropDownListSTAMins.Text), 0); if (Convert.ToInt32(uiDropDownListSTAHours.Text) < Convert.ToInt32(uiDropDownListSTDHours.Text)) { objData.STA = Convert.ToDateTime(STA.ToString()).AddDays(1); } else { objData.STA = Convert.ToDateTime(STA.ToString()); } if (uiDropDownListClients.SelectedIndex > -1) { if (uiDropDownListClients.SelectedValue != "0") objData.ClientID = Convert.ToInt32(uiDropDownListClients.SelectedValue); else objData.SetColumnNull("ClientID"); } objData.Save(); CurrentSector = null; } ClearSectorFields(); Response.Redirect("~/Operation/SectorsList.aspx?" + Request.QueryString.ToString()); }
private void SearchSectors() { Sector sectorObj = new Sector(); if (Request.QueryString["F"] != null && uiRadDatePickerFrom.SelectedDate == null) { uiRadDatePickerFrom.SelectedDate = DateTime.ParseExact(Request.QueryString["F"].ToString(), "dd/MM/yyyy", null); } if (uiRadDatePickerFrom.SelectedDate == null) { uiRadDatePickerFrom.SelectedDate = GetWeekStartDaTe(); } if (Request.QueryString["T"] != null && uiRadDatePickerTo.SelectedDate == null) { uiRadDatePickerTo.SelectedDate = DateTime.ParseExact(Request.QueryString["T"].ToString(), "dd/MM/yyyy", null); } if (uiRadDatePickerTo.SelectedDate == null) { uiRadDatePickerTo.SelectedDate = GetWeekStartDaTe().AddDays(7); } sectorObj.SearchSectors(uiTextBoxSearch.Text, (uiRadDatePickerFrom.SelectedDate != null) ? uiRadDatePickerFrom.SelectedDate.Value : DateTime.ParseExact("01/" + DateTime.Now.Month.ToString("00") + "/" + DateTime.Now.Year.ToString(), "dd/MM/yyyy", null) , (uiRadDatePickerTo.SelectedDate != null) ? uiRadDatePickerTo.SelectedDate.Value : DateTime.ParseExact(((DateTime.Now.Month != 2) ? "30" : "28") + "/" + DateTime.Now.Month.ToString("00") + "/" + DateTime.Now.Year.ToString(), "dd/MM/yyyy", null)); sectorObj.Sort = "SectorDate Desc"; if (uiRadDatePickerFrom.SelectedDate == null) { uiRadDatePickerFrom.SelectedDate = DateTime.ParseExact("01/" + DateTime.Now.Month.ToString("00") + "/" + DateTime.Now.Year.ToString(), "dd/MM/yyyy", null); } if (uiRadDatePickerTo.SelectedDate == null) { uiRadDatePickerTo.SelectedDate = DateTime.ParseExact(((DateTime.Now.Month != 2) ? "30" : "28") + "/" + DateTime.Now.Month.ToString("00") + "/" + DateTime.Now.Year.ToString(), "dd/MM/yyyy", null); } uiRadGridFlights.DataSource = sectorObj.DefaultView; uiRadGridFlights.DataBind(); }
/* protected void uiButtonSaveMaster_Click(object sender, EventArgs e) { if (CurrentFlightReport != null) { Flight objData = CurrentFlightReport; //objData.FlightNo = uiTextBoxFlightNo.Text; objData.AirCraft_AirPlaneID = Convert.ToInt32(uiDropDownListAirCraftRegistration.SelectedValue); objData.ReportDate = DateTime.ParseExact(uiTextBoxDate.Text, "dd/MM/yyyy", null); objData.IsHeavy = uiCheckBoxIsHeavy.Checked; objData.Save(); } else { Flight objData = new Flight(); objData.AddNew(); //objData.FlightNo = uiTextBoxFlightNo.Text; objData.AirCraft_AirPlaneID = Convert.ToInt32(uiDropDownListAirCraftRegistration.SelectedValue); objData.ReportDate = DateTime.ParseExact(uiTextBoxDate.Text, "dd/MM/yyyy", null); objData.IsHeavy = uiCheckBoxIsHeavy.Checked; objData.Save(); CurrentFlightReport = objData; EnableDisableTabs(); } }*/ protected void uiRadGridFlights_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { if (e.CommandName == "EditSector") { Sector objData = new Sector(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); CurrentSector = objData; FillSectorData(); uiPanelEdit.Visible = true; uiPanelViewAll.Visible = false; EnableDisableTabs(); //BindSectors(); BindCrew(); BindPilots(); } else if (e.CommandName == "DeleteSector") { Sector objData = new Sector(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); SectorCrew crew = new SectorCrew(); crew.GetCrewBySectorID(objData.SectorID); SectorPilot pilots = new SectorPilot(); pilots.GetPilotBySectorID(objData.SectorID); pilots.DeleteAll(); pilots.Save(); crew.DeleteAll(); crew.Save(); //sectors.DeleteAll(); //sectors.Save(); objData.MarkAsDeleted(); objData.Save(); //BindReportData(); SearchSectors(); } else if (e.CommandName == "ViewReport") { Response.Redirect("FlightReport.aspx?RID=" + e.CommandArgument.ToString()); } }
/*****************************************************************************************/ /**************** Sector section ********************/ protected void uiLinkButtonSaveSector_Click(object sender, EventArgs e) { if (CurrentSector != null) { Sector objData = CurrentSector; //objData.ReportID = CurrentFlightReport.ReportID; objData.SectorDate = DateTime.ParseExact(uiTextBoxDate.Text, "dd/MM/yyyy", null); objData.From_AirportID = Convert.ToInt32(uiDropDownListSectorFrom.SelectedValue); objData.To_AirportID = Convert.ToInt32(uiDropDownListSectorTo.SelectedValue); objData.FlightNo = uiTextBoxSectorFlightNo.Text; objData.IsHeavy = uiCheckBoxIsHeavy.Checked; objData.AirCraft_AirPlaneID = Convert.ToInt32(uiDropDownListAirCraftRegistration.SelectedValue); objData.IsPAX = false; if (!string.IsNullOrEmpty(uiTextBoxFule.Text)) { objData.FuleUplifted = Convert.ToInt32(uiTextBoxFule.Text); } if (!string.IsNullOrEmpty(uiTextBoxActualBurn.Text)) { objData.ActualBurnOff = Convert.ToInt32(uiTextBoxActualBurn.Text); } if (!string.IsNullOrEmpty(uiTextBoxPlanBurnOff.Text)) { objData.StandardBurnOff = Convert.ToInt32(uiTextBoxPlanBurnOff.Text); } TimeSpan STD = new TimeSpan(Convert.ToInt32(uiDropDownListSTDHours.Text), Convert.ToInt32(uiDropDownListSTDMins.Text), 0); objData.STD = Convert.ToDateTime(STD.ToString()); TimeSpan ATD = new TimeSpan(Convert.ToInt32(uiDropDownListATDHours.Text), Convert.ToInt32(uiDropDownListATDMins.Text), 0); objData.ATD = Convert.ToDateTime(ATD.ToString()); TimeSpan ATA = new TimeSpan(Convert.ToInt32(uiDropDownListATAHours.Text), Convert.ToInt32(uiDropDownListATAMins.Text), 0); if (Convert.ToInt32(uiDropDownListATAHours.Text) < Convert.ToInt32(uiDropDownListATDHours.Text)) { objData.ATA = Convert.ToDateTime(ATA.ToString()).AddDays(1); } else { objData.ATA = Convert.ToDateTime(ATA.ToString()); } TimeSpan OFF = new TimeSpan(Convert.ToInt32(uiDropDownListOFFHours.Text), Convert.ToInt32(uiDropDownListOFFMins.Text), 0); objData.ChoxOff = Convert.ToDateTime(OFF.ToString()); TimeSpan On = new TimeSpan(Convert.ToInt32(uiDropDownListOnHours.Text), Convert.ToInt32(uiDropDownListOnMins.Text), 0); if (Convert.ToInt32(uiDropDownListOnHours.Text) < Convert.ToInt32(uiDropDownListOFFHours.Text)) { objData.ChoxOn = Convert.ToDateTime(On.ToString()).AddDays(1); } else { objData.ChoxOn = Convert.ToDateTime(On.ToString()); } TimeSpan STA = new TimeSpan(Convert.ToInt32(uiDropDownListSTAHours.Text), Convert.ToInt32(uiDropDownListSTAMins.Text), 0); if (Convert.ToInt32(uiDropDownListSTAHours.Text) < Convert.ToInt32(uiDropDownListSTDHours.Text)) { objData.STA = Convert.ToDateTime(STA.ToString()).AddDays(1); } else { objData.STA = Convert.ToDateTime(STA.ToString()); } if (!string.IsNullOrEmpty(uiDropDownListDelay1Code.SelectedValue)) { objData.DepDelayID1 = Convert.ToInt32(uiDropDownListDelay1Code.SelectedValue); TimeSpan Delay1 = new TimeSpan(Convert.ToInt32(uiDropDownListDelay1Hours.Text), Convert.ToInt32(uiDropDownListDelay1Mins.Text), 0); objData.DepDelayTime1 = Convert.ToDateTime(Delay1.ToString()); } if (!string.IsNullOrEmpty(uiDropDownListDelay2Code.SelectedValue)) { objData.DepDelayID2 = Convert.ToInt32(uiDropDownListDelay2Code.SelectedValue); TimeSpan Delay2 = new TimeSpan(Convert.ToInt32(uiDropDownListDelay2Hours.Text), Convert.ToInt32(uiDropDownListDelay2Mins.Text), 0); objData.DepDelayTime2 = Convert.ToDateTime(Delay2.ToString()); } if (!string.IsNullOrEmpty(uiDropDownListDelay3Code.SelectedValue)) { objData.DepDelayID3 = Convert.ToInt32(uiDropDownListDelay3Code.SelectedValue); TimeSpan Delay3 = new TimeSpan(Convert.ToInt32(uiDropDownListDelay3Hours.Text), Convert.ToInt32(uiDropDownListDelay3Mins.Text), 0); objData.DepDelayTime3 = Convert.ToDateTime(Delay3.ToString()); } if (!string.IsNullOrEmpty(uiDropDownListArrDelay1Code.SelectedValue)) { objData.ArrDelayID1 = Convert.ToInt32(uiDropDownListArrDelay1Code.SelectedValue); TimeSpan ArrDelay1 = new TimeSpan(Convert.ToInt32(uiDropDownListArrDelay1Hours.Text), Convert.ToInt32(uiDropDownListArrDelay1Mins.Text), 0); objData.ArrDelayTime1 = Convert.ToDateTime(ArrDelay1.ToString()); } if (!string.IsNullOrEmpty(uiDropDownListArrDelay2Code.SelectedValue)) { objData.ArrDelayID2 = Convert.ToInt32(uiDropDownListArrDelay2Code.SelectedValue); TimeSpan ArrDelay2 = new TimeSpan(Convert.ToInt32(uiDropDownListArrDelay2Hours.Text), Convert.ToInt32(uiDropDownListArrDelay2Mins.Text), 0); objData.ArrDelayTime2 = Convert.ToDateTime(ArrDelay2.ToString()); } if (!string.IsNullOrEmpty(uiDropDownListArrDelay3Code.SelectedValue)) { objData.ArrDelayID3 = Convert.ToInt32(uiDropDownListArrDelay3Code.SelectedValue); TimeSpan ArrDelay3 = new TimeSpan(Convert.ToInt32(uiDropDownListArrDelay3Hours.Text), Convert.ToInt32(uiDropDownListArrDelay3Mins.Text), 0); objData.ArrDelayTime3 = Convert.ToDateTime(ArrDelay3.ToString()); } TimeSpan Day = new TimeSpan(Convert.ToInt32(uiDropDownListDayHours.Text), Convert.ToInt32(uiDropDownListDayMins.Text), 0); objData.FlyAtDay = Convert.ToDateTime(Day.ToString()); TimeSpan Night = new TimeSpan(Convert.ToInt32(uiDropDownListNightHours.Text), Convert.ToInt32(uiDropDownListNightMins.Text), 0); objData.FlyAtNight = Convert.ToDateTime(Night.ToString()); if (!string.IsNullOrEmpty(uiTextBoxDepFuel.Text)) { objData.DepFule = Convert.ToInt32(uiTextBoxDepFuel.Text); } if (!string.IsNullOrEmpty(uiTextBoxArrFuel.Text)) { objData.ArrFule = Convert.ToInt32(uiTextBoxArrFuel.Text); } if (!string.IsNullOrEmpty(uiTextBoxNoOFPax_A.Text)) { objData.NoOfPax_A = Convert.ToInt32(uiTextBoxNoOFPax_A.Text); } if (!string.IsNullOrEmpty(uiTextBoxNoOFPax_CH.Text)) { objData.NoOfPax_C = Convert.ToInt32(uiTextBoxNoOFPax_CH.Text); } if (!string.IsNullOrEmpty(uiTextBoxNoOFPax_I.Text)) { objData.NoOfPax_I = Convert.ToInt32(uiTextBoxNoOFPax_I.Text); } if (!string.IsNullOrEmpty(uiTextBoxTOW.Text)) { objData.TOW = Convert.ToInt32(uiTextBoxTOW.Text); } if (!string.IsNullOrEmpty(uiTextBoxZFW.Text)) { objData.ZFW = Convert.ToInt32(uiTextBoxZFW.Text); } objData.Save(); } else { Sector objData = new Sector(); objData.AddNew(); //objData.ReportID = CurrentFlightReport.ReportID; objData.SectorDate = DateTime.ParseExact(uiTextBoxDate.Text, "dd/MM/yyyy", null); objData.From_AirportID = Convert.ToInt32(uiDropDownListSectorFrom.SelectedValue); objData.To_AirportID = Convert.ToInt32(uiDropDownListSectorTo.SelectedValue); objData.AirCraft_AirPlaneID = Convert.ToInt32(uiDropDownListAirCraftRegistration.SelectedValue); objData.FlightNo = uiTextBoxSectorFlightNo.Text; objData.IsHeavy = uiCheckBoxIsHeavy.Checked; objData.IsPAX = false; if (!string.IsNullOrEmpty(uiTextBoxFule.Text)) { objData.FuleUplifted = Convert.ToInt32(uiTextBoxFule.Text); } if (!string.IsNullOrEmpty(uiTextBoxActualBurn.Text)) { objData.ActualBurnOff = Convert.ToInt32(uiTextBoxActualBurn.Text); } if (!string.IsNullOrEmpty(uiTextBoxPlanBurnOff.Text)) { objData.StandardBurnOff = Convert.ToInt32(uiTextBoxPlanBurnOff.Text); } TimeSpan STD = new TimeSpan(Convert.ToInt32(uiDropDownListSTDHours.Text), Convert.ToInt32(uiDropDownListSTDMins.Text), 0); objData.STD = Convert.ToDateTime(STD.ToString()); TimeSpan ATD = new TimeSpan(Convert.ToInt32(uiDropDownListATDHours.Text), Convert.ToInt32(uiDropDownListATDMins.Text), 0); objData.ATD = Convert.ToDateTime(ATD.ToString()); TimeSpan ATA = new TimeSpan(Convert.ToInt32(uiDropDownListATAHours.Text), Convert.ToInt32(uiDropDownListATAMins.Text), 0); if (Convert.ToInt32(uiDropDownListATAHours.Text) < Convert.ToInt32(uiDropDownListATDHours.Text)) { objData.ATA = Convert.ToDateTime(ATA.ToString()).AddDays(1); } else { objData.ATA = Convert.ToDateTime(ATA.ToString()); } TimeSpan OFF = new TimeSpan(Convert.ToInt32(uiDropDownListOFFHours.Text), Convert.ToInt32(uiDropDownListOFFMins.Text), 0); objData.ChoxOff = Convert.ToDateTime(OFF.ToString()); TimeSpan On = new TimeSpan(Convert.ToInt32(uiDropDownListOnHours.Text), Convert.ToInt32(uiDropDownListOnMins.Text), 0); if (Convert.ToInt32(uiDropDownListOnHours.Text) < Convert.ToInt32(uiDropDownListOFFHours.Text)) { objData.ChoxOn = Convert.ToDateTime(On.ToString()).AddDays(1); } else { objData.ChoxOn = Convert.ToDateTime(On.ToString()); } TimeSpan STA = new TimeSpan(Convert.ToInt32(uiDropDownListSTAHours.Text), Convert.ToInt32(uiDropDownListSTAMins.Text), 0); if (Convert.ToInt32(uiDropDownListSTAHours.Text) < Convert.ToInt32(uiDropDownListSTDHours.Text)) { objData.STA = Convert.ToDateTime(STA.ToString()).AddDays(1); } else { objData.STA = Convert.ToDateTime(STA.ToString()); } if (!string.IsNullOrEmpty(uiDropDownListDelay1Code.SelectedValue)) { objData.DepDelayID1 = Convert.ToInt32(uiDropDownListDelay1Code.SelectedValue); TimeSpan Delay1 = new TimeSpan(Convert.ToInt32(uiDropDownListDelay1Hours.Text), Convert.ToInt32(uiDropDownListDelay1Mins.Text), 0); objData.DepDelayTime1 = Convert.ToDateTime(Delay1.ToString()); } if (!string.IsNullOrEmpty(uiDropDownListDelay2Code.SelectedValue)) { objData.DepDelayID2 = Convert.ToInt32(uiDropDownListDelay2Code.SelectedValue); TimeSpan Delay2 = new TimeSpan(Convert.ToInt32(uiDropDownListDelay2Hours.Text), Convert.ToInt32(uiDropDownListDelay2Mins.Text), 0); objData.DepDelayTime2 = Convert.ToDateTime(Delay2.ToString()); } if (!string.IsNullOrEmpty(uiDropDownListDelay3Code.SelectedValue)) { objData.DepDelayID3 = Convert.ToInt32(uiDropDownListDelay3Code.SelectedValue); TimeSpan Delay3 = new TimeSpan(Convert.ToInt32(uiDropDownListDelay3Hours.Text), Convert.ToInt32(uiDropDownListDelay3Mins.Text), 0); objData.DepDelayTime3 = Convert.ToDateTime(Delay3.ToString()); } if (!string.IsNullOrEmpty(uiDropDownListArrDelay1Code.SelectedValue)) { objData.ArrDelayID1 = Convert.ToInt32(uiDropDownListArrDelay1Code.SelectedValue); TimeSpan ArrDelay1 = new TimeSpan(Convert.ToInt32(uiDropDownListArrDelay1Hours.Text), Convert.ToInt32(uiDropDownListArrDelay1Mins.Text), 0); objData.ArrDelayTime1 = Convert.ToDateTime(ArrDelay1.ToString()); } if (!string.IsNullOrEmpty(uiDropDownListArrDelay2Code.SelectedValue)) { objData.ArrDelayID2 = Convert.ToInt32(uiDropDownListArrDelay2Code.SelectedValue); TimeSpan ArrDelay2 = new TimeSpan(Convert.ToInt32(uiDropDownListArrDelay2Hours.Text), Convert.ToInt32(uiDropDownListArrDelay2Mins.Text), 0); objData.ArrDelayTime2 = Convert.ToDateTime(ArrDelay2.ToString()); } if (!string.IsNullOrEmpty(uiDropDownListArrDelay3Code.SelectedValue)) { objData.ArrDelayID3 = Convert.ToInt32(uiDropDownListArrDelay3Code.SelectedValue); TimeSpan ArrDelay3 = new TimeSpan(Convert.ToInt32(uiDropDownListArrDelay3Hours.Text), Convert.ToInt32(uiDropDownListArrDelay3Mins.Text), 0); objData.ArrDelayTime3 = Convert.ToDateTime(ArrDelay3.ToString()); } TimeSpan Day = new TimeSpan(Convert.ToInt32(uiDropDownListDayHours.Text), Convert.ToInt32(uiDropDownListDayMins.Text), 0); objData.FlyAtDay = Convert.ToDateTime(Day.ToString()); TimeSpan Night = new TimeSpan(Convert.ToInt32(uiDropDownListNightHours.Text), Convert.ToInt32(uiDropDownListNightMins.Text), 0); objData.FlyAtNight = Convert.ToDateTime(Night.ToString()); if (!string.IsNullOrEmpty(uiTextBoxDepFuel.Text)) { objData.DepFule = Convert.ToInt32(uiTextBoxDepFuel.Text); } if (!string.IsNullOrEmpty(uiTextBoxArrFuel.Text)) { objData.ArrFule = Convert.ToInt32(uiTextBoxArrFuel.Text); } if (!string.IsNullOrEmpty(uiTextBoxNoOFPax_A.Text)) { objData.NoOfPax_A = Convert.ToInt32(uiTextBoxNoOFPax_A.Text); } if (!string.IsNullOrEmpty(uiTextBoxNoOFPax_CH.Text)) { objData.NoOfPax_C = Convert.ToInt32(uiTextBoxNoOFPax_CH.Text); } if (!string.IsNullOrEmpty(uiTextBoxNoOFPax_I.Text)) { objData.NoOfPax_I = Convert.ToInt32(uiTextBoxNoOFPax_I.Text); } if (!string.IsNullOrEmpty(uiTextBoxTOW.Text)) { objData.TOW = Convert.ToInt32(uiTextBoxTOW.Text); } if (!string.IsNullOrEmpty(uiTextBoxZFW.Text)) { objData.ZFW = Convert.ToInt32(uiTextBoxZFW.Text); } objData.Save(); CurrentSector = objData; } EnableDisableTabs(); //ClearSectorFields(); //CurrentSector = null; //BindSectors(); }
protected void uiLinkButtonCancel_Click(object sender, EventArgs e) { ClearFields(); // CurrentFlightReport = null; CurrentSector = null; uiPanelEdit.Visible = false; uiPanelViewAll.Visible = true; }
protected void uiLinkButtonBack_Click(object sender, EventArgs e) { CurrentSector = null; Response.Redirect("~/Operation/SectorsList.aspx?" + Request.QueryString.ToString()); }
protected void uiRadGridFlights_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { if (e.CommandName == "EditSectorDetails") { Sector objData = new Sector(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); CurrentSector = objData; if (Roles.IsUserInRole("Operation") || Roles.IsUserInRole("Dispatcher")) { Response.Redirect("~/Operation/SectorDetails.aspx?F=" + uiRadDatePickerFrom.SelectedDate.Value.ToString("dd/MM/yyyy") + "&T=" + uiRadDatePickerTo.SelectedDate.Value.ToString("dd/MM/yyyy")); } else if (Roles.IsUserInRole("Commercial")) { Response.Redirect("~/Operation/InitiateSector.aspx?F=" + uiRadDatePickerFrom.SelectedDate.Value.ToString("dd/MM/yyyy") + "&T=" + uiRadDatePickerTo.SelectedDate.Value.ToString("dd/MM/yyyy")); } } else if (e.CommandName == "EditSectorPilots") { Sector objData = new Sector(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); CurrentSector = objData; Response.Redirect("~/Operation/SectorPilots.aspx?F=" + uiRadDatePickerFrom.SelectedDate.Value.ToString("dd/MM/yyyy") + "&T=" + uiRadDatePickerTo.SelectedDate.Value.ToString("dd/MM/yyyy")); } else if (e.CommandName == "EditSectorCrew") { Sector objData = new Sector(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); CurrentSector = objData; Response.Redirect("~/Operation/SectorCabinCrew.aspx?F=" + uiRadDatePickerFrom.SelectedDate.Value.ToString("dd/MM/yyyy") + "&T=" + uiRadDatePickerTo.SelectedDate.Value.ToString("dd/MM/yyyy")); } else if (e.CommandName == "DeleteSector") { Sector objData = new Sector(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); CurrentSector = objData; SectorCrew crew = new SectorCrew(); crew.GetCrewBySectorID(objData.SectorID); SectorPilot pilots = new SectorPilot(); pilots.GetPilotBySectorID(objData.SectorID); pilots.DeleteAll(); pilots.Save(); crew.DeleteAll(); crew.Save(); objData.MarkAsDeleted(); objData.Save(); CurrentSector = null; SearchSectors(); } else if (e.CommandName == "ViewReport") { Sector objData = new Sector(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); CurrentSector = objData; Response.Redirect("FlightReport.aspx?RID=" + e.CommandArgument.ToString()); } }
protected void uiButtonSearch_Click(object sender, EventArgs e) { Sector r = new Sector(); r.SearchPAXSectors(uiTextBoxSearch.Text, !string.IsNullOrEmpty(uiTextBoxFromDate.Text) ? DateTime.ParseExact(uiTextBoxFromDate.Text, "dd/MM/yyyy", null) : DateTime.ParseExact("01/01/1900", "dd/MM/yyyy", null) , !string.IsNullOrEmpty(uiTextBoxToDate.Text) ? DateTime.ParseExact(uiTextBoxToDate.Text, "dd/MM/yyyy", null) : DateTime.MaxValue); r.Sort = "SectorDate Desc"; uiRadGrid.DataSource = r.DefaultView; uiRadGrid.DataBind(); }
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(); } }
protected void uiLinkButtonCancel_Click(object sender, EventArgs e) { BindReportData(); uiPanelViewAll.Visible = true; uiPanelEdit.Visible = false; MasterSector = null; CurrentSector = null; CurrentCrew = null; CurrentPilots = null; CurrentCrewTable = null; CurrentPilotsTable = null; ClearFields(); }
protected void uiGridViewSectors_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "DeleteSector") { Sector objData = new Sector(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); objData.MarkAsDeleted(); objData.Save(); BindSectors(); } else if (e.CommandName == "EditSector") { Sector objData = new Sector(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); uiDropDownListSectorFrom.SelectedValue = objData.From_AirportID.ToString(); uiDropDownListSectorTo.SelectedValue = objData.To_AirportID.ToString(); //uiTextBoxSectorFlightNo.Text = objData.FlightNo; CurrentSector = objData; } }
protected void uiRadGrid_ItemCommand(object sender, GridCommandEventArgs e) { if (e.CommandName == "EditSector") { Sector objData = new Sector(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); uiTextBoxSectorFlightNo.Text = objData.FlightNo; uiTextBoxDate.Text = objData.SectorDate.ToString("dd/MM/yyyy"); uiDropDownListSectorFrom.SelectedValue = objData.From_AirportID.ToString(); uiDropDownListSectorTo.SelectedValue = objData.To_AirportID.ToString(); CurrentSector = objData; IsEdit = true; CanLoad = true; uiPanelEdit.Visible = true; uiPanelViewAll.Visible = false; // BindSectors(); BindCrew(); BindPilots(); CanLoad = false; } else if (e.CommandName == "DeleteSector") { Sector objData = new Sector(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); if ((objData.IsColumnNull("IsReturnSector") || objData.IsReturnSector == false) && !objData.IsColumnNull("ReturnSectorID")) { Sector ReturnFlight = new Sector(); ReturnFlight.LoadByPrimaryKey(objData.ReturnSectorID); ReturnFlight.IsReturnSector = false; ReturnFlight.Save(); } SectorCrew crew = new SectorCrew(); crew.GetCrewBySectorID(objData.SectorID); SectorPilot pilots = new SectorPilot(); pilots.GetPilotBySectorID(objData.SectorID); pilots.DeleteAll(); pilots.Save(); crew.DeleteAll(); crew.Save(); objData.MarkAsDeleted(); objData.Save(); BindReportData(); } }
protected void uiLinkButtonCancelSector_Click(object sender, EventArgs e) { ClearSectorFields(); CurrentSector = null; }
private void InitializeReturnFlight() { MasterSector = CurrentSector; IsEdit = false; uiTextBoxDate.Text = ""; uiTextBoxSectorFlightNo.Text = ""; uiDropDownListSectorFrom.SelectedIndex = 0; uiDropDownListSectorTo.SelectedIndex = 0; }
protected void uiLinkButtonAdd_Click(object sender, EventArgs e) { uiPanelViewAll.Visible = false; uiPanelEdit.Visible = true; ClearFields(); //CurrentFlightReport = null; CurrentSector = null; EnableDisableTabs(); }