public object GetDpUserListByUserId(string userid) { IDbTransaction tran = Utility.Database.BeginDbTransaction(); try { FX_Department department = ComClass.GetDeptByUserId(userid); FX_UserInfo user = new FX_UserInfo(); user.Condition.Add("DPID =" + department.DPID); List<FX_UserInfo> userList = Utility.Database.QueryList<FX_UserInfo>(user); return new { userList = userList }; } catch (Exception ex) { ComBase.Logger(ex); throw (new Exception("获取数据失败!", ex)); } }
//查找是否有用户在此部门 public bool FindExist(string dpid, IDbTransaction tran) { FX_UserInfo user = new FX_UserInfo(); user.Condition.Add("DPID =" + dpid); List<FX_UserInfo> listUser = Utility.Database.QueryList<FX_UserInfo>(user, tran); if (listUser.Count > 0) { return true; } else { return false; } }