AIR版的通讯簿(二十二)

private function insertErrorResult(event:SQLErrorEvent):void{
     Alert.show("数据插入失败!","提示");
     Alert.show(event.error.message);
     Alert.show(event.error.details);
   }
   private function addNewCus():void{
    mainBox.selectedChild=addBox;
   }
   private function returnMain():void{
    editObj=null;
    MyLoveContact(this.parentApplication).gotoMain();
   }
   private function returnList():void{
    editObj=null;
    mainBox.selectedChild=listBox;
   }
   public function editCus():void{//编辑客户信息
    editObj=myDg.selectedItem;
    mainBox.selectedChild=addBox;
   }
   private function setUseWay():void{
    if(editObj!=null){
     var theValue:String=editObj.use_way;
     for (var i:int=0;i<useWayList.length;i++){
      if(useWayList.getItemAt(i).id==theValue){
       useWay.selectedIndex=i;
       break;
      }
     }
    }
   }
   public function deleteCus():void{//删除客户信息
    Alert.show("您确定要删除该条记录吗?","提示",Alert.OK|Alert.CANCEL,this,deleteHandler);
   }
   private function deleteHandler(event:CloseEvent):void{
    var aid:String=myDg.selectedItem.theid;
    if(event.detail==Alert.OK){
     stat=new SQLStatement();
     stat.sqlConnection=conn;
     stat.text="delete from  ql_money_day where theid=? ";
     stat.parameters[0]=aid;
     stat.addEventListener(SQLEvent.RESULT,deleteResult);
     stat.execute();
    }
   }

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