本文整理汇总了C#中System.Web.UI.WebControls.LinqDataSourceSelectEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# LinqDataSourceSelectEventArgs类的具体用法?C# LinqDataSourceSelectEventArgs怎么用?C# LinqDataSourceSelectEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LinqDataSourceSelectEventArgs类属于System.Web.UI.WebControls命名空间,在下文中一共展示了LinqDataSourceSelectEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LinqDataSourceIn_Selecting
protected void LinqDataSourceIn_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
ucDateRange.Validated();
RedBloodDataContext db = new RedBloodDataContext();
e.Result = db.vw_PackTrans.Where(r => PackTransactionBLL.InTypeList.Contains(r.Type)
&& ucDateRange.FromDate <= r.Date
&& r.Date <= ucDateRange.ToDate)
.ToList()
.GroupBy(r => new { r.ProductCode, r.ProductDesc }, (r, sub) => new
{
r.ProductCode,
r.ProductDesc,
Total = sub.Sum(r1 => r1.Count),
TotalInCollect = sub.Where(r1 => r1.Type == PackTransaction.TypeX.In_Collect)
.Sum(r1 => r1.Count),
TotalInProduct = sub.Where(r1 => r1.Type == PackTransaction.TypeX.In_Product)
.Sum(r1 => r1.Count),
TotalInReturn = sub.Where(r1 => r1.Type == PackTransaction.TypeX.In_Return)
.Sum(r1 => r1.Count),
BloodGroupSumary = sub.GroupBy(r1 => r1.BloodGroup, (r1, BGSub) => new
{
BloodGroupDesc = BloodGroupBLL.GetDescription(r1),
Total = BGSub.Sum(r3 => r3.Count)
}),
VolumeSumary = sub.GroupBy(r1 => r1.Volume, (r1, VolSub) => new
{
Volume = r1,
Total = VolSub.Sum(r3 => r3.Count)
})
})
.OrderBy(r => r.ProductDesc);
}
示例2: LinqDataSourceEnd_Selecting
protected void LinqDataSourceEnd_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
ucDateRange.Validated();
RedBloodDataContext db = new RedBloodDataContext();
e.Result = db.vw_PackRemainDailies.Where(r => r.Date == ucDateRange.ToDate)
.ToList()
.GroupBy(r => new { r.ProductCode, r.ProductDesc }, (r, sub) => new
{
r.ProductCode,
r.ProductDesc,
Total = sub.Sum(r1 => r1.Count),
BloodGroupSumary = sub.GroupBy(r1 => r1.BloodGroup, (r1, BGSub) => new
{
BloodGroupDesc = BloodGroupBLL.GetDescription(r1),
Total = BGSub.Sum(r3 => r3.Count)
}),
VolumeSumary = sub.GroupBy(r1 => r1.Volume, (r1, VolSub) => new
{
Volume = r1,
Total = VolSub.Sum(r3 => r3.Count)
})
})
.OrderBy(r => r.ProductDesc);
}
示例3: ldsForm_Selecting
/// <summary>
/// Fills the grid with all the forms
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ldsForm_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
GRASPEntities db = new GRASPEntities();
var forms = (from f in db.Form
join fr in db.FormResponse on f.id equals fr.parentForm_id into j1
from j2 in j1.DefaultIfEmpty()
where f.finalised == 1
group j2 by new { f.id, f.name, f.FormCreateDate, f.owner, f.permittedGroup_path} into g
select new
{
Name = g.Key.name,
CreateDate = g.Key.FormCreateDate,
Owner = g.Key.owner,
Group = g.Key.permittedGroup_path,
Count = g.Count(t=>t.id !=null),
Id = g.Key.id
}).OrderByDescending(x => x.Id); //Order them by newest.
e.Result = forms.AsEnumerable().Select(x => new
{
Name = x.Name,
CreateDate = x.CreateDate.Value.ToString("dd MMM yyyy"),
Owner = x.Owner,
Group =x.Group,
Responses = x.Count,
Id = x.Id
//Actions = (x.Count>0) ?"<a style=\"color:#0058B1\" href=\"javascript:ImportForm('" + x.Id.ToString() + "','" + x.Name + "');void(0);\"><i class=\"fa fa-upload fa-2\"></i>Import</a>"+
//" <a style=\"margin-left: 5px;color:#0058B1\" href=\"javascript:ExportSettings('" + x.Id.ToString() + "','" + x.Name + "');void(0);\"><i class=\"fa fa-download fa-2\"></i>Export</a>"+
//" <a style=\"margin-left: 5px;color:#0058B1\" href=\"javascript:ViewForm('" + x.Id.ToString() + "','" + x.Name + "');void(0);\"><i class=\"fa fa-eye fa-2\"></i>View</a>" : "<a style=\"color:#0058B1\" href=\"javascript:ImportForm('" + x.Id.ToString() + "','" + x.Name + "');void(0);\"><i class=\"fa fa-upload fa-2\"></i>Import</a>"
});
}
示例4: ldsForm_Selecting
/// <summary>
/// Populates the grid with all the forms and their properties
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ldsForm_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
GRASPEntities db = new GRASPEntities();
var forms = from f in db.Form
where f.finalised == 1
select new
{
Name = f.name,
CreateDate = f.FormCreateDate,
Owner = f.owner,
Group = f.permittedGroup_path,
Id = f.id
//Actions = "<a style=\"color:#0058B1\" href=\"/Admin/Data_Entry/DataEntry.aspx?formID=" + SqlFunctions.StringConvert(f.id).TrimStart() + "\"><i class=\"fa fa-pencil-square-o\"></i> New Data</a>"
};
e.Result = forms.AsEnumerable().Select(x => new
{
Name = x.Name,
CreateDate = x.CreateDate,
Owner = x.Owner,
Group = x.Group,
Actions = "<a style=\"color:#0058B1\" href=\"DataEntryWebForm.aspx?formID=" + x.Id.ToString() + "\"><i class=\"fa fa-pencil-square-o\"></i> New Data</a>"
});
}
示例5: AutoCompleteBoxHNDataSource_Selecting
protected void AutoCompleteBoxHNDataSource_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
var data = GetData();
var result = data.Select(c => new { c.HeatNumber }).Distinct();
e.Result = result;
}
示例6: LinqDataSource1_Selecting
protected void LinqDataSource1_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
RedBloodDataContext db = new RedBloodDataContext();
e.Result = db.vw_ProductCounts.Where(r => r.Status == Pack.StatusX.Product)
.ToList()
.GroupBy(r => new { r.ProductCode, r.ProductDesc, r.Status }, (r, sub) => new
{
r.ProductCode,
r.ProductDesc,
r.Status,
Total = sub.Sum(r1 => r1.Count),
TotalExpired = sub.Where(r1 => r1.ExpirationDate.Value.Expired())
.Sum(r1 => r1.Count).ToStringRemoveZero(),
TotalExpiredInDays = sub.Where(r1 => r1.ExpirationDate.Value.ExpiredInDays(ExpiredInDays))
.Sum(r1 => r1.Count).ToStringRemoveZero(),
TotalTRNA = sub.Where(r1 => r1.TestResultStatus == Donation.TestResultStatusX.Non)
.Sum(r1 => r1.Count).ToStringRemoveZero(),
TotalTRNeg = sub.Where(r1 => r1.TestResultStatus == Donation.TestResultStatusX.Negative)
.Sum(r1 => r1.Count).ToStringRemoveZero(),
TotalTRPos = sub.Where(r1 => r1.TestResultStatus == Donation.TestResultStatusX.Positive)
.Sum(r1 => r1.Count).ToStringRemoveZero(),
BloodGroupSumary = sub.GroupBy(r1 => r1.BloodGroup, (r1, BGSub) => new
{
BloodGroupDesc = BloodGroupBLL.GetDescription(r1),
Total = BGSub.Sum(r3 => r3.Count)
}),
VolumeSumary = sub.GroupBy(r1 => r1.Volume, (r1, VolSub) => new
{
Volume = r1.HasValue ? r1.Value.ToString() : "_",
Total = VolSub.Sum(r3 => r3.Count)
})
})
.OrderBy(r => r.ProductDesc);
}
示例7: LinqDataSource1_Selecting
protected void LinqDataSource1_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
var cCoupons = drvvv.drvvvSettings.GetDataContextInstance().Coupons.Where(x => x.Active && x.EndDate >= DateTime.Now );
switch (drvvv.drvvvSettings.GetSite())
{
case drvvv.Sites.FrancoDeals:
cCoupons = cCoupons.Where(x => x.TitleFr != null);
break;
case drvvv.Sites.ZebraDeals:
cCoupons = cCoupons.Where(x => x.TitleDefault != null);
break;
default:
cCoupons = cCoupons.Where(x => x.TitleEn != null);
break;
}
int cityID, categoryID;
//if (!string.IsNullOrEmpty(Request.QueryString["Catgory"]))
// cCoupons = cCoupons.Where(x => !x.CategoryID.HasValue || x.Category.ID == int.Parse(Request.QueryString["Catgory"]));
if (int.TryParse(DropDownListCity.SelectedValue, out cityID))
cCoupons = cCoupons.Where(x => x.CityID.HasValue && (x.CityID == cityID || x.City.FromID.Value == cityID));
if (int.TryParse(DropDownListCategory.SelectedValue, out categoryID))
cCoupons = cCoupons.Where(x => x.CategoryID.HasValue && x.CategoryID == categoryID);
if (!string.IsNullOrEmpty(Request.QueryString["CouponID"]))
cCoupons = cCoupons.Where(x => x.ID == int.Parse(Request.QueryString["CouponID"]));
e.Result = cCoupons.OrderByDescending(x => x.Priority).OrderByDescending(x => x.ID);
}
示例8: AutoCompleteBoxCRDataSource_Selecting
protected void AutoCompleteBoxCRDataSource_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
var data = GetData();
var result = data.Select(c => new { c.customerReference }).Distinct();
e.Result = result;
}
示例9: LinqDataSourceStart_Selecting
protected void LinqDataSourceStart_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
ucDateRange.Validated();
RedBloodDataContext db = new RedBloodDataContext();
e.Result = db.Campaigns.Where(r => r.Type == Campaign.TypeX.Short_run && ucDateRange.FromDate <= r.Date
&& r.Date <= ucDateRange.ToDate)
.ToList()
.GroupBy(r => new { r.CoopOrg.Geo1 }, (r, sub) => new
{
Province = r.Geo1.Fullname,
Url = RedBloodSystem.Url4CollectRpt11
+ "ProvinceID=" + r.Geo1.ID.ToString()
+ "&from=" + ucDateRange.FromDate.Value.Date.ToShortDateString()
+ "&to=" + ucDateRange.ToDate.Value.Date.ToShortDateString(),
Total = sub.Sum(r1 => r1.CollectedDonations.Count()),
Total450 = sub.Sum(r1 => r1.CollectedDonations.Where(r2 => r2.Pack.Volume == 450).Count()).ToStringRemoveZero(),
Total350 = sub.Sum(r1 => r1.CollectedDonations.Where(r2 => r2.Pack.Volume == 350).Count()).ToStringRemoveZero(),
Total250 = sub.Sum(r1 => r1.CollectedDonations.Where(r2 => r2.Pack.Volume == 250).Count()).ToStringRemoveZero(),
TotalXXX = sub.Sum(r1 => r1.CollectedDonations.Where(r2 => r2.Pack.Volume != 250 && r2.Pack.Volume != 350 && r2.Pack.Volume != 450).Count()).ToStringRemoveZero(),
TotalPos = sub.Sum(r1 => r1.CollectedDonations.Where(r2 => r2.TestResultStatus == Donation.TestResultStatusX.Positive).Count()).ToStringRemoveZero(),
TotalNeg = sub.Sum(r1 => r1.CollectedDonations.Where(r2 => r2.TestResultStatus == Donation.TestResultStatusX.Negative).Count()).ToStringRemoveZero(),
TotalNon = sub.Sum(r1 => r1.CollectedDonations.Where(r2 => r2.TestResultStatus == Donation.TestResultStatusX.Non).Count()).ToStringRemoveZero(),
TotalMiss = sub.Sum(r1 => r1.Donations.Where(r2 => r2.Pack == null).Count()).ToStringRemoveZero()
})
.OrderBy(r => r.Province);
}
示例10: LinqDataSource1_Selecting
protected void LinqDataSource1_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
RedBloodDataContext db = new RedBloodDataContext();
e.Result = db.Packs.Where(r => r.Status == Pack.StatusX.Product && r.ProductCode == ProductCode
&& (TR == Donation.TestResultStatusX.All || r.Donation.TestResultStatus == TR)
)
//.ToList()
.Select(r => new
{
r.DIN,
r.Donation.TestResultStatus,
r.Donation.BloodGroup,
r.Volume,
r.ExpirationDate,
})
.ToList()
.Select(r => new
{
r.DIN,
r.TestResultStatus,
BloodGroupDesc = BloodGroupBLL.GetDescription(r.BloodGroup),
r.Volume,
ExpirationDate = r.ExpirationDate.ToStringVN_Hour(),
Expired = r.ExpirationDate.Value.Expired() ? "X" : "",
ExpiredInDays = r.ExpirationDate.Value.ExpiredInDays(ExpiredInDays) ? "X" : ""
})
.OrderBy(r => r.TestResultStatus).ThenBy(r => r.DIN);
}
示例11: LinqDataSourceRpt_Selecting
protected void LinqDataSourceRpt_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
ucDateRange.Validated();
RedBloodDataContext db = new RedBloodDataContext();
e.Result = db.Campaigns.Where(r => ucDateRange.FromDate <= r.Date && r.Date <= ucDateRange.ToDate)
.ToList()
.Select(r => new
{
r.ID,
Url = RedBloodSystem.Url4CollectRpt920
+ "CampaignID=" + r.ID.ToString(),
r.Name,
r.Date,
Total = r.CollectedDonations.Count(),
HostName = r.HostOrg.Name,
CoopName = r.CoopOrg.Name,
TestResultPos = RedBloodSystem.checkingInfection.Select(r1 => new
{
r1.Name,
Total = r.Donations.Where(r2 => r1.Decode(r2.InfectiousMarkers) == TR.pos.Name).Count()
}).Where(r1 => r1.Total > 0),
TestResultNA = RedBloodSystem.checkingInfection.Select(r1 => new
{
r1.Name,
Total = r.Donations.Where(r2 => r1.Decode(r2.InfectiousMarkers) == TR.na.Name).Count()
}).Where(r1 => r1.Total > 0),
BloodGroupSumary = r.Donations.GroupBy(r1 => r1.BloodGroup, (r2, BGSub) => new
{
BloodGroupDesc = BloodGroupBLL.GetDescription(r2),
Total = BGSub.Count()
})
});
}
示例12: LinqDataSourceEnd_Selecting
protected void LinqDataSourceEnd_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
ucDateRange.Validated();
var packBLL = new PackBLL();
e.Result = packBLL.GetRemainByDate(ucDateRange.ToDate.Value)
.Select(r => new { r.ProductCode, r.Donation.BloodGroup, r.Volume })
.ToList()
.GroupBy(r => new { r.ProductCode }, (r, sub) => new
{
r.ProductCode,
ProductDesc = ProductBLL.GetDesc(r.ProductCode),
Total = sub.Count(),
BloodGroupSumary = sub.GroupBy(r1 => r1.BloodGroup, (r1, BGSub) => new
{
BloodGroupDesc = BloodGroupBLL.GetDescription(r1),
Total = BGSub.Count(),
Order = BloodGroupBLL.GetOrder(r1),
}).OrderBy(r1 => r1.Order).ThenBy(r1 => r1.BloodGroupDesc),
VolumeSumary = sub.GroupBy(r1 => r1.Volume, (r1, VolSub) => new
{
Volume = r1,
Total = VolSub.Count()
})
})
.OrderBy(r => r.ProductDesc);
}
示例13: autoCompleteBox_Selecting
protected void autoCompleteBox_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
var data = GetData();
var result = data.Select(c => new { c.bpName }).Distinct();
e.Result = result;
}
示例14: LinqDataSourcePack_Selecting
protected void LinqDataSourcePack_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
if (CampaignDetail1.CampaignID > 0)
{
e.Result =
DonationBLL.GetUnLock(CampaignDetail1.CampaignID)
.Select(r => new
{
r.DIN,
r.Status,
r.People.Name,
CollectedDate = r.CollectedDate.ToStringVN_Hour(),
r.BloodGroup,
r.BloodGroupDesc,
ABOLog = r.DonationTestLogs.Where(r1 => r1.Type == DonationTestLog.TypeX.BloodGroup)
.Select(r1 => new
{
BloodGroupDesc = BloodGroupBLL.GetDescription(r1.Result),
Date = r1.Date.ToStringVN_Hour()
})
});
}
else
{
e.Cancel = true;
}
}
示例15: LinqDataSource1_Selecting
protected void LinqDataSource1_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
List<Donation> list = DonationBLL.Get(CampaignDetail1.CampaignID).ToList();
e.Result = list;
Summary(list.ToList());
}