私はlinqでこのクエリを書き、この作業を1-sum xとyで新しい2マイナスのタイムスパンを選択し、たとえば30の数でマルチプレイしたい
var query =
(from c in DB.SabtHoghoghs
join aa in DB.SabtHesabKarmands on c.KarmandID equals aa.KarmandID
select new
{
c.Karmand.FName,
c.BabatMah,
x = DB.SabtHesabKarmands.Where(q => q.BabatMah.Year == c.BabatMah.Year &&
q.BabatMah.Month == c.BabatMah.Month && q.HesabKarmand.HesabKarmandTypeID==1)
.Sum(aaa => aaa.Tedad * aaa.HesabKarmand.Mablagh),
y = DB.SabtHesabKarmands.Where(q => q.BabatMah.Year == c.BabatMah.Year &&
q.BabatMah.Month == c.BabatMah.Month && q.HesabKarmand.HesabKarmandTypeID == 2)
.Sum(aaa => aaa.Tedad * aaa.HesabKarmand.Mablagh),
z=y-x //how to do this(1)
karkard = (c.Karmand.ExitTime-c.Karmand.EnterTime).Hours *30 //how to do this(2)
}).Distinct();