在AS上写业务逻辑方法,MXML上调用

原创 2007年10月06日 13:52:00

 as:

public function getsearchCompany(txtFirstName:String,txtCompany:String,txtLastName:String,qiSession:String,objContactCollection:CollectionBean):void{
   objContactCollectionBean = objContactCollection;
   var sql:String = "select cm.company_id,cm.company_name,(ct.first_name ||' '|| ct.last_name) as contact_name," +
     "ct.contact_id from companies cm inner join contacts_company cc on cm.company_id = cc.company_id " +
     "inner join contacts ct on ct.contact_id = cc.contact_id where Upper(cm.company_name) like '" + txtCompany +
     "%' and Upper(ct.first_name) like '" + txtFirstName + "%' and Upper(ct.last_name) like '" + txtLastName +
     "%'";
   objDsQiSql = new DsQiSql(sql,qiSession,getContactLoadComplete);
  }
  
  public function getContactLoadComplete(event:Event):void{
   for(var i:int = 0; i < objDsQiSql.Data.length; i++){
    var objItem:Object = new Object();
    objItem.CONTACT_NAME = objDsQiSql.Data[i].CONTACT_NAME.toString();
    objContactCollectionBean.acContactBean.addItem(objItem);
   }
   dispatchEvent(new Event("getContactDataProvider"));
  }

public function searchCompany():void {
   objContactBean.getsearchCompany(this.txtFirstName.text.toUpperCase(),this.txtCompany.text.toUpperCase(),this.txtLastName.text.toUpperCase(),parentApplication.qiSession,parentApplication.objCollectionBean)
   objContactBean.addEventListener("getContactDataProvider",getcontactDataProvider)
    }


  private function getcontactDataProvider(event:Event):void  {
   var objContacts:Contacts = new Contacts()
   objContacts.x = 250;
   objContacts.y = 100;
   PopUpManager.addPopUp(objContacts,this,true);
   objContacts.ContactList.dataProvider = parentApplication.objCollectionBean.acContactBean;
  }

版权声明:本文为博主原创文章,未经博主允许不得转载。 举报

相关文章推荐

返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)