当前位置: 首页>>代码示例>>C#>>正文


C# Route.GetByID方法代码示例

本文整理汇总了C#中Route.GetByID方法的典型用法代码示例。如果您正苦于以下问题:C# Route.GetByID方法的具体用法?C# Route.GetByID怎么用?C# Route.GetByID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Route的用法示例。


在下文中一共展示了Route.GetByID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: bindVoyageInfo

        //航次基本信息绑定
        private void bindVoyageInfo(string voyageid)
        {
            VoyageInfo vi = new VoyageInfo();
            Voyage v = new Voyage();

            vi = v.GetByID(voyageid);

            string voyageName = vi.Name;
            string beginDate = vi.BeginDate.ToString();
            string endDate = vi.EndDate.ToString();
            string routeId = vi.RouteID.ToString();

            Route r = new Route();
            RouteInfo ri = new RouteInfo();

            ri = r.GetByID(routeId);
            float distance = ri.Distance;

            Ship ship = new Ship();
            ShipInfo si = new ShipInfo();
            si = ship.GetByID(vi.ShipID.ToString());

            string shipName = si.Name;
            string chiefEngineer = si.ChiefEngineer;
            string captain = si.Captain;
            string generalManager = si.GeneralManager;

            Relation_RoutePort rrp = new Relation_RoutePort();
            Relation_RoutePortInfo rrpi = new Relation_RoutePortInfo();

            int startPortId = 0;
            int endPortId = 0;
            rrpi = rrp.GetListByRouteID(routeId)[0];
            int portType = rrpi.PortTypeID;

            //出发港
            if (portType == 2)
            {
                startPortId = rrpi.PortID;
            }
            //到达港
            if (portType == 4)
            {
                endPortId = rrpi.PortID;
            }

            rrpi = rrp.GetListByRouteID(routeId)[1];
            portType = rrpi.PortTypeID;

            //出发港
            if (portType == 2)
            {
                startPortId = rrpi.PortID;
            }
            //到达港
            if (portType == 4)
            {
                endPortId = rrpi.PortID;
            }

            Port p = new Port();
            PortInfo pi = new PortInfo();

            pi = p.GetByID(startPortId.ToString());
            string startPortName = pi.Name;
            pi = p.GetByID(endPortId.ToString());
            string endPortName = pi.Name;

            lblShipName.Text = shipName;
            lblDistance.Text = distance.ToString();

            if (beginDate.Split(' ')[0].ToString().Equals("1900/1/1"))
            {
                lblStartTime.Text = "";
            }
            else
            {
                lblStartTime.Text = beginDate;
            }

            if (endDate.Split(' ')[0].ToString().Equals("1900/1/1"))
            {
                lblStartTime.Text = "";
            }
            else
            {
                lblEndTime.Text = endDate;
            }

            lblStartPort.Text = startPortName;
            lblEndPort.Text = endPortName;
            lblChiefEngineer.Text = chiefEngineer;
            lblCaptain.Text = captain;
            lblGeneralManager.Text = generalManager;
        }
开发者ID:shanfree,项目名称:SharpReport,代码行数:96,代码来源:RanrunInput.aspx.cs


注:本文中的Route.GetByID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。