public async Task<ActionResult> Next_Previous(DateTime? startdt, DateTime? enddt)
        {
            try
            {

                if (_UtilitySession.Session != null)
                {
                    if (_UtilitySession.Session.Status == true)
                    {
                        ViewBag.Name = _UtilitySession.Session.user.name;
                        DashboardCounter _DashboardCounter = new DashboardCounter();
                        _DashboardCounter = await Task.Run(() => _Repository.getDashboardCount(startdt, enddt));

                        return View("_PartialViewForDashboradHome", _DashboardCounter);
                    }
                    else
                    {
                        return RedirectToAction("Detail", "Home");
                    }
                }
                else
                {
                    return RedirectToAction("Detail", "Home");
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
        public async Task<ActionResult> Home()
        {
            try
            {

                if (_UtilitySession.Session != null)
                {
                    if (_UtilitySession.Session.Status == true)
                    {
                        DateTime dt = _Repository.GetNetworkTime();
                        DateTime? dtEnd = new DateTime();
                        //HttpContext.Session["DefaultDate"] = dt;

                        ViewBag.Name = _UtilitySession.Session.user.name;
                        DashboardCounter _DashboardCounter = new DashboardCounter();
                        _DashboardCounter = await Task.Run(() => _Repository.getDashboardCount(dt, null));

                        return View(_DashboardCounter);
                    }
                    else
                    {
                        return RedirectToAction("Detail", "Home");
                    }
                }
                else
                {
                    return RedirectToAction("Detail", "Home");
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
示例#3
0
        public ActionResult Counter()
        {
            ExpenseTrackerIdentity ident = User.Identity as ExpenseTrackerIdentity;
            DashboardCounter       model = new DashboardCounter();

            model.ExpenseCount      = _expenseService.ExpenseCount(ident.UserId);
            model.CategoryCount     = _categoryService.CategoryCount(ident.UserId);
            model.TotalExpenseToday = _expenseService.GetTotalExpenseToday(ident.UserId);
            model.TotalExpense      = _expenseService.GetTotalExpense(ident.UserId);
            return(PartialView("_counter", model));
        }