AIR版的通讯簿(二十一)
private function doIt():void{
    if(editObj==null){
     saveIt();
    }else{
     updateIt();
    }
   }
   private function clearPage():void{
    chooseDate.selectedDate=null;
    chooseDate.text="";
    currFee.text="";
    useWay.selectedIndex=-1;
    desc.text="";
   }
   private function saveIt():void{
    stat=new SQLStatement();
    stat.sqlConnection=conn;
    stat.text="insert into ql_money_day(create_date,used_money,used_way,desc)" +
        " values(?,?,?,?)";
    stat.parameters[0]=chooseDate.selectedDate==null?new Date():chooseDate.selectedDate;
    stat.parameters[1]=currFee.text;
    stat.parameters[2]=useWay.selectedItem==null?'1':useWay.selectedItem.id;
    stat.parameters[3]=desc.text;
    stat.addEventListener(SQLErrorEvent.ERROR,insertErrorResult);
    stat.addEventListener(SQLEvent.RESULT,insertOKResult);
    stat.execute();
   }
   private function updateIt():void{
    var aid:String=myDg.selectedItem.theid;
    stat=new SQLStatement();
    stat.sqlConnection=conn;
    stat.text=" update  ql_money_day set create_date=?,used_money=?,used_way=?,desc=?" +
        " where theid=? ";
    stat.parameters[0]=chooseDate.selectedDate==null?new Date():chooseDate.selectedDate;
    stat.parameters[1]=currFee.text;
    stat.parameters[2]=useWay.selectedItem==null?'1':useWay.selectedItem.id;
    stat.parameters[3]=desc.text;
    stat.parameters[4]=aid;
    stat.addEventListener(SQLErrorEvent.ERROR,insertErrorResult);
    stat.addEventListener(SQLEvent.RESULT,insertOKResult);
    stat.execute();
   }
   private function insertOKResult(event:SQLEvent):void{
     queryList();
     Alert.show("保存成功!","提示");
     returnList();
   }
阅读更多
个人分类: flex
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

AIR版的通讯簿(二十一)

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭