public DashboardJson GetDashboardData()
{
DashboardJson objDashboardJson = new DashboardJson();
objDashboardJson.initialZoom = 12;
int keyid = 1;
objDashboardJson.Id = keyid;
var dashboarddatas = this.ObjectContext.usp_GetDashboardData().ToList();
List<GroupJson> list = new List<GroupJson>();
int grpid = 0;
int cellId = 0;
double initialLat = 42;
double initialLng = -88;
double lat;
double lng;
GroupJson groupJson = null;
CellJson cellJson = null;
List<string> sectors = new List<string>();
foreach (var dashboardData in dashboarddatas)
{
if (grpid == 0)
{
groupJson = CreateGroupJson(dashboardData.GroupId, dashboardData.GroupName, dashboardData.RegionName);
cellJson = CreateCellJson(dashboardData.CellId, dashboardData.URL, "red", dashboardData.CellName, dashboardData.Time, dashboardData.Status, dashboardData.CellType);
cellJson.duration += dashboardData.Duration;
PopulateNodeSectors(dashboardData.CellId, cellJson);
if (cellJson.Sectors != null && cellJson.Sectors.Count > 0)
cellJson.Sectors[dashboardData.Dsp].Duration = dashboardData.Duration;
groupJson.Cells.Add(cellJson);
list.Add(groupJson);
}
else
{
groupJson = CreateGroupJson(dashboardData.GroupId, dashboardData.GroupName, dashboardData.RegionName);
cellJson = CreateCellJson(dashboardData.CellId, dashboardData.URL, "red", dashboardData.CellName, dashboardData.Time, dashboardData.Status, dashboardData.CellType);
cellJson.duration += dashboardData.Duration;
PopulateNodeSectors(dashboardData.CellId, cellJson);
if (cellJson.Sectors != null && cellJson.Sectors.Count > 0)
cellJson.Sectors[dashboardData.Dsp].Duration = dashboardData.Duration;
groupJson.Cells.Add(cellJson);
list.Add(groupJson);
}
grpid = dashboardData.GroupId;
cellId = dashboardData.CellId;
}
return objDashboardJson;
}
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace Protools.ViewModels
{
public class DashViewModel
{
private DashboardContext dashboard = new DashboardContext();
}
}
Hi
I write code for Create json in Servies(RIA Services) method name as Dashservice.cs. And also create ViewModel class file name as DashViewModel.cs
Now My question is How to pass or call return value (return objDashboardJson) in viewmodel...
Pls Help Me...