My favorites | Sign in
Project Logo
                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.tearaway_tea.opportunities.data
{
import com.asfusion.mate.events.Dispatcher;
import com.tearaway_tea.opportunities.events.DataProviderEvent;
import com.tearaway_tea.opportunities.model.OpportunityVO;
import com.tearaway_tea.opportunities.services.OpportunitiesMockService;

public class OpportunityDataProvider
{
[Bindable]
public var opportunity : OpportunityVO;

public function createOpportunity() : void
{
opportunity = new OpportunityVO();
new Dispatcher().dispatchEvent(
new DataProviderEvent(DataProviderEvent.OPPORTUNITY_CREATED));
}

public function editOpportunity(opportunity : OpportunityVO) : void
{
this.opportunity = opportunity;
}

public function saveOpportunity() : void
{
opportunity.lastUpdate = new Date();
new OpportunitiesMockService(onUpdateOpportunity).updateOpportunity(opportunity);

function onUpdateOpportunity(result : OpportunityVO) : void
{
opportunity = result;
new Dispatcher().dispatchEvent(
new DataProviderEvent(DataProviderEvent.OPPORTUNITY_SAVED));
}
}
}
}
Show details Hide details

Change log

r11 by tearaway.tea on Mar 23, 2009   Diff
[No log message]
Go to: 

Older revisions

r3 by tearaway.tea on Mar 23, 2009   Diff
Initial import
All revisions of this file

File info

Size: 1087 bytes, 38 lines
Hosted by Google Code