public string Invoke() { UserCountViewModel model = new UserCountViewModel(); model.UserCount = _userService.GetAllUserInRole("user").Count(); model.TeacherCount = _userService.GetAllUserInRole("teacher").Count(); return($" Учеников: {model.UserCount} Преподователей: {model.TeacherCount} "); }
public UserCountViewModel GetUserCounts(int LoginID) { UserCountViewModel objUC = new UserCountViewModel(); objUC.Cart = uow.CartDetails.Queryable().Where(x => x.loginID == LoginID && x.isBlocked == false).Count(); objUC.Orders = uow.Orders.Queryable().Where(x => x.createdBy == LoginID && x.orderType == 14).Count(); objUC.OrdersPending = uow.Orders.Queryable().Where(x => x.createdBy == LoginID && x.orderType == 14 && x.orderStatus == 10).Count(); objUC.OrdersCompleted = uow.Orders.Queryable().Where(x => x.createdBy == LoginID && x.orderType == 14 && x.orderStatus == 11).Count(); objUC.WatchList = uow.WatchList.Queryable().Where(x => x.loginID == LoginID).Count(); return(objUC); }
public IActionResult GetUserCount() { var model = new UserCountViewModel() { MemberCount = _userAppService.GetMemberCount(), TodayRegisterMemberCount = _userAppService.GetTodayRegisterMemberCount(), EmployeeCount = _userAppService.GetEmployeeCount(), TodayCreateEmployeeCount = _userAppService.GetTodyCreateEmployeeCount() }; return(Json(model)); }
public ActionResult Count() { try { int LoginID = GetLogin(); if (LoginID != 0) { UserCountViewModel objCount = this.objHomeServiceProvider.GetUserCounts(LoginID); return(Json(new Response { IsSuccess = true, Message = "", Result = objCount }, JsonRequestBehavior.AllowGet)); } return(Json(new Response { Code = 200, IsSuccess = false, Message = string.Format(StringResource.Invalid, "Session") }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { ErrorLog.Log("DashboardController", "Count", ex); return(Json(new Response { IsSuccess = false, Message = ex.Message }, JsonRequestBehavior.AllowGet)); } }
protected IViewComponentResult Invoke(string title, string controllerName, string cssClass, string icon, int count) { var model = new UserCountViewModel(title, controllerName, cssClass, icon, count); return(View("~/Views/Shared/Components/UserCounter/Default.cshtml", model)); }