今天写的是日常开销管理页面的内容
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx=" http://www.adobe.com/2006/mxml" width="100%" height="100%" paddingTop="5"
paddingLeft="2" paddingRight="2" creationComplete="init()" xmlns:view="view.*">
<mx:Script>
<![CDATA[
import mx.controls.DateField;
import mx.controls.dataGridClasses.DataGridColumn;
import mx.printing.FlexPrintJobScaleType;
import mx.printing.FlexPrintJob;
import mx.events.CloseEvent;
import mx.managers.PopUpManager;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.core.WindowedApplication;
public var conn:SQLConnection;
private var stat:SQLStatement;
[Bindable]private var useWayList:ArrayCollection=new ArrayCollection([{id:'1',label:'餐费'},{id:'2',label:'办公用品'},{id:'3',label:'差旅费'},{id:'4',label:'其他'}]);
[Bindable]private var dataList:ArrayCollection=new ArrayCollection();
[Bindable]private var editObj:Object;
private function init():void{
queryList();
}
private function queryList():void{
dataList.removeAll();
stat=new SQLStatement();
stat.sqlConnection=conn;
var sql:String=" select * from ql_money_day where 1=1";
stat.text=sql;
stat.execute(-1,new Responder(getCusList,errorHandler));
}
private function getCusList(result:SQLResult):void{
if(result.data!=null){
var numResults:int =result.data.length;
for (var i:int = 0; i < numResults; i++){
var row:Object = result.data[i];
dataList.addItem(row);
}
}
}
private function errorHandler(error:SQLError):void{
Alert.show("查询日常开销列表出错");
Alert.show(error.details);
}