source: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/UpdateStaffEvent.as@ 1227

Last change on this file since 1227 was 1227, checked in by George Lilly, 13 years ago

initial load of EDIS 1.0

File size: 1.3 KB
Line 
1/* UpdateStaffEvent.as */
2
3package gov.va.med.edp.control.config
4{
5 import com.adobe.cairngorm.control.CairngormEvent;
6
7 import flash.events.Event;
8
9 import gov.va.med.edp.vo.StaffMemberVO;
10
11 public class UpdateStaffEvent extends CairngormEvent
12 {
13 public static const EVENT_ADD_STAFF: String = "AddStaff";
14 public static const EVENT_REMOVE_STAFF: String = "RemoveStaff";
15
16 public var staff: StaffMemberVO;
17
18 public function UpdateStaffEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
19 {
20 super(type, bubbles, cancelable);
21 }
22
23 override public function clone():Event
24 {
25 return new UpdateStaffEvent(type);
26 }
27
28 public static function dispatchAdd(staff : StaffMemberVO, role : String) : void {
29 if (staff == null) return;
30 var addEvent: UpdateStaffEvent = new UpdateStaffEvent(EVENT_ADD_STAFF);
31 addEvent.staff = staff;
32 addEvent.staff.role = role;
33 addEvent.staff.changed = true;
34 addEvent.dispatch();
35 }
36
37 public static function dispatchRemove(staff : StaffMemberVO) : void {
38 if (staff == null) return;
39 var removeEvent: UpdateStaffEvent = new UpdateStaffEvent(EVENT_REMOVE_STAFF);
40 removeEvent.staff = staff;
41 removeEvent.dispatch();
42 }
43 }
44}
Note: See TracBrowser for help on using the repository browser.