Ejemplo n.º 1
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);
            }
        }