Esempio n. 1
0
 public LMProjectVM()
 {
     HomeTeam  = new LMTeamVM();
     AwayTeam  = new LMTeamVM();
     Timeline  = new LMTimelineVM(HomeTeam, AwayTeam);
     Dashboard = new DashboardVM();
 }
Esempio n. 2
0
        public ActionResult Home()
        {
            DashboardVM model        = new DashboardVM();
            int         user         = db.UserAccounts.Select(x => x.UserID).Count();
            int         activeUser   = db.UserAccounts.Where(x => x.Status == true).Select(x => x.UserID).Count();
            int         verifiedUser = db.UserAccounts.Where(x => x.IsVerified == true).Select(x => x.UserID).Count();

            model = new DashboardVM()
            {
                CountUser = user,

                CountActive   = activeUser,
                CountInactive = user - activeUser,

                CountVerified    = verifiedUser,
                CountNonVerified = user - verifiedUser,

                CountItem      = db.ItemDetails.Select(x => x.ItemID).Count(),
                CountSearching = db.SearchingFors.Select(x => x.SearchingForID).Count(),

                CountContacted  = db.ContactUss.Select(x => x.ContactUsID).Count(),
                CountNewsletter = db.Newsletters.Select(x => x.NewsletterID).Count()
            };

            return(PartialView(model));
        }
Esempio n. 3
0
 public void Setup()
 {
     model     = Utils.DashboardDummy.Default();
     dashboard = new DashboardVM {
         Model = model
     };
 }
Esempio n. 4
0
        public ActionResult Index(int?SelectedBudgetId)
        {
            if (User.Identity.IsAuthenticated)
            {
                try
                {
                    var user = db.Users.Find(User.Identity.GetUserId());

                    if (user.HouseholdId == null)
                    {
                        return(RedirectToAction("Create", "Households"));
                    }

                    DashboardVM dashboardVm = new DashboardVM();
                    dashboardVm.Members = user;
                    var userHouseholdId = user.HouseholdId;

                    dashboardVm.HouseHold    = db.Households.Single(h => h.Id == userHouseholdId);
                    dashboardVm.BankAccounts = db.BankAccounts.Where(a => a.HouseholdId == userHouseholdId).ToList();

                    var listOfAccountIds = dashboardVm.BankAccounts.Select(t => t.Id).ToList();

                    dashboardVm.Transactions = db.Transactions.Where(t => listOfAccountIds.Contains(t.BankAccountsId)).OrderByDescending(t => t.Date).ToList();

                    dashboardVm.HouseholdExpenses = dashboardVm.Transactions.Where(t => t.TransactionType.Name == "Withdrawal").Sum(t => t.Amount);
                    dashboardVm.HouseholdIncome   = dashboardVm.Transactions.Where(t => t.TransactionType.Name == "Deposit").Sum(t => t.Amount);

                    var      todaysDate            = DateTime.Now;
                    DateTime firstDayOfTodaysMonth = new DateTime(todaysDate.Year, todaysDate.Month, 1);

                    dashboardVm.WithdrawalsForCurrentMonth = dashboardVm.Transactions.Where(
                        t => t.TransactionType.Name == "Withdrawal" &&
                        (t.Date >= firstDayOfTodaysMonth && t.Date <= todaysDate)).ToList();                                                   // gets transactions from beginning of this month up until today

                    if (SelectedBudgetId != null)
                    {
                        dashboardVm.Budgets = db.Budgets.FirstOrDefault(b => b.HouseholdId == user.HouseholdId && b.Id == SelectedBudgetId);
                    }

                    else
                    {
                        dashboardVm.Budgets = db.Budgets.FirstOrDefault(b => b.HouseholdId == user.HouseholdId);
                    }

                    ViewBag.SelectedBudgetId = new SelectList(db.Budgets.Where(b => b.HouseholdId == userHouseholdId), "Id", "Name");
                    return(View(dashboardVm));
                }

                catch (Exception)
                {
                    return(RedirectToAction("page404", "Home"));
                }
            }

            else
            {
                // user doesn't have household id, make them register and create one there (create new household or join one)
                return(RedirectToAction("Login", "Account"));
            }
        }
Esempio n. 5
0
        public ActionResult Dashboard()
        {
            ViewBag.TimePeriod = "Year-to-date";
            var model = new DashboardVM();

            return(View(model));
        }
        public ActionResult CreateDeposit(DashboardVM transaction)
        {
            var userId  = User.Identity.GetUserId();
            var deposit = new Transaction()
            {
                BankAccountId   = transaction.BankAccountId,
                BudgetItemId    = null,
                OwnerId         = userId,
                TransactionType = TransactionType.Deposit,
                Created         = DateTime.Now,
                Amount          = transaction.Amount,
                Memo            = transaction.Memo,
                IsDeleted       = false
            };

            db.Transactions.Add(deposit);
            db.SaveChanges();
            deposit.UpdateBalances();
            return(RedirectToAction("Dashboard", "Home"));

            //ViewBag.BankAccountId = new SelectList(db.BankAccounts, "Id", "Name", transaction.BankAccountId);
            //ViewBag.BudgetItemId = new SelectList(db.BudgetItems, "Id", "Name", transaction.BudgetItemId);
            //ViewBag.OwnerId = new SelectList(db.Users, "Id", "FullName", transaction.OwnerId);
            //return View(transaction);
        }
Esempio n. 7
0
        public IActionResult Index()
        {
            DashboardVM dashboardVM = new DashboardVM();

            List <NumerosAnalisesDTO> numerosAnalises = new NumerosAnalisesBO(_connectionStrings.DefaultConnection).GetAllRelacoes();

            dashboardVM.arrayDatasAnalise            = JsonConvert.SerializeObject(numerosAnalises.Select(x => x.AnoMesFormatado));
            dashboardVM.arrayTotalResultadosAnalises = JsonConvert.SerializeObject(numerosAnalises.Select(x => x.TotalResultados));

            dashboardVM.arrayTotalResAnalises2015 = JsonConvert.SerializeObject(numerosAnalises.Where(x => x.Ano == 2015).Select(x => x.TotalResultados));
            dashboardVM.arrayTotalResAnalises2016 = JsonConvert.SerializeObject(numerosAnalises.Where(x => x.Ano == 2016).Select(x => x.TotalResultados));
            dashboardVM.arrayTotalResAnalises2017 = JsonConvert.SerializeObject(numerosAnalises.Where(x => x.Ano == 2017).Select(x => x.TotalResultados));
            dashboardVM.arrayTotalResAnalises2018 = JsonConvert.SerializeObject(numerosAnalises.Where(x => x.Ano == 2018).Select(x => x.TotalResultados));


            List <FiliadosFuncionariosDTO> filiadosFuncionariosPartidos = new FiliadosFuncionariosBO(_connectionStrings.DefaultConnection).GetTopPartidos();

            dashboardVM.arrayPartidos       = JsonConvert.SerializeObject(filiadosFuncionariosPartidos.Select(x => x.Partido));
            dashboardVM.arrayNumTopPartidos = JsonConvert.SerializeObject(filiadosFuncionariosPartidos.Select(x => x.Quantidade));


            List <GastosTotaisDTO> gastosPorAno = new GastosTotaisBO(_connectionStrings.DefaultConnection).GetGastosPorAno();

            dashboardVM.arrayGastosPorAno = JsonConvert.SerializeObject(gastosPorAno.Select(x => x.TotalRemuneracao));

            return(View(dashboardVM));
        }
Esempio n. 8
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     WheelViewModel     = new WheelVM(SimulatorModel);
     DashboardViewModel = new DashboardVM(SimulatorModel);
     GameMapViewModel   = new GameMapVM(SimulatorModel);
     ExceptionViewModel = new ExceptionVM(SimulatorModel);
 }
        public JsonResult Add(DashboardVM dashboard)
        {
            if (!String.IsNullOrWhiteSpace(dashboard.Name))
            {
                Dashboard d = new Dashboard();
                d.ID          = Guid.NewGuid();
                d.Name        = dashboard.Name;
                d.CreatedDate = DateTime.Parse(DateTime.Now.ToShortDateString());

                db.Dashboards.Add(d);
                var result = db.SaveChanges();
                if (result > 0)
                {
                    Log.Debug("[TODOAPP]: New dashboard created" + d.Name);
                    return(JsonSuccess(d, "Dashboard created!"));
                }
                else
                {
                    Log.Error("[TODOAPP]: Dashboard error(check db)");
                    return(JsonError("Dashboard can't added!"));
                }
            }
            else
            {
                Log.Error("[TODOAPP]: Dashboard name empty error");

                return(JsonError("Dashboard can't added!"));
            }
        }
        public IActionResult Index()
        {
            // List<Product> NewArrival = dbContext.Products
            //     .Include(p => p.Stocks)
            //     .OrderByDescending(p => p.CreatedAt)
            //     .Take(5)
            //     .ToList();

            List <Stock> stocks = dbContext.Stocks
                                  .Include(s => s.Product)
                                  .ThenInclude(p => p.ProductType)
                                  .OrderBy(s => s.Product.ProductTypeId)
                                  .ToList();

            List <Stock> NewStocks = dbContext.Stocks
                                     .Include(s => s.Product)
                                     .ThenInclude(p => p.ProductType)
                                     .OrderByDescending(s => s.Product.CreatedAt)
                                     .Take(5)
                                     .ToList();

            DashboardVM model = new DashboardVM();

            // model.Products = Products;
            // model.NewArrival = NewArrival;
            model.Stocks           = stocks;
            model.NewArrivalStocks = NewStocks;

            return(View(model));
        }
Esempio n. 11
0
        public ActionResult Dashboard()
        {
            var myUserId   = User.Identity.GetUserId();
            var allTickets = db.Tickets.ToList();
            // I have to load up a DashboardVM to feed to the view
            var dashboardVM = new DashboardVM()
            {
                TicketCount             = allTickets.Count,
                HighPriorityTicketCount = allTickets.Where(t => t.TicketPriority.Name == "Immediate").Count(),
                NewTicketCount          = allTickets.Where(t => t.TicketStatus.Name == "New").Count(),
                TotalComments           = db.TicketComments.Count(),
                AllTickets = allTickets
            };

            dashboardVM.ProjectVM.ProjectCount = db.Projects.Count();
            dashboardVM.ProjectVM.AllProjects  = db.Projects.ToList();
            dashboardVM.ProjectVM.AllPMs       = roleHelper.UsersInRole("Manager").ToList();
            dashboardVM.ProjectVM.AllDevs      = roleHelper.UsersInRole("Developer").ToList();
            dashboardVM.ProjectVM.AllSubs      = roleHelper.UsersInRole("Submitter").ToList();
            dashboardVM.MyProjects             = projHelper.ListUserProjects(myUserId).ToList();
            dashboardVM.MyTickets = ticketHelper.ListMyTickets(myUserId).ToList();
            dashboardVM.RoleNames = roleHelper.ListUserRoles(myUserId).FirstOrDefault() ?? "Unassigned";


            return(View(dashboardVM));
        }
Esempio n. 12
0
        public ActionResult Dashboard()
        {
            var         repo        = RepositoryFactory.GetRepository();
            DashboardVM dashboardVM = new DashboardVM();

            dashboardVM.StaticPosts = repo.GetAllStaticPublished();
            dashboardVM.Categories  = repo.GetAllCategories();
            if (Request.IsAuthenticated && User.IsInRole("admin"))
            {
                dashboardVM.PostsUnderReview = repo.GetPostForReview();
            }
            if (Request.IsAuthenticated && User.IsInRole("moderator"))
            {
                var posts = repo.GetAllPosts();
                dashboardVM.PostsUnderReview = (from p in posts
                                                where p.IsPublished == false && p.IsForReview == false
                                                select p).ToList();
            }

            dashboardVM.PostsPendingComments = repo.GetPostsWithUnapprovedCommentsAndReplies();
            dashboardVM.CategoryPickList     = new SelectList(dashboardVM.Categories, "CategoryID", "CategoryTag");


            return(View(dashboardVM));
        }
Esempio n. 13
0
        public DashboardVM GetDashboardSiteVM(string ParentFilter, string ChildFilter, DateTime fromDate, DateTime toDate, string Panel1Option, Int64 Panel1Value, string Panel2Option, Int64 Panel2Value, Int64 UserId, string FilterOption, int Offset, int PageSize, string CountryId, string Client = null, string Scopes = null, string Projects = null)
        {
            try
            {
                DashboardDL db = new DashboardDL();
                DataSet     ds = db.GetDashboardSites(ParentFilter, ChildFilter, fromDate, toDate, Panel1Option, Panel1Value, Panel2Option, Panel2Value, UserId, FilterOption, Offset, PageSize, CountryId, Client, Scopes, Projects);
                // DataTable TotalSites =;
                DataTable   DashboardData = ds.Tables[0];
                DashboardVM vm            = new DashboardVM();

                ClientSitesVM ClientSites = new ClientSitesVM();
                ClientSites.Sites = GetSitesFromTable(ds.Tables[0]);

                vm.ClientSites = ClientSites;
                if (ds.Tables.Count == 2)
                {
                    DataTable Count = ds.Tables[1];
                    vm.Count = (!string.IsNullOrEmpty(Count.Rows[0]["Count"].ToString())) ? Convert.ToInt32(Count.Rows[0]["Count"].ToString()) : 0;
                }

                return(vm);
            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 14
0
 public DashBoard()
 {
     this.InitializeComponent();
     VM = new DashboardVM(new NavigationService());
     VM.GetDataAsync();
     this.DataContext = VM;
 }
Esempio n. 15
0
        public DashboardVM GetQuotationCount()
        {
            try
            {
                DashboardVM        objDashboardVM = new DashboardVM();
                PERFECTIBSEntities db             = new PERFECTIBSEntities();

                objDashboardVM.PendingQuotationCount     = unitOfWork.TblQuotationHeaderRepository.Get(o => o.QuotationStatusCode.Equals("QP")).Count();
                objDashboardVM.ApprovedQuotationCount    = unitOfWork.TblQuotationHeaderRepository.Get(o => o.QuotationStatusCode.Equals("CA")).Count();
                objDashboardVM.NotCreatingQuotationCount = unitOfWork.TblQuotationHeaderRepository.Get(o => o.QuotationStatusCode.Equals("QNC")).Count();
                objDashboardVM.TCNIQuotationCount        = unitOfWork.TblQuotationHeaderRepository.Get(o => o.QuotationStatusCode.Equals("TCNI")).Count();
                objDashboardVM.QuotationTotalCount       = unitOfWork.TblQuotationHeaderRepository.Get().Count();
                objDashboardVM.ClientRequestCount        = unitOfWork.TblClientRequestHeaderRepository.Get().Count();


                List <sp_GetClientVSQuotation_Count_Result> ListItems = db.sp_GetClientVSQuotation_Count().ToList <sp_GetClientVSQuotation_Count_Result>();
                // objDashboardVM.ClientRequestWithQuotation = ListItems;

                return(objDashboardVM);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        // GET: Dashboard
        public ActionResult Index()
        {
            //Create a instance of the dashboard view model
            var data = new DashboardVM();

            //Get the data for the table
            data.TableData.Projects            = db.Projects.OrderByDescending(p => p.Id).Take(5).ToList();
            data.TableData.Tickets             = db.Tickets.OrderByDescending(t => t.Created).Take(5).ToList();
            data.TableData.TicketNotifications = db.TicketNotifications.OrderByDescending(t => t.Id).Take(5).ToList();
            data.TableData.TicketAttachments   = db.TicketAttachments.OrderByDescending(t => t.Id).Take(5).ToList();
            data.TableData.TicketComments      = db.TicketComments.OrderByDescending(t => t.Created).Take(5).ToList();
            data.TableData.TicketHistories     = db.TicketHistories.OrderByDescending(t => t.DateChanged).Take(5).ToList();

            //get the tickets for the current user
            var myTickets = ticketHelper.GetMyTickets(User.Identity.GetUserId());

            data.TicketData.TicketCount           = myTickets.Count();
            data.TicketData.UnAssignedTicketCount = myTickets.Where(t => t.TicketStatus.Name == "UnAssigned").Count();
            data.TicketData.InProgressTicketCount = myTickets.Where(t => t.TicketStatus.Name == "In Progress").Count();
            data.TicketData.OnHoldTicketCount     = myTickets.Where(t => t.TicketStatus.Name == "On Hold").Count();
            data.TicketData.CompletedTicketCount  = myTickets.Where(t => t.TicketStatus.Name == "Resolved").Count();

            data.TicketData.TicketNotificationCount = db.TicketNotifications.Count();
            data.TicketData.TicketAttachmentCount   = db.TicketAttachments.Count();
            data.TicketData.TicketCommentCount      = db.TicketComments.Count();
            data.TicketData.TicketHistoryCount      = db.TicketHistories.Count();

            //Load up all the Project Dashboard Data
            data.ProjectData.ProjCount = db.Projects.Count();



            return(View(data));
        }
Esempio n. 17
0
        public ActionResult SiteGrid(int Page, int SiteId, string filter)
        {
            DashboardVM vm            = new DashboardVM();
            DashboardBL loDashboardBL = new DashboardBL();

            try
            {
                //SINGLE_SITE
                //SiteDashboard
                int offset = (Page - 1) * 5;
                vm           = loDashboardBL.GetDashboardSiteVM(null, null, DateTime.Now, DateTime.Now, null, SiteId, null, 0, ViewBag.UserId, filter, offset, 5, "0");
                ViewBag.Show = "no";
                ViewBag.view = "SiteDashboard";

                foreach (var item in vm.ClientSites.Sites)
                {
                    ViewBag.Latitude  = item.Latitude;
                    ViewBag.Longitude = item.Longitude;
                    break;
                }


                return(PartialView("~/Views/Dashboard/_SiteGrid.cshtml", vm.ClientSites));
            }
            catch (System.Exception)
            {
                return(null);
            }
        }
Esempio n. 18
0
        public ActionResult Index()
        {
            try
            {
                var vm = new DashboardVM();

                var companyID = Convert.ToInt32(Session["CompanyID"]);
                var yearID    = Convert.ToInt32(Session["FinancialYearID"]);

                vm.totalPurchases = db.PurchaseOrders
                                    .Where(x => x.CompanyId == companyID)
                                    .Where(x => x.financial_year == yearID)
                                    .ToList().Sum(x => x.NetAmount);

                vm.totalSales = db.InvoiceMasters
                                .Where(x => x.CompanyId == companyID)
                                .Where(x => x.financial_year == yearID)
                                .ToList().Sum(x => x.net_amount);

                vm.totalExpenses = 0;

                vm.topProducts    = GetTopProducts(yearID, companyID);
                vm.topCustomers   = GetTopCustomers(yearID, companyID);
                vm.topVendors     = GetTopVendors(yearID, companyID);
                vm.latestPurchase = GetLatestPurchaseOrders(yearID, companyID);
                vm.SalesAmount    = GetSalesAmount(yearID, companyID);
                vm.SalesCount     = GetSalesCount(yearID, companyID);

                return(View(vm));
            }
            catch (Exception e)
            {
                return(HttpNotFound(e.InnerException.Message));
            }
        }
Esempio n. 19
0
        public AppWindow(MyFlightSimulatorModel model, MainWindow main, IVM vm)
        {
            InitializeComponent();

            // initializing the main wondow fields and the vm field
            this._main = main;
            this.vm    = vm;

            // creating the view model of the dashboard
            DashboardVM dashboardVM = new DashboardVM(model);

            myDashboard.DataContext = dashboardVM;

            // creating the view model of the map
            MapVM mapVM = new MapVM(model);

            myMap.DataContext = mapVM;

            // creating the view model of the joystick
            JoystickVM joystickVm = new JoystickVM(model);

            myControlPlane.DataContext            = joystickVm;
            myControlPlane.myJoystick.DataContext = joystickVm;

            // creating the view model of the dashboard errors
            myDashboardErrors.DataContext = dashboardVM;
        }
Esempio n. 20
0
        public IActionResult Index()
        {
            AutentifikacijaVM korisnik = HttpContext.GetLogiraniKorisnik();

            DashboardVM model = new DashboardVM()
            {
                BrojKlijenata  = _db.Klijent.Count(),
                BrojIzvjestaja = _db.Izvjestaj.Count(),
                BrojOsiguranja = _db.PolicaOsiguranja.Count(),
                BrojRentacar   = _db.RentBooking.Count(),
                BrojVozila     = _db.Vozilo.Count(),
                BrojNarudzbi   = _db.Narudzba.Count(),
                BrojFaktura    = _db.Faktura.Count(),
                BrojUplata     = _db.Uplata.Count()
            };

            if (korisnik.IsAdmin)
            {
                return(View("AdminDashboard", model));
            }
            else if (korisnik.IsMenadzer)
            {
                return(View("ManagerDashboard", model));
            }
            else if (korisnik.IsProdavac)
            {
                return(View("ProdajaDashboard", model));
            }
            else
            {
                return(View("RentDashboard", model));
            }
        }
Esempio n. 21
0
        public ActionResult Dashboard()
        {
            var userId = User.Identity.GetUserId();

            if (User.IsInRole("Guest") || !houseHelp.IsHouseholdConfigured(userId))
            {
                return(View(new DashboardVM()));
            }
            ;
            var user      = db.Users.Where(u => u.Id == userId).FirstOrDefault();
            var houseId   = (int)user.HouseholdId;
            var lastTrans = db.Transactions.OrderByDescending(t => t.Created).FirstOrDefault(t => t.OwnerId == userId);
            var dashboard = new DashboardVM
            {
                BankBalance     = db.BankAccounts.Where(bA => bA.OwnerId == userId).Sum(x => x.CurrentBalance),
                BudgetTotal     = db.Budgets.Where(b => b.HouseholdId == houseId).SelectMany(b => b.BudgetItems).Sum(x => x.TargetAmount),
                LastTransaction = lastTrans != null ? lastTrans.Amount : 0,
            };

            ViewBag.BankAccountId   = new SelectList(db.BankAccounts.Where(b => b.OwnerId == userId), "Id", "Name");
            ViewBag.BankAccountFrom = new SelectList(db.BankAccounts.Where(b => b.OwnerId == userId), "Id", "Name");
            ViewBag.BankAccountTo   = new SelectList(db.BankAccounts.Where(b => b.OwnerId == userId), "Id", "Name");
            ViewBag.BudgetItemId    = new SelectList(db.Budgets.Where(b => b.HouseholdId == houseId).SelectMany(b => b.BudgetItems), "Id", "Name");
            ViewBag.Transactions    = db.Transactions.Where(t => t.OwnerId == userId).ToList();
            return(View(dashboard));
        }
        // GET: Households/Index/5
        public ActionResult Index()
        {
            var       user      = db.Users.Find(User.Identity.GetUserId());
            Household household = db.Households.Include("Accounts").FirstOrDefault(h => h.Id == user.HouseholdId);

            if (household != null)
            {
                var ReconciledBalance = household.Accounts.SelectMany(a => a.Transactions).Where(t => t.Reconciled == true).Select(m => m.Amount).Sum();
                var accountList       = from acc in household.Accounts
                                        let inc = (from tr in acc.Transactions
                                                   where (tr.Reconciled == true && tr.Category.Type == "Income")
                                                   select tr.Amount).Sum()
                                                  let exp = (from tr in acc.Transactions
                                                             where (tr.Reconciled == true && tr.Category.Type == "Expense")
                                                             select tr.Amount).Sum()
                                                            select new RecBalVM()
                {
                    Account = acc,
                    RecBal  = inc - exp
                };
                DashboardVM dashboardVM = new DashboardVM()
                {
                    Household = household,
                    RecBalVM  = accountList.ToList()
                };

                return(View(dashboardVM));
            }
            TempData["FirstCreateOrJoin"] = "To Get Started, You Must First Create or Join a Group.";
            return(RedirectToAction("Create", "Households"));
        }
Esempio n. 23
0
        public async Task <ActionResult> DashboardAsyncA()
        {
            var model = new DashboardVM();

            Stopwatch watch = new Stopwatch();

            watch.Start();

            //Hasta este punto SYNC - Hasta que se encuentra con el primer await
            model.Categories = await _service.GetCategoriesAsync(); //Delay 5 seconds

            //Await --> Se bloquea 5 seconds
            //Despues de ejecutar GetCategoriesAsync continua
            Debug.WriteLine("then GetCategoriesAsync");

            model.Posts = await _service.GetPostsAsync();//Delay 5 seconds

            //Await --> Se bloquea 5 seconds
            Debug.WriteLine("then GetPostsAsync");

            model.Tags = await _service.GetTagsAsync();//Delay 5 seconds

            //Await --> Se bloquea 5 seconds
            Debug.WriteLine("then GetTagsAsync");
            watch.Stop();
            ViewBag.Time = watch.ElapsedMilliseconds;

            /*
             * Si bien usamos async en este caso lo estamos haciendo sincronicamente dato que hacemos
             * await _service.GetCategoriesAsync(); --> Mandamos a ejecutar y esperamos al mismo tiempo.
             */

            return(View(model));
        }
Esempio n. 24
0
 public void SetUp()
 {
     dashboard = new DashboardVM {
         Model = Utils.DashboardDummy.Default(), Mode = DashboardMode.Code
     };
     dashboardCanvas           = new DashboardCanvas();
     dashboardCanvas.ViewModel = dashboard;
 }
Esempio n. 25
0
        public IActionResult Index()
        {
            DashboardVM dvm = new DashboardVM()
            {
            };

            return(View(dvm));
        }
Esempio n. 26
0
        public IActionResult Index()
        {
            var alias = context.Users.Find(userId).Alias;
            var model = new DashboardVM {
                Alias = alias
            };

            return(View(model));
        }
        public IActionResult Index()
        {
            DashboardVM dvm = new DashboardVM()
            {
            };

            ViewData["ClientIdList"] = new SelectList(_context.Client.OrderBy(c => c.Denumire), "ClientId", "Denumire");
            return(View(dvm));
        }
Esempio n. 28
0
        // Initializing the simulator model and all the view models.
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            ISimulatorModel simulatorModel = new SimulatorModel(new MyTelnetClient());

            ConnectVM      = new ConnectVM(simulatorModel);
            DashboardVM    = new DashboardVM(simulatorModel);
            ControlBoardVM = new ControlBoardVM(simulatorModel);
            MapVM          = new MapVM(simulatorModel);
        }
Esempio n. 29
0
        public IActionResult Index()
        {
            var model = new DashboardVM();

            model.EmployeesCount    = context.Nalozi.Where(x => x.IsUposlenik == true).Count();
            model.ClientsCount      = context.Nalozi.Where(x => x.IsKlijent == true).Count();
            model.AppointmentsCount = context.Termini.Count();
            return(View(model));
        }
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            this.InitializeComponent();
            this.Suspending += OnSuspending;

            // Initializing Singletons
            Debug.WriteLine("Initializing Singleton ....");
            var dashboardVMInit = DashboardVM.Instance(nameof(TestPage1));
        }
 void Select(DashboardVM dashboardVM)
 {
     TreeIter iter;
     dashboardsStore.GetIterFirst (out iter);
     while (dashboardsStore.IterIsValid (iter)) {
         if ((dashboardsStore.GetValue (iter, COL_DASHBOARD) as DashboardVM).Model.Equals (dashboardVM.Model)) {
             dashboardseditortreeview.Selection.SelectIter (iter);
             break;
         }
         dashboardsStore.IterNext (ref iter);
     }
 }
 void Add(DashboardVM dashboardVM)
 {
     dashboardsStore.AppendValues (dashboardVM, dashboardVM.Editable);
 }
 void Remove(DashboardVM dashboardVM)
 {
     TreeIter iter;
     dashboardsStore.GetIterFirst (out iter);
     while (dashboardsStore.IterIsValid (iter)) {
         if (dashboardsStore.GetValue (iter, COL_DASHBOARD) == dashboardVM) {
             dashboardsStore.Remove (ref iter);
             break;
         }
         dashboardsStore.IterNext (ref iter);
     }
 }