当前位置: 首页>>代码示例>>C#>>正文


C# WebControls.LinqDataSourceSelectEventArgs类代码示例

本文整理汇总了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);
    }
开发者ID:ghostnguyen,项目名称:redblood,代码行数:34,代码来源:TransCount.aspx.cs

示例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);
    }
开发者ID:ghostnguyen,项目名称:redblood,代码行数:26,代码来源:TransCount.aspx.cs

示例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>"
        });
    }
开发者ID:WFPVAM,项目名称:GRASPReporting,代码行数:37,代码来源:Surveys.aspx.cs

示例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>"
        });
    }
开发者ID:WFPVAM,项目名称:GRASPReporting,代码行数:30,代码来源:Data_Entry.aspx.cs

示例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;
        }
开发者ID:dennis-vl,项目名称:dennis-vl,代码行数:7,代码来源:DeliveryDetails.aspx.cs

示例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);
    }
开发者ID:ghostnguyen,项目名称:redblood,代码行数:35,代码来源:Count.aspx.cs

示例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);
    }
开发者ID:yschulmann,项目名称:Anglodeals,代码行数:31,代码来源:DealsDay.aspx.cs

示例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;
        }
开发者ID:dennis-vl,项目名称:dennis-vl,代码行数:7,代码来源:DeliveryDetails.aspx.cs

示例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);
    }
开发者ID:ghostnguyen,项目名称:redblood,代码行数:28,代码来源:Rpt1.aspx.cs

示例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);
    }
开发者ID:ghostnguyen,项目名称:daccf960-44f9-4f95-91c4-b1aba37effe1,代码行数:29,代码来源:CountList.aspx.cs

示例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()
                })
            });
    }
开发者ID:ghostnguyen,项目名称:redblood,代码行数:35,代码来源:Rpt910.aspx.cs

示例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);
    }
开发者ID:ghostnguyen,项目名称:daccf960-44f9-4f95-91c4-b1aba37effe1,代码行数:28,代码来源:TransCount.aspx.cs

示例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;
        }
开发者ID:dennis-vl,项目名称:dennis-vl,代码行数:7,代码来源:CustomerAccounts.aspx.cs

示例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;
            }
        }
开发者ID:ghostnguyen,项目名称:daccf960-44f9-4f95-91c4-b1aba37effe1,代码行数:28,代码来源:BloodGroup.aspx.cs

示例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());
    }
开发者ID:ghostnguyen,项目名称:redblood,代码行数:7,代码来源:CollectDetailRpt.aspx.cs


注:本文中的System.Web.UI.WebControls.LinqDataSourceSelectEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。