Ejemplo n.º 1
0
        public IActionResult Index()
        {
            int totalUser        = ctx.UserCount();
            int totalActiveUser  = ctx.ActiveUserCount();
            int totalAccountant  = ctx.AccountantCount();
            int totalStockkeeper = ctx.StockkeeperCount();

            ViewBag.UserCount = new AdminHomePage
            {
                Users        = totalUser,
                ActiveUsers  = totalActiveUser,
                Accountants  = totalAccountant,
                Stockkeepers = totalStockkeeper
            };
            int            totalCategory  = _ctx.CategoryCount();
            int            totalVendor    = _ctx.VendorCount();
            int            totalProduct   = _ctx.ProductCount();
            int            totalShelf     = _ctx.ShelfCount();
            int            receivePending = _ctx.ReceivesPendingCount();
            int            issuePending   = _ctx.IssuesPendingCount();
            List <Invoice> listReceives   = _ctx.GetReceives();
            List <Invoice> listIssues     = _ctx.GetIssues();

            ViewBag.AccountantInfo = new AccountantHomePage
            {
                Categories          = totalCategory,
                Vendors             = totalVendor,
                Products            = totalProduct,
                Shelfs              = totalShelf,
                ReceivePendingCount = receivePending,
                IssuePendingCount   = issuePending,
                Receives            = listReceives,
                Issues              = listIssues
            };
            return(View());
        }