rawilken
asked on
Returning Fields
I have a view in SQL Server 2005. In ASP.NET I have a method that returns the totals for two fields in that view. I now want a control that will return certain fields with their data (there will be several records).
The method that returns the Totals is...
private decimal GetTotalsBilling(
TradingPerspectiveType tradingPerspective, string sideTypeName, TotalsType totals)
{
IEnumerable<TagSummaryView > items =
this.TagSummaryItems.Where (
view => view.TradingPerspective == TradingPerspectiveType.Bil ling && view.Name == sideTypeName);
return items.Sum(view => totals == TotalsType.Principal ? view.Principal : view.Quantity);
}
I modified the view to display the fields/properties in the TagSummaryView as ...
private string GetContract(string sideTypeName)
{
IEnumerable<TagSummaryView > items =
this.TagSummaryItems.Where (
view => view.TradingPerspective == TradingPerspectiveType.Con tract && view.Name == sideTypeName);
return items.ToString();
}
Clearly wrong to all except me.
The fields I want to return include TagTypeName, Quantity, Principal.
The method that returns the Totals is...
private decimal GetTotalsBilling(
TradingPerspectiveType tradingPerspective, string sideTypeName, TotalsType totals)
{
IEnumerable<TagSummaryView
this.TagSummaryItems.Where
view => view.TradingPerspective == TradingPerspectiveType.Bil
return items.Sum(view => totals == TotalsType.Principal ? view.Principal : view.Quantity);
}
I modified the view to display the fields/properties in the TagSummaryView as ...
private string GetContract(string sideTypeName)
{
IEnumerable<TagSummaryView
this.TagSummaryItems.Where
view => view.TradingPerspective == TradingPerspectiveType.Con
return items.ToString();
}
Clearly wrong to all except me.
The fields I want to return include TagTypeName, Quantity, Principal.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.