예제 #1
0
        public ActionResult Dashboard()
        {
            try
            {
                var timesheetResult = _ITimeSheet.GetTimeSheetsCountByAdminID(Convert.ToString(Session["AdminUser"]));

                if (timesheetResult != null)
                {
                    ViewBag.SubmittedTimesheetCount = timesheetResult.SubmittedCount;
                    ViewBag.ApprovedTimesheetCount  = timesheetResult.ApprovedCount;
                    ViewBag.RejectedTimesheetCount  = timesheetResult.RejectedCount;
                }
                else
                {
                    ViewBag.SubmittedTimesheetCount = 0;
                    ViewBag.ApprovedTimesheetCount  = 0;
                    ViewBag.RejectedTimesheetCount  = 0;
                }


                var expenseResult = _IExpense.GetExpenseAuditCountByAdminID(Convert.ToString(Session["AdminUser"]));

                if (expenseResult != null)
                {
                    ViewBag.SubmittedExpenseCount = expenseResult.SubmittedCount;
                    ViewBag.ApprovedExpenseCount  = expenseResult.ApprovedCount;
                    ViewBag.RejectedExpenseCount  = expenseResult.RejectedCount;
                }
                else
                {
                    ViewBag.SubmittedExpenseCount = 0;
                    ViewBag.ApprovedExpenseCount  = 0;
                    ViewBag.RejectedExpenseCount  = 0;
                }

                ViewBag.Menu = _IMenu.ListofMenus();
                return(View());
            }
            catch (Exception)
            {
                throw;
            }
        }