//按照当前用户对应的生产组织,生产部门进行过滤
string userName=Convert.ToString(this.Context.UserName);
string FNAME = string.Format("FNAME='{0}'", userName);//用户名称
DynamicObjectCollection objs = this.GetQueryDatas("BD_Empinfo", FNAME, new string[] { "FWORKORGID", "FPostDept" });
/// <summary>
/// 根据条件及业务对象来获取数据,推荐使用
/// </summary>
/// <param name="FormId">业务对象ID</param>
/// <param name="Value">过滤条件拼接</param>
/// <param name="GetDate">需要获取的值(BOS里面字段标识)</param>
/// <returns></returns>
public DynamicObjectCollection GetQueryDatas(String FormId, String Value, String[] GetDate)
{
QueryBuilderParemeter paramCatalog = new QueryBuilderParemeter()
{
FormId = FormId,
FilterClauseWihtKey = String.Format(" {0} ", Value),
SelectItems = SelectorItemInfo.CreateItems(GetDate),
};
DynamicObjectCollection dyDatas = QueryServiceHelper.GetDynamicObjectCollection(this.Context, paramCatalog);
return dyDatas;
}
推荐阅读