Hello, I'm new in silverlight. I want to create a sales dashboard like in telerik demo (RadGridView, First Look Sample).
I can display Employees data from northwind database on silverlight radgridview. I uses Linq to SQL Class and WCF Service.
but I don't know how to get Orders and Order Details Data that relate with each employee, could anyone suggest me, please.
here is my code.
EmployeeService.vb
MainPage.xaml.vb
please suggest me how to get orders and orderdetails that relate to each employee.
thank you.
I can display Employees data from northwind database on silverlight radgridview. I uses Linq to SQL Class and WCF Service.
but I don't know how to get Orders and Order Details Data that relate with each employee, could anyone suggest me, please.
here is my code.
EmployeeService.vb
Imports System.ServiceModel |
Imports System.ServiceModel.Activation |
<ServiceContract(Namespace:="")> |
<AspNetCompatibilityRequirements(RequirementsMode:=AspNetCompatibilityRequirementsMode.Allowed)> |
Public Class EmployeeService |
<OperationContract()> |
Function GetEmployee() As List(Of Employee) |
Dim db = New EmployeeDataDataContext() |
Dim emp = From e In db.Employees Where e.Title = "Sales Representative" Select e.Photo, e.EmployeeID, e.FirstName, e.LastName, e.Title, e.Address, e.City, e.PostalCode, e.HomePhone, e.BirthDate, e.HireDate Order By EmployeeID |
Dim SalesRepList As List(Of Employee) = New List(Of Employee) |
For Each e In emp |
Dim SaleRep As Employee = New Employee() |
SaleRep.EmployeeID = e.EmployeeID |
SaleRep.FirstName = e.FirstName |
SaleRep.LastName = e.LastName |
SaleRep.Title = e.Title |
SaleRep.Address = e.Address |
SaleRep.City = e.City |
SaleRep.PostalCode = e.PostalCode |
SaleRep.HomePhone = e.HomePhone |
SaleRep.BirthDate = e.BirthDate |
SaleRep.HireDate = e.HireDate |
SalesRepList.Add(SaleRep) |
Next |
Return SalesRepList |
End Function |
MainPage.xaml.vb
Imports Telerik.Windows.Controls |
Partial Public Class MainPage |
Inherits UserControl |
Public Sub New() |
InitializeComponent() |
Dim svc As EmployeeServiceReference.EmployeeServiceClient = New EmployeeServiceReference.EmployeeServiceClient() |
AddHandler svc.GetEmployeeCompleted, AddressOf svc_GetEmployeeCompleted |
svc.GetEmployeeAsync() |
End Sub |
Private Sub svc_GetEmployeeCompleted(ByVal sender As Object, ByVal e As EmployeeServiceReference.GetEmployeeCompletedEventArgs) |
gvEmployee.ItemsSource = e.Result |
End Sub |
End Class |
please suggest me how to get orders and orderdetails that relate to each employee.
thank you.