/// <summary> /// Конструктор. /// </summary> public NodesPage() { InitializeComponent(); this._viewModel = new NodesViewModel(); this.BindingContext = this._viewModel; this.Title = Droid.Resources.Messages.MainPage_MenuItem_NodeList; }
public IActionResult Index(string location = "NY") { ViewData["sidebar"] = "serverlist"; ViewData["WhereAmI"] = "Server List"; ViewData["location"] = location; NodesViewModel viewModel = new NodesViewModel(); viewModel.Select(location); return(View(viewModel)); }
public ActionResult Group() { var carriages = db.Сarriages.ToList(); var nodes = new List <TreeNode>(); var cities = db.Cities.ToList(); var citiesDict = new Dictionary <int, City>(); foreach (var c in cities) { citiesDict.Add(c.Id, c); } //ViewBag.CitiesDict = citiesDict; foreach (var city in cities) { var tmpNodeLevel = carriages.Where(c => c.SendingCityId == city.Id).ToList(); int planCarr = 0; int factCarr = 0; foreach (var carr in tmpNodeLevel) { carr.FactualCarriage = db.СarriageCount.Where(cc => cc.CarriageId == carr.Id).ToList(); planCarr += carr.PlanCarriage; foreach (var cc in carr.FactualCarriage) { factCarr += cc.CarrValue; } } if (tmpNodeLevel != null && tmpNodeLevel.Count > 0) { nodes.Add(new TreeNode { CurrentId = tmpNodeLevel[0].SendingCityId, FactCarriages = factCarr, PlanCarriages = planCarr, ParentId = -1 }); } } foreach (var carr in carriages) { int factCarr = 0; foreach (var cc in carr.FactualCarriage) { factCarr += cc.CarrValue; } nodes.Add(new TreeNode { CurrentId = carr.ArrivalCityId, FactCarriages = factCarr, PlanCarriages = carr.PlanCarriage, ParentId = carr.SendingCityId }); } NodesViewModel nodesViewModel = new NodesViewModel { Nodes = nodes, Cities = citiesDict }; return(View(nodesViewModel)); }
public async Task <IActionResult> Index() { var viewModel = new NodesViewModel(); var requesters = await _business.GetAllRequestersAsync(); var producers = await _business.GetAllProducersAsync(); if (producers.HasSucceeded) { viewModel.Requesters = requesters.Result; } if (requesters.HasSucceeded) { viewModel.Producers = producers.Result; } if (!producers.HasSucceeded) { RegisterError(producers.Exception.Message); return(View(viewModel)); } if (!requesters.HasSucceeded) { RegisterError(requesters.Exception.Message); return(View(viewModel)); } var breadcrumbItems = new List <BreadcrumbItem>() { new BreadcrumbItem { Display = "Home", URL = "/" }, new BreadcrumbItem { Display = "Nodes", URL = "/Nodes" } }; SetBreadCrumb(breadcrumbItems); return(View(viewModel)); }
public RemoveNode(NodesViewModel nodesVm, RoutesViewModel routesVm, RoadsViewModel roadsVm) => (this.nodesVm, this.routesVm, this.roadsVm) = (nodesVm, routesVm, roadsVm);
/// <summary> /// Конструктор /// </summary> /// <param name="viewModel"></param> public ReportCommand(NodesViewModel viewModel) { _viewModel = viewModel; }
public EditNode(NodesViewModel nodesVm) => this.nodesVm = nodesVm;
/// <summary> /// Конструктор /// </summary> /// <param name="viewModel"></param> public RefreshCommand(NodesViewModel viewModel) { _viewModel = viewModel; }
public AddNode(MapControlViewModel mapVm, NodesViewModel nodeVm, Action <object> endAction = null) => (MapViewModel, NodesViewModel, this.endAction) = (mapVm, nodeVm, endAction);
public EditNodeFinish(NodesViewModel vm) => nodesVm = vm;
/// <summary> /// Конструктор /// </summary> /// <param name="viewModel"></param> public SearchCommand(NodesViewModel viewModel) { _viewModel = viewModel; }
/// <summary> /// Конструктор /// </summary> /// <param name="viewModel"></param> public ReportMeasurePointsCommand(NodesViewModel viewModel) { _viewModel = viewModel; }
/// <summary> /// Конструктор /// </summary> /// <param name="viewModel"></param> public SelectingCommand(NodesViewModel viewModel) { _viewModel = viewModel; }