AIR版的通讯簿(十)

private function selectFileHandler(event:Event):void{
    file=event.target as File;
    img.text=file.nativePath;
   }
   private function doIt():void{
    if(editObj==null){
     saveIt();
    }else{
     updateIt();
    }
   }
   private function saveIt():void{
    var name:String=cusName.text;
    var address:String=cusAddress.text;
    var tp:String=telePhone.text;
    var mb:String=mobile.text;
    var fx:String=fox.text;
    var dc:String=desc.text;
    var imgPath:String=img.text;
    stat=new SQLStatement();
    stat.sqlConnection=conn;
    stat.text="insert into ql_customer(customer_name,customer_address,customer_telephone,customer_mobile,customer_fax,img_url,customer_desc)" +
        " values(?,?,?,?,?,?,?)";
    stat.parameters[0]=name;
    stat.parameters[1]=address;
    stat.parameters[2]=tp;
    stat.parameters[3]=mb;
    stat.parameters[4]=fx;
    stat.parameters[5]=imgPath;
    stat.parameters[6]=dc;
    stat.addEventListener(SQLErrorEvent.ERROR,insertErrorResult);
    stat.addEventListener(SQLEvent.RESULT,insertOKResult);
    stat.execute();
   }

你可能感兴趣的:(AIR版的通讯簿(十))