Esempio n. 1
0
        /// <summary>
        /// Конструктор.
        /// </summary>
        public NodesPage()
        {
            InitializeComponent();

            this._viewModel     = new NodesViewModel();
            this.BindingContext = this._viewModel;

            this.Title = Droid.Resources.Messages.MainPage_MenuItem_NodeList;
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        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);
Esempio n. 6
0
 /// <summary>
 /// Конструктор
 /// </summary>
 /// <param name="viewModel"></param>
 public ReportCommand(NodesViewModel viewModel)
 {
     _viewModel = viewModel;
 }
Esempio n. 7
0
 public EditNode(NodesViewModel nodesVm) => this.nodesVm = nodesVm;
Esempio n. 8
0
 /// <summary>
 /// Конструктор
 /// </summary>
 /// <param name="viewModel"></param>
 public RefreshCommand(NodesViewModel viewModel)
 {
     _viewModel = viewModel;
 }
Esempio n. 9
0
 public AddNode(MapControlViewModel mapVm, NodesViewModel nodeVm,
                Action <object> endAction = null)
 => (MapViewModel, NodesViewModel, this.endAction) = (mapVm, nodeVm, endAction);
Esempio n. 10
0
 public EditNodeFinish(NodesViewModel vm) => nodesVm = vm;
Esempio n. 11
0
 /// <summary>
 /// Конструктор
 /// </summary>
 /// <param name="viewModel"></param>
 public SearchCommand(NodesViewModel viewModel)
 {
     _viewModel = viewModel;
 }
Esempio n. 12
0
 /// <summary>
 /// Конструктор
 /// </summary>
 /// <param name="viewModel"></param>
 public ReportMeasurePointsCommand(NodesViewModel viewModel)
 {
     _viewModel = viewModel;
 }
Esempio n. 13
0
 /// <summary>
 /// Конструктор
 /// </summary>
 /// <param name="viewModel"></param>
 public SelectingCommand(NodesViewModel viewModel)
 {
     _viewModel = viewModel;
 }