I prefer linq extension methods so that's how I'll present my solution:
DataContext db = new DataContext
public static IQueriable<class1> QMethod(
DateTime fromDate,
DateTime toDate,
int parcelStatus,
DataContext db = null)
{
if(db==null)
db = new DataContext();
return db.ParcelsHistories
.Join(
db.tbl_PackageStatus,
a=>a.ParcelCode,
b=>b.packCode,
(a,b)=> new {a,b})
.Join(db.Stations,
n=>n.b.boxMachineName,
c=>c.StationCode,
(n,c)=>new{n.a,n.b,c})
.Where(
n=>n.a.StatusDate > fromDate
&& n.a.StatusDate <= toDate
&& n.a.ParcelStatus == parcelStatus)
.Select(
n=> new Class1{
ParcelCode = n.a.ParcelCode,
StatusDate = n.a.StatusDate,
boxMachineName = n.b.boxMachineName,
StationName = n.c.StationName,
ParcelStatus = n.a.ParcelStatus,
newStatus = n.b.newStatus,
storedPackType = n.b.storedPackType,
PhoneNo = n.b.PhoneNo}
)
}