/// <summary> /// 获取当前用户的报送楼宇 /// </summary> public DataTable GetCurrentUsersOrganizeList() { //获取当前用户所属组织有的楼盘权限,并将ID放入List中,用作后边查询楼栋的筛选条件 ElementOrganizeBLL elementOrganizeBLL = new ElementOrganizeBLL(); DataTable houses = elementOrganizeBLL.GetCurrentBuildingModify(); List <string> housesID = new List <string>(); foreach (DataRow dr in houses.Rows) { if (!housesID.Contains(dr["ElementID"].ToString())) { housesID.Add(dr["ElementID"].ToString()); } } if (housesID.Count == 0) { return(new DataTable()); } //查询满足条件的所有楼栋 Dictionary <KeyValuePair <string, RoadFlow.Data.Model.SQLFilterType>, object> where = new Dictionary <KeyValuePair <string, Data.Model.SQLFilterType>, object>(); where.Add(new KeyValuePair <string, RoadFlow.Data.Model.SQLFilterType>("HouseID", RoadFlow.Data.Model.SQLFilterType.IN), housesID); where.Add(new KeyValuePair <string, RoadFlow.Data.Model.SQLFilterType>("Status", RoadFlow.Data.Model.SQLFilterType.EQUAL), RoadFlow.Data.Model.Status.Normal);//正常的数据。 return(baseDb.GetAll(0, where)); }
public virtual IActionResult Get() { try { var data = _baseRepo.GetAll <T>(x => x.Where(y => y.Active == true)); return(Ok(data)); } catch (Exception ex) { return(Ok(new { status = -1, message = ex.Message })); } }
// [ActionAuthorize("ReadAll")] //[EnableQuery(AllowedQueryOptions = AllowedQueryOptions.All)] public virtual IActionResult Get() { try { var data = _baseRepo.GetAll(x => x.Where(y => y.Active == true)); // var result = new PageResult<T>(data, new Uri("https://localhost:44383/api/products?$skip=2&$top=2"), data.Count()); return(Ok(new { status = 0, message = "OK", data = data })); } catch (Exception ex) { return(null); } }
/// <summary> /// 查询一组岗位下所有人员。 /// </summary> /// <param name="organizeIds">岗位ID列表。</param> /// <returns></returns> public List <UsersModel> GetAllByOrganizeIDArray(IEnumerable <Guid> organizeIds) { if (organizeIds == null) { return(new List <UsersModel>()); } IBase usersRelation = Factory.GetBase("UsersRelation", "Sort"); List <string> list = organizeIds.Select <Guid, string>(g => g.ToString()).ToList <string>(); List <Data.Model.UsersRelation> model = usersRelation.GetAll(0, new Dictionary <KeyValuePair <string, SQLFilterType>, object>() { { new KeyValuePair <string, SQLFilterType>("OrganizeID", SQLFilterType.IN), list } }).ToList <Data.Model.UsersRelation>(); list = model.Select <Data.Model.UsersRelation, string>(ur => ur.UserID.ToString()).ToList <string>(); return(this.baseDb.GetAll(0, new Dictionary <KeyValuePair <string, SQLFilterType>, object>() { { new KeyValuePair <string, SQLFilterType>("ID", SQLFilterType.IN), list } }).ToList <UsersModel>()); }
/// <summary> /// 查询一个岗位下的人员列表。 /// </summary> /// <param name="organizeId">岗位ID。</param> /// <returns></returns> public List <UsersModel> GetAllByOrganizeID(Guid organizeId) { //ExecuteBLL bll = new ExecuteBLL(); //StringBuilder builder = new StringBuilder(); //builder.Append("select * from Users where ID in (select UserID from UsersRelation where OrganizeID=@OrganizeID)"); //return bll.GetDataTable(builder.ToString(), new IDataParameter[] //{ // new SqlParameter("@OrganizeID", organizeId) //}).ToList<UsersModel>(); IBase usersRelation = Factory.GetBase("UsersRelation", "Sort"); List <Data.Model.UsersRelation> model = usersRelation.GetAll(0, new Dictionary <KeyValuePair <string, SQLFilterType>, object>() { { new KeyValuePair <string, SQLFilterType>("OrganizeID", SQLFilterType.EQUAL), organizeId } }).ToList <Data.Model.UsersRelation>(); List <string> list = model.Select <Data.Model.UsersRelation, string>(ur => ur.UserID.ToString()).ToList <string>(); return(this.baseDb.GetAll(0, new Dictionary <KeyValuePair <string, SQLFilterType>, object>() { { new KeyValuePair <string, SQLFilterType>("ID", SQLFilterType.IN), list } }).ToList <UsersModel>()); }
public IEnumerable <PublisherDto> GetActors() { var res = manager.GetAll(); return(res); }
public DataTable GetAll(Dictionary <KeyValuePair <string, RoadFlow.Data.Model.SQLFilterType>, object> where) { where.Add(new KeyValuePair <string, RoadFlow.Data.Model.SQLFilterType>("Status", RoadFlow.Data.Model.SQLFilterType.EQUAL), RoadFlow.Data.Model.Status.Normal); return(BaseDb.GetAll(0, where)); }
public List <RoadFlow.Data.Model.DictionaryModel> GetListAll() { return(BaseDb.GetAll(0, new Dictionary <KeyValuePair <string, RoadFlow.Data.Model.SQLFilterType>, object>()).ToList <RoadFlow.Data.Model.DictionaryModel>()); }
//获得全部表数据 public IQueryable <T> GetAll() { return(dal.GetAll()); }