public List<CrmMember> getCrmMemberListInfoData(string SourceAccountId) { List<CrmMember> list = null; try { if (string.IsNullOrEmpty(SourceAccountId)) { return null; } IParameterMapper ipmapper = new getCrmMemberListInfoDataParameterMapper(); DataAccessor<CrmMember> tableAccessor; string strSql = @" select top 1 a.Uid,a.MemberName,a.Addr,a.Tel,a.MemberSource,a.SourceAccountId, a.Password,a.Idcard,a.Birthday,a.TypeId,a.RegDate,a.ExpiredDate,a.UseState,a.Sex ,a.CompanyId,b.TypeName from CrmMember a left join CrmMemberType b on a.TypeId=b.TypeId where a.SourceAccountId=@SourceAccountId"; tableAccessor = db.CreateSqlStringAccessor(strSql, ipmapper, MapBuilder<CrmMember>.MapAllProperties() .Map(t => t.Uid).ToColumn("Uid") .Map(t => t.MemberName).ToColumn("MemberName") .Map(t => t.Addr).ToColumn("Addr") .Map(t => t.Tel).ToColumn("Tel") .Map(t => t.MemberSource).ToColumn("MemberSource") .Map(t => t.SourceAccountId).ToColumn("SourceAccountId") .Map(t => t.Password).ToColumn("Password") .Map(t => t.Idcard).ToColumn("Idcard") .Map(t => t.Birthday).ToColumn("Birthday") .Map(t => t.TypeId).ToColumn("TypeId") .Map(t => t.RegDate).ToColumn("RegDate") .Map(t => t.ExpiredDate).ToColumn("ExpiredDate") .Map(t => t.UseState).ToColumn("UseState") .Map(t => t.Sex).ToColumn("Sex") .Map(t => t.CompanyId).ToColumn("CompanyId") .Map(t => t.TypeName).ToColumn("TypeName") .Build()); list = tableAccessor.Execute(new string[] { SourceAccountId }).ToList(); return list; } catch (Exception ex) { Logger.Log(ex); return null; } }
public List <CrmMember> getCrmMemberListInfoData(string SourceAccountId) { List <CrmMember> list = null; try { if (string.IsNullOrEmpty(SourceAccountId)) { return(null); } IParameterMapper ipmapper = new getCrmMemberListInfoDataParameterMapper(); DataAccessor <CrmMember> tableAccessor; string strSql = @" select top 1 a.Uid,a.MemberName,a.Addr,a.Tel,a.MemberSource,a.SourceAccountId, a.Password,a.Idcard,a.Birthday,a.TypeId,a.RegDate,a.ExpiredDate,a.UseState,a.Sex ,a.CompanyId,b.TypeName from CrmMember a left join CrmMemberType b on a.TypeId=b.TypeId where a.SourceAccountId=@SourceAccountId"; tableAccessor = db.CreateSqlStringAccessor(strSql, ipmapper, MapBuilder <CrmMember> .MapAllProperties() .Map(t => t.Uid).ToColumn("Uid") .Map(t => t.MemberName).ToColumn("MemberName") .Map(t => t.Addr).ToColumn("Addr") .Map(t => t.Tel).ToColumn("Tel") .Map(t => t.MemberSource).ToColumn("MemberSource") .Map(t => t.SourceAccountId).ToColumn("SourceAccountId") .Map(t => t.Password).ToColumn("Password") .Map(t => t.Idcard).ToColumn("Idcard") .Map(t => t.Birthday).ToColumn("Birthday") .Map(t => t.TypeId).ToColumn("TypeId") .Map(t => t.RegDate).ToColumn("RegDate") .Map(t => t.ExpiredDate).ToColumn("ExpiredDate") .Map(t => t.UseState).ToColumn("UseState") .Map(t => t.Sex).ToColumn("Sex") .Map(t => t.CompanyId).ToColumn("CompanyId") .Map(t => t.TypeName).ToColumn("TypeName") .Build()); list = tableAccessor.Execute(new string[] { SourceAccountId }).ToList(); return(list); } catch (Exception ex) { Logger.Log(ex); return(null); } }