Exemplo n.º 1
0
        // GET: Corporate/Home
        public ActionResult Home()
        {
            Session.Remove("BranchId");
            Session.Remove("Branch");

            int            companyId      = Convert.ToInt32(Session["CompanyId"]);
            var            branches       = _iBranchManager.GetAllBranches();
            ViewTotalOrder totalOrder     = _iReportManager.GetTotalOrdersByCompanyIdAndYear(companyId, DateTime.Now.Year);
            var            accountSummary = _iAccountsManager.GetAccountSummaryofCurrentMonthByCompanyId(companyId);
            var            products       = _iInventoryManager.GetStockProductByCompanyId(companyId);
            var            orders         = _iOrderManager.GetOrdersByCompanyId(companyId).ToList();
            var            topClients     = _iReportManager.GetTopClientsByYear(DateTime.Now.Year).ToList();
            var            clients        = _iClientManager.GetAllClientDetails();
            var            topProducts    = _iReportManager.GetPopularBatteriesByYear(DateTime.Now.Year).ToList();
            var            employees      = _iEmployeeManager.GetAllEmployeeWithFullInfo().ToList();
            SummaryModel   summary        = new SummaryModel
            {
                Branches       = branches.ToList(),
                CompanyId      = companyId,
                TotalOrder     = totalOrder,
                TopClients     = topClients,
                Orders         = orders,
                TopProducts    = topProducts,
                Clients        = clients,
                Employees      = employees,
                Products       = products,
                AccountSummary = accountSummary
            };

            return(View(summary));
        }
Exemplo n.º 2
0
        public ActionResult Home()
        {
            Session.Remove("BranchId");
            Session.Remove("Branch");

            int            companyId      = Convert.ToInt32(Session["CompanyId"]);
            var            branches       = _iBranchManager.GetAllBranches();
            ViewTotalOrder totalOrder     = _iReportManager.GetTotalOrdersByCompanyIdAndYear(companyId, DateTime.Now.Year);
            var            accountSummary = _iAccountsManager.GetAccountSummaryofCurrentMonthByCompanyId(companyId);
            var            clients        = _iReportManager.GetTopClients().ToList();
            var            batteries      = _iReportManager.GetPopularBatteries().ToList();

            SummaryModel summary = new SummaryModel
            {
                Branches       = branches.ToList(),
                CompanyId      = companyId,
                TotalOrder     = totalOrder,
                Clients        = clients,
                Products       = batteries,
                AccountSummary = accountSummary
            };
            var aModel = new MessageModel
            {
                PhoneNumber     = "01841000307",
                CustomerName    = "Abdus Salam",
                TotalQuantity   = 1,
                Amount          = 38000,
                TransactionDate = DateTime.Now,
                TransactionRef  = "192022500"
            };

            aModel.MessageBody = aModel.GetMessageForDistribution();
            //var res = _iCommonManager.SendSms(aModel);
            return(View(summary));
        }
Exemplo n.º 3
0
        // GET: Accounts/Home
        public ActionResult Home()
        {
            try
            {
                var            companyId      = Convert.ToInt32(Session["CompanyId"]);
                int            branchId       = Convert.ToInt32(Session["BranchId"]);
                var            clients        = _iReportManager.GetTopClients().ToList();
                var            batteries      = _iReportManager.GetPopularBatteries().ToList();
                ViewTotalOrder totalOrder     = _iReportManager.GetTotalOrderByBranchIdCompanyIdAndYear(branchId, companyId, DateTime.Now.Year);
                var            accountSummary = _iAccountsManager.GetAccountSummaryofCurrentMonthByBranchAndCompanyId(branchId, companyId);
                var            branches       = _iBranchManager.GetAllBranches();
                SummaryModel   aModel         = new SummaryModel
                {
                    Branches       = branches.ToList(),
                    BranchId       = branchId,
                    CompanyId      = companyId,
                    TotalOrder     = totalOrder,
                    AccountSummary = accountSummary,
                    Clients        = clients,
                    Products       = batteries
                };

                return(View(aModel));
            }
            catch (Exception exception)
            {
                Log.WriteErrorLog(exception);
                return(PartialView("_ErrorPartial", exception));
            }
        }
Exemplo n.º 4
0
 public SummaryModel()
 {
     TotalOrder        = new ViewTotalOrder();
     Clients           = new List <ViewClient>();
     Branches          = new List <ViewBranch>();
     Products          = new List <ViewProduct>();
     InvoicedOrderList = new List <Invoice>();
     Orders            = new List <ViewOrder>();
     DelayedOrders     = new List <ViewOrder>();
     PendingOrders     = new List <ViewOrder>();
     TopClients        = new List <ViewClient>();
     Employees         = new List <ViewEmployee>();
     VerifiedOrders    = new List <ViewVerifiedOrderModel>();
     Departments       = new List <Department>();
     Territories       = new List <Territory>();
     Regions           = new List <Region>();
 }
        // GET: Management/Home
        public ActionResult Home()
        {
            var companyId = Convert.ToInt32(Session["CompanyId"]);
            //int branchId = Convert.ToInt32(Session["BranchId"]);
            var            topClients     = _iReportManager.GetTopClientsByYear(DateTime.Now.Year);
            var            topProducts    = _iReportManager.GetPopularBatteriesByYear(DateTime.Now.Year).ToList();
            ViewTotalOrder totalOrder     = _iReportManager.GetTotalOrdersByCompanyIdAndYear(companyId, DateTime.Now.Year);
            var            accountSummary = _iAccountsManager.GetAccountSummaryofCurrentMonthByCompanyId(companyId);
            //var clients = _iClientManager.GetAllClientDetailsByBranchId(branchId);
            //var orders = _iOrderManager.GetTotalOrdersByCompanyIdAndYear(companyId,DateTime.Now.Year);
            //var products = _iInventoryManager.GetStockProductByBranchAndCompanyId(branchId, companyId);
            //var pendingOrders = _iOrderManager.GetPendingOrdersByBranchAndCompanyId(branchId,companyId).ToList();
            //var employees = _iEmployeeManager.GetAllEmployeeWithFullInfo();
            //var branches = _iBranchManager.GetAllBranches();
            var totalProduction     = _iReportManager.GetTotalProductionCompanyIdAndYear(companyId, DateTime.Now.Year);
            var totalDispatch       = _iReportManager.GetTotalDispatchCompanyIdAndYear(companyId, DateTime.Now.Year);
            var viewTotalCollection = _iReportManager.GetTotalCollectionByYear(DateTime.Now.Year);
            var viewTotalSaleValue  = _iReportManager.GetTotalSaleValueByYear(DateTime.Now.Year);

            accountSummary.TotalSaleValue = _iReportManager.GetTotalSaleValueByYearAndMonth(DateTime.Now.Year, DateTime.Now.Month);
            SummaryModel aModel = new SummaryModel
            {
                // Branches = branches.ToList(),
                //BranchId = branchId,
                CompanyId   = companyId,
                TotalOrder  = totalOrder,
                TopClients  = topClients,
                TopProducts = topProducts,
                //Clients = clients,
                // Products = products,
                // Orders = orders,
                //PendingOrders = pendingOrders,
                //Employees = employees,
                AccountSummary         = accountSummary,
                Dispatch               = totalDispatch,
                Production             = totalProduction,
                ViewTotalCollection    = viewTotalCollection,
                ViewTotalSaleValue     = viewTotalSaleValue,
                TotalDeliveredQuantity = _iReportManager.GetTotalDeliveredQuantityByYear(DateTime.Now.Year)
            };

            return(View(aModel));
        }
Exemplo n.º 6
0
        public ViewTotalOrder GetTotalOrderByBranchIdCompanyIdAndYear(int branchId, int companyId, int year)
        {
            var totalOrders = _iOrderManager.GetTotalOrdersByBranchIdCompanyIdAndYear(branchId, companyId, year).ToArray();

            ViewTotalOrder order = new ViewTotalOrder
            {
                January   = totalOrders?.ToList().Find(n => n.MonthName.StartsWith("Jan"))?.Total,
                February  = totalOrders?.ToList().Find(n => n.MonthName.StartsWith("Feb"))?.Total,
                March     = totalOrders?.ToList().Find(n => n.MonthName.StartsWith("Mar"))?.Total,
                April     = totalOrders?.ToList().Find(n => n.MonthName.StartsWith("Ap"))?.Total,
                May       = totalOrders?.ToList().Find(n => n.MonthName.StartsWith("May"))?.Total,
                June      = totalOrders?.ToList().Find(n => n.MonthName.StartsWith("June"))?.Total,
                July      = totalOrders?.ToList().Find(n => n.MonthName.StartsWith("July"))?.Total,
                August    = totalOrders?.ToList().Find(n => n.MonthName.StartsWith("Aug"))?.Total,
                September = totalOrders?.ToList().Find(n => n.MonthName.StartsWith("Sep"))?.Total,
                October   = totalOrders?.ToList().Find(n => n.MonthName.StartsWith("Oct"))?.Total,
                November  = totalOrders?.ToList().Find(n => n.MonthName.StartsWith("Nov"))?.Total,
                December  = totalOrders?.ToList().Find(n => n.MonthName.StartsWith("Dec"))?.Total
            };

            return(order);
        }
Exemplo n.º 7
0
        public ActionResult Home()
        {
            Session.Remove("BranchId");
            Session.Remove("Branch");

            int            companyId      = Convert.ToInt32(Session["CompanyId"]);
            var            branches       = _iBranchManager.GetAllBranches();
            ViewTotalOrder totalOrder     = _iReportManager.GetTotalOrdersByCompanyIdAndYear(companyId, DateTime.Now.Year);
            var            accountSummary = _iAccountsManager.GetAccountSummaryofCurrentMonthByCompanyId(companyId);
            var            clients        = _iReportManager.GetTopClients().ToList();
            var            batteries      = _iReportManager.GetPopularBatteries().ToList();

            SummaryModel summary = new SummaryModel
            {
                Branches       = branches.ToList(),
                CompanyId      = companyId,
                TotalOrder     = totalOrder,
                Clients        = clients,
                Products       = batteries,
                AccountSummary = accountSummary
            };

            return(View(summary));
        }