package VO
{
[RemoteClass(alias="ServiceLibrary.SystemFramework.UserInfoSearchCondition")]
public class UserInfoSearchConditionVO
{
public function UserInfoSearchConditionVO()
{
}
public var UserName:String;
public var DepartmentId:String;
}
}
var condition:UserInfoSearchConditionVO=new UserInfoSearchConditionVO();
condition.UserName=txtSearchUserName.text;
var resp1:Responder=new Responder(onUserSearchCountSuccess,onUserSearchCountFaild);
nc.call("ServiceLibrary.SystemFramework.UserInfoFacade.GetUserInfoCountByCondition",resp1,condition);
import mx.events.FlexEvent;
import mx.controls.Alert;
public var nc:NetConnection;
import mx.collections.ArrayCollection;
public var pageCount:int=10;
public var curPage:int=0;
public var totalCount:int=0;
protected function module1_creationCompleteHandler(event:FlexEvent):void
{
// TODO Auto-generated method stub
nc=new NetConnection();
nc.objectEncoding=ObjectEncoding.AMF3;
var gatewayUrl:String =AppConfig.Connection.getInstance().connectionString;
protected function netStateHandle(evt:NetStatusEvent):void
{
Alert.show("连接出错了!","出错了");
}
protected function btnSearch_clickHandler(event:MouseEvent):void
{
// TODO Auto-generated method stub
BindGrid();
}
protected function BindGrid():void
{
var condition:UserInfoSearchConditionVO=new UserInfoSearchConditionVO();
condition.UserName=txtSearchUserName.text;
var resp1:Responder=new Responder(onUserSearchCountSuccess,onUserSearchCountFaild);
nc.call("ServiceLibrary.SystemFramework.UserInfoFacade.GetUserInfoCountByCondition",resp1,condition);
var resp2:Responder=new Responder(onUserSearchSuccess,onUserSearchFaild);
nc.call("ServiceLibrary.SystemFramework.UserInfoFacade.GetUserInfoByCondition",resp2,condition,curPage,pageCount);
}
protected function onUserSearchCountSuccess(re:Object):void{
this.totalCount= re as int;
if(curPage>0)
this.btnPrev.visible=true;
else
this.btnPrev.visible=false;