예제 #1
0
 public ActionResult Dashboard()
 {
     ViewBag.Teachers    = aDashboardManager.GetTotalTeacher();
     ViewBag.Students    = aDashboardManager.GetTotalStudent();
     ViewBag.Departments = aDashboardManager.GetTotalDepartment();
     ViewBag.Rooms       = aDashboardManager.GetTotalRoom();
     ViewBag.Chart       = aDashboardManager.GetCount();
     return(View());
 }
        public ActionResult Auth(Admin aAdmin)
        {
            var data         = adminManager.GetAdmin();
            var adminDetails = data.Where(a => a.UserName == aAdmin.UserName && eCryptography.Decrypt(a.Password) == aAdmin.Password).FirstOrDefault();

            if (adminDetails == null)
            {
                ViewBag.EMessage = "Wrong User Name or Password";
                return(View("../Admin/Login"));
            }
            else
            {
                Session["Id"]   = adminDetails.Id;
                Session["Name"] = adminDetails.Name;

                ViewBag.Teachers    = aDashboardManager.GetTotalTeacher();
                ViewBag.Students    = aDashboardManager.GetTotalStudent();
                ViewBag.Departments = aDashboardManager.GetTotalDepartment();
                ViewBag.Rooms       = aDashboardManager.GetTotalRoom();
                ViewBag.Chart       = aDashboardManager.GetCount();
                return(View("../Dashboard/Dashboard"));
            }
        }