예제 #1
0
        /// <summary>
        /// Copy Constructor
        /// </summary>
        /// <param name="routeCopy"></param>
        public Route(MOE.Common.Business.Inrix.Route routeCopy)
        {
            Models.Inrix.Repositories.RouteRepository rr = new Models.Inrix.Repositories.RouteRepository();

            int tempID = 0;

            Name        = "Copy of " + routeCopy.Name;
            Description = routeCopy.Description;
            //routesTA.Insert(this.Name, this.Description, out tempID);

            Models.Inrix.Route route = new Models.Inrix.Route();
            route.Route_Name        = this.Name;
            route.Route_Description = this.Description;

            rr.Add(route);


            Models.Inrix.Route copiedRoute = rr.GetRouteByName(this.name);
            ID = Convert.ToInt32(copiedRoute.Route_ID);


            foreach (Segment segment in routeCopy.Items)
            {
                this.Items.Add(segment);
            }

            this.SaveMembers();
        }
예제 #2
0
파일: EditRoute.cs 프로젝트: zfx1982/ATSPM
 public EditRoute(InrixConfigurationTool mainForm, MOE.Common.Business.Inrix.Route selectedRoute)
 {
     InitializeComponent();
     MainForm      = mainForm;
     SelectedRoute = selectedRoute;
     this.uxNewRouteNameText.Text        = selectedRoute.Name;
     this.uxNewRouteDescriptionText.Text = selectedRoute.Description;
 }
예제 #3
0
 private void uxCopyRouteButton_Click(object sender, EventArgs e)
 {
     if (selectedRoute != null)
     {
         MOE.Common.Business.Inrix.Route route = new MOE.Common.Business.Inrix.Route(selectedRoute);
         this.FillRoutes();
         selectedRoute = null;
         uxRoutesListView.SelectedItems.Clear();
         FillGroupMembers();
         FillGroupNonMembers();
     }
 }
예제 #4
0
        private void uxRoutesList_SelectedIndexChanged(object sender, EventArgs e)
        {
            ListView.SelectedListViewItemCollection selectedItem = this.uxRoutesListView.SelectedItems;
            foreach (ListViewItem item in selectedItem)

            {
                selectedRoute = (item.Tag as MOE.Common.Business.Inrix.Route);
            }
            if (selectedRoute.Description == "")
            {
                uxDescriptionText.Text = selectedRoute.Name;
            }
            else
            {
                uxDescriptionText.Text = selectedRoute.Description;
            }

            uxDeleteRouteButton.Enabled = true;
            uxCopyRouteButton.Enabled   = true;
            uxEditRouteButton.Enabled   = true;
            FillRouteMembers();
            FillRouteNonMembers();
        }