public IEnumerable <InformationModel> SelectByConditions(string member, InformatinState state) { try { return(db.Set <Information>().Where(n => n.InsertMember == member || n.UsageMember == member) .Where(n => n.IsDeleted == false && n.State == (int)state).Select(n => new InformationModel { dataCode = n.DataCode, insertMember = n.InsertMember, customerName = n.CustomerName, sex = n.Sex, phone = n.Phone, qq = n.QQ, webchat = n.WebCat, email = n.Email, hashouse = n.HasHouse, hobby = n.Hobby, state = n.State, usageMember = n.UsageMember }).AsEnumerable()); } catch (Exception) { throw; } }
/// <summary> /// 获取指定用户 指定状态的 数据 /// </summary> /// <param name="member"></param> /// <param name="state"></param> /// <param name="modelList"></param> /// <returns></returns> public OperatorState GetInformation(string member, InformatinState state, ref List <InformationModel> modelList) { try { var data = _informationDAL.SelectByConditions(member, state); if (data == null) { return(OperatorState.empty); } else { modelList = data.ToList(); return(OperatorState.success); } } catch (Exception ex) { LogHelper.writeLog_error(ex.Message); LogHelper.writeLog_error(ex.StackTrace); return(OperatorState.error); } }