or
private
void
Page_Init(
object
sender, EventArgs e)
{
var linqQuery = (from r
in
lServiceContext.CreateQuery(
"opportunity"
)
join a
in
lServiceContext.CreateQuery(
"account"
) on ((EntityReference)r[
"accountid"
]).Id equals a[
"accountid"
]
join c
in
lServiceContext.CreateQuery(
"contact"
) on ((EntityReference)r[
"new_contact"
]).Id equals c[
"contactid"
]
where ((EntityReference)r[
"new_channelpartner"
]).Id.Equals(lProfileProperty.PropertyValue)
select
new
{
OpportunityId = !r.Contains(
"opportunityid"
) ?
string
.Empty : r[
"opportunityid"
],
CustomerId = !r.Contains(
"customerid"
) ?
string
.Empty : ((EntityReference)r[
"customerid"
]).Name,
Priority = !r.Contains(
"opportunityratingcode"
) ?
string
.Empty : r.FormattedValues[
"opportunityratingcode"
],
ContactName = !r.Contains(
"new_contact"
) ?
string
.Empty : ((EntityReference)r[
"new_contact"
]).Name,
Source = !r.Contains(
"new_source"
) ?
string
.Empty : ((String)r[
"new_source"
]),
CreatedOn = !r.Contains(
"createdon"
) ?
string
.Empty : ((DateTime)r[
"createdon"
]).ToShortDateString(),
State = !a.Contains(
"address1_stateorprovince"
) ?
string
.Empty : ((String)a[
"address1_stateorprovince"
]),
Zip = !a.Contains(
"address1_postalcode"
) ?
string
.Empty : ((String)a[
"address1_postalcode"
]),
Eval = !r.Contains(
"new_colderevaluation"
) ?
"NA"
: r.FormattedValues[
"new_colderevaluation"
].Substring(0, 2),
EvalVal = !r.Contains(
"new_colderevaluation"
) ?
"NA"
: ((OptionSetValue)r[
"new_colderevaluation"
]).Value.ToString(),
DistributorName = !r.Contains(
"new_channelpartner"
) ?
string
.Empty : ((EntityReference)r[
"new_channelpartner"
]).Name,
ContactStreetAddress = !c.Contains(
"address1_line1"
) ?
string
.Empty : c[
"address1_line1"
],
ContactCity = !c.Contains(
"address1_city"
) ?
string
.Empty : c[
"address1_city"
],
ContactState = !c.Contains(
"address1_stateorprovince"
) ?
string
.Empty : c[
"address1_stateorprovince"
],
ContactZip = !c.Contains(
"address1_postalcode"
) ?
string
.Empty : c[
"address1_postalcode"
],
ContactPhone = !c.Contains(
"telephone1"
) ?
string
.Empty : c[
"telephone1"
],
ContactMobilePhone = !c.Contains(
"mobilephone"
) ?
string
.Empty : c[
"mobilephone"
],
ContactEmail = !c.Contains(
"emailaddress1"
) ?
string
.Empty : c[
"emailaddress1"
],
Notes = !r.Contains(
"new_rsmnotes"
) ?
string
.Empty : r[
"new_rsmnotes"
],
EstimatedCloseDate = !r.Contains(
"estimatedclosedate"
) ?
string
.Empty : r[
"estimatedclosedate"
],
MaturityValue = !r.Contains(
"estimatedvalue"
) ?
string
.Empty : ((Money)r[
"estimatedvalue"
]).Value.ToString()
});
grdLeadList.DataSource = linqQuery;
grdLeadList.DataBind();
}
<
telerik:radgrid
id
=
"grdLeadList"
runat
=
"server"
autogeneratecolumns
=
"false"
allowpaging
=
"True"
allowsorting
=
"True"
pagesize
=
"5"
allowautomaticupdates
=
"true"
gridlines
=
"None"
allowmultirowselection
=
"true"
onitemcommand
=
"grdLeadList_ItemCommand"
DataKeyNames
=
"opportunityid"
style
=
"float: left; width: 965px;"
>
<
ExportSettings
HideStructureColumns
=
"true"
>
<
Excel
Format
=
"ExcelML"
/>
<
Csv
ColumnDelimiter
=
"Comma"
RowDelimiter
=
"NewLine"
/>
<
Pdf
/>
</
ExportSettings
>
<
PagerStyle
Mode
=
"NextPrevNumericAndAdvanced"
/>
<
MasterTableView
Width
=
"100%"
TableLayout
=
"Auto"
>
<
CommandItemSettings
ShowExportToExcelButton
=
"false"
ShowExportToCsvButton
=
"false"
ShowExportToPdfButton
=
"false"
ShowAddNewRecordButton
=
"false"
/>
<
Columns
>
<
telerik:GridTemplateColumn
UniqueName
=
"CkhSelect"
HeaderText
=
"Select"
>
<
ItemTemplate
>
<
asp:CheckBox
ID
=
"chkbxselect"
runat
=
"server"
/>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridEditCommandColumn
ButtonType
=
"LinkButton"
UpdateText
=
"Update"
CancelText
=
"Cancel"
EditText
=
"Edit"
/>
<
telerik:GridBoundColumn
DataField
=
"OpportunityId"
UniqueName
=
"OpportunityId"
Visible
=
"false"
/>
<
telerik:GridBoundColumn
DataField
=
"CustomerId"
HeaderText
=
"Company Name"
SortExpression
=
"CustomerId"
UniqueName
=
"CompanyName"
/>
<
telerik:GridBoundColumn
DataField
=
"Priority"
HeaderText
=
"Priority"
SortExpression
=
"Priority"
UniqueName
=
"Priority"
/>
<
telerik:GridBoundColumn
DataField
=
"Eval"
HeaderText
=
"Eval"
SortExpression
=
"Eval"
UniqueName
=
"Eval"
/>
<
telerik:GridBoundColumn
DataField
=
"ContactName"
HeaderText
=
"Contact Name"
SortExpression
=
"ContactName"
UniqueName
=
"ContactName"
/>
<
telerik:GridBoundColumn
DataField
=
"Source"
HeaderText
=
"Source"
SortExpression
=
"Source"
UniqueName
=
"Source"
/>
<
telerik:GridBoundColumn
DataField
=
"State"
HeaderText
=
"State"
SortExpression
=
"State"
UniqueName
=
"State"
/>
<
telerik:GridNumericColumn
DataField
=
"Zip"
HeaderText
=
"Zip"
SortExpression
=
"Zip"
UniqueName
=
"Zip"
/>
<
telerik:GridBoundColumn
DataField
=
"ContactStreetAddress"
UniqueName
=
"ContactStreetAddress"
Visible
=
"false"
/>
<
telerik:GridBoundColumn
DataField
=
"ContactCity"
UniqueName
=
"ContactCity"
Visible
=
"false"
/>
<
telerik:GridBoundColumn
DataField
=
"ContactState"
UniqueName
=
"ContactState"
Visible
=
"false"
/>
<
telerik:GridBoundColumn
DataField
=
"ContactZip"
UniqueName
=
"ContactZip"
Visible
=
"false"
/>
<
telerik:GridBoundColumn
DataField
=
"ContactPhone"
UniqueName
=
"ContactPhone"
Visible
=
"false"
/>
<
telerik:GridBoundColumn
DataField
=
"ContactMobilePhone"
UniqueName
=
"ContactMobilePhone"
Visible
=
"false"
/>
<
telerik:GridBoundColumn
DataField
=
"ContactEmail"
UniqueName
=
"ContactEmail"
Visible
=
"false"
/>
<
telerik:GridBoundColumn
DataField
=
"Notes"
UniqueName
=
"Notes"
Visible
=
"false"
/>
<
telerik:GridBoundColumn
DataField
=
"EstimatedCloseDate"
UniqueName
=
"EstimatedCloseDate"
Visible
=
"false"
/>
<
telerik:GridBoundColumn
DataField
=
"MaturityValue"
UniqueName
=
"MaturityValue"
Visible
=
"false"
/>
<
telerik:GridDateTimeColumn
DataField
=
"CreatedOn"
DataFormatString
=
"{0:MM/dd/yy}"
HeaderText
=
"Creation Date"
SortExpression
=
"CreatedOn"
UniqueName
=
"CreationDate"
/>
</
Columns
>
<
EditFormSettings
UserControlName
=
"EditPanel.ascx"
EditFormType
=
"WebUserControl"
>
<
EditColumn
UniqueName
=
"EditCommandColumn1"
/>
</
EditFormSettings
>
</
MasterTableView
>
<
ClientSettings
EnableRowHoverStyle
=
"false"
>
<
Selecting
AllowRowSelect
=
"True"
/>
</
ClientSettings
>
</
telerik:radgrid
>
<
telerik:GridnumericColumn
DataField
=
"ProductionYear"
ColumnEditorID
=
"NumericEditor1"
UniqueName
=
"ProductionYear"
HeaderText
=
"سال تولید"
NumericType
=
"Number"
MaxLength
=
"4"
DataType
=
"System.Int32"
>
</
telerik:GridnumericColumn
>
<
telerik:GridNumericColumnEditor
ID
=
"NumericEditor1"
runat
=
"server"
>
<
NumericTextBox
ID
=
"NumericTextBox1"
DataType
=
"System.Int32"
runat
=
"Server"
>
<
NumberFormat
AllowRounding
=
"true"
DecimalDigits
=
"0"
GroupSeparator
=
""
/>
</
NumericTextBox
>
</
telerik:GridNumericColumnEditor
>
<
telerik:RadMenu
ID
=
"rmMainNav"
runat
=
"server"
Skin
=
"GMSkin"
EnableEmbeddedSkins
=
"false"
DataSourceID
=
"dsMainNavXML"
DataTextField
=
"title"
DataNavigateUrlField
=
"url"
DataValueField
=
"title"
OnItemClick
=
"RadMenu_ItemClick"
Width
=
"100%"
>
</
telerik:RadMenu
>
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
menu
>
<
item
url
=
"#"
title
=
" "
description
=
" "
/>
<
item
url
=
"../Pages/SC.aspx"
title
=
"Savings"
description
=
"Savings"
/>
<
item
url
=
"../Pages/SL.aspx"
title
=
"Shopping"
description
=
"Shopping"
/>
<
item
url
=
"../Pages/BI.aspx"
title
=
"Items"
description
=
"Items"
/>
<
item
url
=
"../Pages/FD.aspx"
title
=
"Deals"
description
=
"Deals"
/>
<
item
url
=
"../Pages/MP.aspx"
title
=
"Profile"
description
=
"Profile"
/>
</
menu
>
ChartSeries chartSeries1 =
new
ChartSeries();
chartSeries1.Type = ChartSeriesType.Line;
chartSeries1.Name =
"TARGET"
;
//chartSeries1.DefaultLabelValue = "TARGET";
chartSeries1.Appearance.ShowLabels =
false
;
//chartSeries1.Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.Nothing;
chartSeries1.Appearance.LabelAppearance.FillStyle.MainColor = Color.Red;
chartSeries1.Appearance.LabelAppearance.FillStyle.SecondColor = Color.Red;
chartSeries1.ActiveRegionToolTip =
"Target"
;
//+ objArea.type.ToString();
chartSeries1.Appearance.LineSeriesAppearance.Color = Color.Red;
chartSeries1.Appearance.LineSeriesAppearance.Width = 1;
chartSeries1.Appearance.FillStyle.SecondColor = Color.Red;
chartSeries1.Appearance.FillStyle.MainColor = Color.Red;
chartSeries1.Appearance.Border.Visible =
false
;
chartSeries1.AddItem(Convert.ToDouble(Target));
chartSeries1.AddItem(Convert.ToDouble(Target));
chartSeries1.AddItem(Convert.ToDouble(Target));
chartSeries1.AddItem(Convert.ToDouble(Target));
rad.Series.Add(chartSeries1);
ChartMarkedZone objZone =
new
ChartMarkedZone();
objZone.Label.TextBlock.Text =
"Target"
;
objZone.Label.Appearance.Position.AlignedPosition = AlignedPositions.Right;
objZone.ValueStartX = -5;
objZone.ValueEndX = 10;
objZone.ValueStartY = 0;
objZone.ValueEndY = 2200;
objZone.Appearance.FillStyle.MainColor = Color.Red;
objZone.Label.Appearance.Visible =
true
;
objZone.Label.TextBlock.Visible =
true
;
rad.PlotArea.MarkedZones.Add(objZone);
// chartSeries1.PlotArea.MarkedZones.Add(objZone);
int
i = 0;
double
max = 0;
foreach
(KeyValuePair<
int
,
double
> pair
in
output.PensionAmount)
{
ChartSeries chartSeries =
new
ChartSeries();
chartSeries.Type = ChartSeriesType.StackedBar;
chartSeries.Appearance.LabelAppearance.Visible =
false
;
chartSeries.Appearance.LineSeriesAppearance.Color = barColors[i];
chartSeries.Appearance.FillStyle.SecondColor = barColors[i];
chartSeries.Appearance.FillStyle.MainColor = barColors[i];
chartSeries.Appearance.Border.Width = 0;
chartSeries.Appearance.BarWidthPercent = 40;
chartSeries.AddItem(pair.Value);
rad.Series.Add(chartSeries);
i++;
max =max+ pair.Value;
}
rad.SeriesOrientation = ChartSeriesOrientation.Horizontal;
rad.PlotArea.YAxis.Appearance.MinorGridLines.Visible =
false
;
rad.PlotArea.YAxis.Appearance.MajorGridLines.Color = Color.White;
rad.PlotArea.YAxis.Appearance.MajorGridLines.PenStyle = DashStyle.Solid;
rad.PlotArea.YAxis.Appearance.MajorGridLines.EndCap = LineCap.NoAnchor;
rad.PlotArea.YAxis.Appearance.MajorGridLines.Visible =
true
;
rad.PlotArea.YAxis.Appearance.Color = Color.Transparent;
rad.PlotArea.XAxis.Appearance.Color = Color.Transparent;
rad.Height = 180;
rad.Width = 480;
rad.PlotArea.Appearance.Dimensions.Margins.Bottom =
new
Telerik.Charting.Styles.Unit(70, Telerik.Charting.Styles.UnitType.Pixel);
rad.PlotArea.Appearance.Dimensions.Margins.Right =
new
Telerik.Charting.Styles.Unit(40, Telerik.Charting.Styles.UnitType.Pixel);
rad.PlotArea.YAxis.AutoScale =
false
;
rad.PlotArea.YAxis.AddRange(0, max, 2000);