/// <summary>
 /// builds event handler for when index changes
 /// </summary>
 /// <param name="sender">reference to the control/object that raised the event.</param>
 /// <param name="e">event data</param>
 protected void uxDockSelector_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (DockSelect != null)
     {
         var  dockID = Convert.ToInt32(uxDockSelector.SelectedValue);
         Dock dock   = DockManager.Find(dockID);
         var  arg    = new DockEventArgs
         {
             ID                = dock.ID,
             Name              = dock.Name,
             WaterService      = dock.WaterService,
             ElectricalService = dock.ElectricalService
         };
         DockSelect.Invoke(this, arg);
     }
 }
Ejemplo n.º 2
0
        protected void uxDocks_SelectedIndexChanged(object sender, EventArgs e)
        {
            // the event is fired here
            if (DockSelect != null)
            {
                // get the id from the dropdownlist(ddl) (SelectedValue cast to an int)
                var id = Convert.ToInt32(uxDocks.SelectedValue);

                // call the manager class to get the dock object
                Dock dock = MarinaManager.FindDock(id);

                // instantiate the CourseEventArgs
                var arg = new DockEventArgs
                {
                    ID                = dock.ID,
                    Name              = dock.Name,
                    WaterService      = dock.WaterService,
                    ElectricalService = dock.ElectricalService
                };

                // invoke the event and pass the param values
                DockSelect.Invoke(this, arg);
            }
        }