/ **
* organizations currently logged
* @return
* /
public static CtrlUnitInfo getCU () {
return SysContext.getSysContext () getCurrentCtrlUnit ();.
}
等同于: CtrlUnitInfo info = SysContext.getSysContext().getCurrentCtrlUnit();
/ **
* currently logged
* @return
* /
public static the UserInfo the getUser () {
return SysContext.getSysContext () getCurrentUserInfo ();.
}
等同于: UserInfo userInfo= SysContext.getSysContext().getCurrentUserInfo();
/**
* 当前登陆人员
* @return
*/
public static PersonInfo getPerson(){
PersonInfo personinfo = null;
try {
PersonCollection Personcollection = PersonFactory.getRemoteInstance().
getPersonCollection(" select * where name = '" + SysContext.getSysContext().getCurrentUserInfo().getName() +"'");
personinfo=Personcollection.get(0);
} catch (Exception e1) {
}
return personinfo;
}
/**
* 当前登录人员部门
* @return
*/
public static AdminOrgUnitInfo getDepartment(){
AdminOrgUnitInfo returnvalue = null;
try {
PersonPositionInfo PersonPosition = PersonPositionFactory.getRemoteInstance().
getPersonPositionInfo("select primaryPosition.* where person = '" + getPerson().getId() + "'");
PositionInfo Position = PersonPosition.getPrimaryPosition();
AdminOrgUnitCollection collection = AdminOrgUnitFactory.getRemoteInstance().
getAdminOrgUnitCollection(" select * where id= '" + Position.getAdminOrgUnit().getId() +"'");
returnvalue = collection.get(0);
} catch (Exception e2) {
}
return returnvalue;
}
/ **
* fid acquired by the table name
* @param fid
* @return table
* /
public static String getDBTableName (String fid) {
String Tablename = "";
com.kingdee.bos.util.BOSObjectType bosType BOSUuid.read = ( FID) .getType ();
the try {
Tablename = FMIsqlFacadeFactory.getRemoteInstance () getTableNameByBosType (bosType);.
} the catch (BOSException E) {
alert2 ( "Get error table", FID);
}
return Tablename;
}