protected void uxDocks_SelectedIndexChanged(object sender, EventArgs e)
        {
            // event fires
            if (DockSelect != null)
            {
                // get id from list
                var dockID = Convert.ToInt32(uxDocks.SelectedValue);

                // call manager
                var mgr = new MarinaManager();
                // get course object
                var dock = mgr.GetSingleDock(dockID);
                Dock = dock;

                // instantiate event args
                var arg = new DockEventArgs
                {
                    ID       = dock.ID,
                    eService = dock.ElectricalService,
                    wService = dock.WaterService
                };

                // pass args to event and invoke
                DockSelect.Invoke(this, arg);
            }
        }
 /// <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);
     }
 }
        protected void uxDocks_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (DockSelect != null)
            {
                var ID = Convert.ToInt32(uxDocks.SelectedValue);

                Dock dk = MarinaManager.Find(ID);
                Dock = dk;

                var arg = new DockEventArgs
                {
                    ID                = dk.ID.ToString(),
                    Name              = dk.Name,
                    WaterService      = dk.WaterService,
                    ElectricalService = dk.ElectricalService,
                };

                DockSelect.Invoke(this, arg);
            }
        }
Beispiel #4
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);
            }
        }