Exemplo n.º 1
0
        private void LoadDDLs()
        {
            Pilot Allpilots = new Pilot();
            Allpilots.LoadAll();
            uiDropDownListPilots.DataSource = Allpilots.DefaultView;
            uiDropDownListPilots.DataTextField = "ShortName";
            uiDropDownListPilots.DataValueField = "PilotID";
            uiDropDownListPilots.DataBind();
            uiDropDownListPilots.Items.Insert(0, new ListItem("Select Pilot", ""));

            AirPlane AllPlanes = new AirPlane();
            AllPlanes.LoadAll();
            uiDropDownListAirplane.DataSource = AllPlanes.DefaultView;
            uiDropDownListAirplane.DataTextField = "Name";
            uiDropDownListAirplane.DataValueField = "AirPlaneID";
            uiDropDownListAirplane.DataBind();
            uiDropDownListAirplane.Items.Insert(0, new ListItem("All", "0"));

            AirPort AllAirports = new AirPort();
            AllAirports.LoadAll();
            uiDropDownListFrom.DataSource = AllAirports.DefaultView;
            uiDropDownListFrom.DataTextField = "IATACode";
            uiDropDownListFrom.DataValueField = "AirPortID";
            uiDropDownListFrom.DataBind();
            uiDropDownListFrom.Items.Insert(0, new ListItem("Select Airport", "0"));

            uiDropDownListTo.DataSource = AllAirports.DefaultView;
            uiDropDownListTo.DataTextField = "IATACode";
            uiDropDownListTo.DataValueField = "AirPortID";
            uiDropDownListTo.DataBind();
            uiDropDownListTo.Items.Insert(0, new ListItem("Select Airport", "0"));
        }
Exemplo n.º 2
0
        private void LoadDDLs()
        {
            Pilot Allpilots = new Pilot();
            Allpilots.GetAllPilots();
            uiDropDownListPilot.DataSource = Allpilots.DefaultView;
            uiDropDownListPilot.DataTextField = "DisplayName";
            uiDropDownListPilot.DataValueField = "PilotID";
            uiDropDownListPilot.DataBind();
            uiDropDownListPilot.Items.Insert(0, new ListItem("Select Pilot", ""));

            Pilot AllCopilots = new Pilot();
            AllCopilots.GetAllCoPilots();
            uiDropDownListCoPilot.DataSource = AllCopilots.DefaultView;
            uiDropDownListCoPilot.DataTextField = "DisplayName";
            uiDropDownListCoPilot.DataValueField = "PilotID";
            uiDropDownListCoPilot.DataBind();
            uiDropDownListCoPilot.Items.Insert(0, new ListItem("Select Co-Pilot", ""));

            Position AllPositions = new Position();
            AllPositions.LoadAll();
            uiDropDownListPilotPos.DataSource = AllPositions.DefaultView;
            uiDropDownListPilotPos.DataTextField = "Title";
            uiDropDownListPilotPos.DataValueField = "PositionID";
            uiDropDownListPilotPos.DataBind();
            uiDropDownListPilotPos.Items.Insert(0, new ListItem("Select Position", ""));

            uiDropDownListCOPos.DataSource = AllPositions.DefaultView;
            uiDropDownListCOPos.DataTextField = "Title";
            uiDropDownListCOPos.DataValueField = "PositionID";
            uiDropDownListCOPos.DataBind();
            uiDropDownListCOPos.Items.Insert(0, new ListItem("Select Position", ""));

            Crew AllCrew = new Crew();
            AllCrew.LoadAll();
            uiDropDownListCrew.DataSource = AllCrew.DefaultView;
            uiDropDownListCrew.DataTextField = "Name";
            uiDropDownListCrew.DataValueField = "CrewID";
            uiDropDownListCrew.DataBind();
            uiDropDownListCrew.Items.Insert(0, new ListItem("Select Member", ""));

            uiDropDownListCrewPos.DataSource = AllPositions.DefaultView; ;
            uiDropDownListCrewPos.DataTextField = "Title";
            uiDropDownListCrewPos.DataValueField = "PositionID";
            uiDropDownListCrewPos.DataBind();
            uiDropDownListCrewPos.Items.Insert(0, new ListItem("Select Position", ""));

            AirPort AllAirports = new AirPort();
            AllAirports.LoadAll();
            uiDropDownListSectorFrom.DataSource = AllAirports.DefaultView;
            uiDropDownListSectorFrom.DataTextField = "IATACode";
            uiDropDownListSectorFrom.DataValueField = "AirPortID";
            uiDropDownListSectorFrom.DataBind();
            uiDropDownListSectorFrom.Items.Insert(0, new ListItem("Select Airport", ""));

            uiDropDownListSectorTo.DataSource = AllAirports.DefaultView;
            uiDropDownListSectorTo.DataTextField = "IATACode";
            uiDropDownListSectorTo.DataValueField = "AirPortID";
            uiDropDownListSectorTo.DataBind();
            uiDropDownListSectorTo.Items.Insert(0, new ListItem("Select Airport", ""));

            AirPlane Ap = new AirPlane();
            Ap.LoadAll();
            uiDropDownListAirCraftRegistration.DataSource = Ap.DefaultView;
            uiDropDownListAirCraftRegistration.DataTextField = "Name";
            uiDropDownListAirCraftRegistration.DataValueField = "AirPlaneID";
            uiDropDownListAirCraftRegistration.DataBind();
        }
        private void LoadDDLs()
        {
            AirPort AllAirports = new AirPort();
            AllAirports.LoadAll();
            uiDropDownListSectorFrom.DataSource = AllAirports.DefaultView;
            uiDropDownListSectorFrom.DataTextField = "IATACode";
            uiDropDownListSectorFrom.DataValueField = "AirPortID";
            uiDropDownListSectorFrom.DataBind();
            uiDropDownListSectorFrom.Items.Insert(0, new ListItem("Select Airport", "0"));

            uiDropDownListSectorTo.DataSource = AllAirports.DefaultView;
            uiDropDownListSectorTo.DataTextField = "IATACode";
            uiDropDownListSectorTo.DataValueField = "AirPortID";
            uiDropDownListSectorTo.DataBind();
            uiDropDownListSectorTo.Items.Insert(0, new ListItem("Select Airport", "0"));

            AirPlane Ap = new AirPlane();
            Ap.LoadAll();
            uiDropDownListAirCraftRegistration.DataSource = Ap.DefaultView;
            uiDropDownListAirCraftRegistration.DataTextField = "Name";
            uiDropDownListAirCraftRegistration.DataValueField = "AirPlaneID";
            uiDropDownListAirCraftRegistration.DataBind();

            SectorClients SC = new SectorClients();
            SC.LoadAll();
            uiDropDownListClients.DataSource = SC.DefaultView;
            uiDropDownListClients.DataTextField = "Name";
            uiDropDownListClients.DataValueField = "ClientID";
            uiDropDownListClients.DataBind();
            uiDropDownListClients.Items.Insert(0, new ListItem("Select Client", "0"));
        }
Exemplo n.º 4
0
        protected void uiRadGridFlights_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item.ItemType == Telerik.Web.UI.GridItemType.Item || e.Item.ItemType == Telerik.Web.UI.GridItemType.AlternatingItem)
            {
                DataRowView row = (DataRowView)e.Item.DataItem;
                AirPlane plane = new AirPlane();
                plane.LoadByPrimaryKey(Convert.ToInt32(row["AirCraft_AirPlaneID"].ToString()));
                Label l = (Label)e.Item.FindControl("uiLabelAirCraft");
                l.Text = plane.Name;

                //Sector sectors = new Sector();
                //sectors.GetSectorsByFlightID(Convert.ToInt32(row["ReportID"].ToString()));
                //foreach (DataRowView item in sectors.DefaultView)
                //{
                if (!string.IsNullOrEmpty(row["ChoxOn"].ToString()) && !string.IsNullOrEmpty(row["ChoxOff"].ToString()))
                {
                    if (DateTime.Parse(row["ChoxOn"].ToString()).Subtract(DateTime.Parse(row["ChoxOff"].ToString())) == TimeSpan.Zero)
                    {
                        e.Item.BackColor = Color.FromArgb(240, 176, 106);
                        //break;
                    }
                    else
                    {
                        e.Item.BackColor = Color.LightBlue;
                    }
                }
                else
                {
                    e.Item.BackColor = Color.FromArgb(240, 176, 106);
                }

                if (Roles.IsUserInRole("Commercial") || Roles.IsUserInRole("SuperAdmin") || Roles.IsUserInRole("Operation"))
                {
                    LinkButton delButton = (LinkButton)e.Item.FindControl("uiLinkButtonDelete");
                    if(delButton != null)
                        delButton.Visible = true;
                }

                if (Roles.IsUserInRole("Operation") || Roles.IsUserInRole("SuperAdmin") )
                {
                    LinkButton delButton = (LinkButton)e.Item.FindControl("uiLinkButtonEditPilots");
                    if (delButton != null)
                        delButton.Visible = true;
                }

                if (Roles.IsUserInRole("CabinCrew Admin") || Roles.IsUserInRole("SuperAdmin"))
                {
                    LinkButton delButton = (LinkButton)e.Item.FindControl("uiLinkButtonCrew");
                    if (delButton != null)
                        delButton.Visible = true;
                }
                //}
            }
        }
Exemplo n.º 5
0
        protected void uiRadGridFlights_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item.ItemType == Telerik.Web.UI.GridItemType.Item || e.Item.ItemType == Telerik.Web.UI.GridItemType.AlternatingItem)
            {
                DataRowView row = (DataRowView)e.Item.DataItem;
                AirPlane plane = new AirPlane();
                plane.LoadByPrimaryKey(Convert.ToInt32(row["AirCraft_AirPlaneID"].ToString()));
                Label l = (Label)e.Item.FindControl("uiLabelAirCraft");
                l.Text = plane.Name;

                //Sector sectors = new Sector();
                //sectors.GetSectorsByFlightID(Convert.ToInt32(row["ReportID"].ToString()));
                //foreach (DataRowView item in sectors.DefaultView)
                //{
                if (!string.IsNullOrEmpty(row["ChoxOn"].ToString()) && !string.IsNullOrEmpty(row["ChoxOff"].ToString()))
                {
                    if (DateTime.Parse(row["ChoxOn"].ToString()).Subtract(DateTime.Parse(row["ChoxOff"].ToString())) == TimeSpan.Zero)
                    {
                        e.Item.BackColor = Color.FromArgb(240,176,106);
                        //break;
                    }
                    else
                    {
                        e.Item.BackColor = Color.LightBlue;
                    }
                }
                else
                {
                    e.Item.BackColor = Color.FromArgb(240, 176, 106);
                }
                //}
            }
        }