public static IQueryable GetUserDetailsById(Guid userID)
{
//Create an instance of the TicketRequestDataContext object.
TicketRequestDataContext db = new TicketRequestDataContext();
IQueryable userDetails = from u in db.telerik_UserMetaInfos
where u.UserId == userID
select new
{
FirstName = (from f in db.telerik_UserMetaInfos
where f.PropertyName == "FirstName"
select f.Text),
LastName = (from l in db.telerik_UserMetaInfos
where l.PropertyName == "LastName"
select l.Text),
Email = (from e in db.telerik_Users
where e.UserId == userID
select e.Email).Single(),
JobTitle = (from j in db.telerik_UserMetaInfos
where j.PropertyName == "JobTitle"
select j.Text),
DirectPhone = (from d in db.telerik_UserMetaInfos
where d.PropertyName == "DirectPhone"
select d.Text),
MobilePhone = (from m in db.telerik_UserMetaInfos
where m.PropertyName == "MobilePhone"
select m.Text),
FaxNumber = (from f in db.telerik_UserMetaInfos
where f.PropertyName == "FaxNumber"
select f.Text),
Address1 = (from a in db.telerik_UserMetaInfos
where a.PropertyName == "Address1"
select a.Text),
Address2 = (from a in db.telerik_UserMetaInfos
where a.PropertyName == "Address2"
select a.Text),
City = (from c in db.telerik_UserMetaInfos
where c.PropertyName == "City"
select c.Text),
Country = (from c in db.telerik_UserMetaInfos
where c.PropertyName == "Country"
select c.Text),
Postcode = (from c in db.telerik_UserMetaInfos
where c.PropertyName == "Postcode"
select c.Text),
};
return userDetails;
}
|