public IActionResult Index() { //Get number of customers var custquery = TheRepository.GetCustomers(); int customers = custquery.Count(); //Get number of service providers var spquery = TheRepository.GetServiceProviders(); int serviceproviders = spquery.Count(); // Get number of bookings var bookingsquery = TheRepository.GetBookings(); int bookings = bookingsquery.Count(); //Get total revenue - including split of commission double totalamount = bookingsquery.Select(a => a.bookingAmount).Sum(); AdminHomeModel model = new AdminHomeModel(); model.bookingsamount = totalamount; model.bookingscount = bookings; model.customercount = customers; model.serviceprovidercount = serviceproviders; return(View(model)); }
public AdminHomeModel getAdminHomeReports() { AdminHomeModel model = new AdminHomeModel(); var totalpurchage = entities.tblPurchaseMasters.ToList(); decimal TotalPurchage = 0; if (totalpurchage.Count > 0) { TotalPurchage = totalpurchage.Sum(a => a.NetAmount); } var totalsale = entities.tblBillMasters.ToList(); decimal TotalSale = 0; if (totalsale.Count > 0) { TotalSale = totalsale.Sum(a => a.NetAmount); } int TotalProfit = Convert.ToInt32(TotalSale) - Convert.ToInt32(TotalPurchage); model.TotalPurchage = string.Format(CultureInfo.InvariantCulture, "{0:N0}", TotalPurchage); model.TotalSale = string.Format(CultureInfo.InvariantCulture, "{0:N0}", TotalSale); model.TotalProfit = string.Format(CultureInfo.InvariantCulture, "{0:N0}", TotalProfit); model.getAllOutletList = GetAllOulletList(); model.getAllVendorList = getAllVendorList(); model.getalldeletedbillReport = getalldeletedbillReport(); return(model); }
public ActionResult Manage() { // GET TOTALS int totalall = _service.GetCountByDateCreatedRange(DateTime.MinValue, DateTime.Now); int totaltoday = _service.GetCountByDateCreatedRange(DateTime.Now, DateTime.Now); int totalweek = _service.GetCountByDateCreatedRange(DateTime.Now.AddDays(DayOfWeek.Monday - DateTime.Now.DayOfWeek), DateTime.Now); int totalmonth = _service.GetCountByDateCreatedRange(new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1), DateTime.Now); // GET MODEL var model = new AdminHomeModel { UserSignupModel = new BarGraphModel() { MaxValue = totalall, Title = "User Signups" } }; // TOTAL OF SIGNUPS TODAY model.UserSignupModel.Sections.Add(new BarGraphSection() { Title = "Today", Class = "progress progress-warning", Number = totaltoday, Percentage = Convert.ToInt32((Convert.ToDecimal(totaltoday) / Math.Max(model.UserSignupModel.MaxValue, 1)) * 100) }); // TOTAL OF SIGNUPS THIS WEEK model.UserSignupModel.Sections.Add(new BarGraphSection() { Title = "This Week", Class = "progress progress-danger", Number = totalweek, Percentage = Convert.ToInt32((Convert.ToDecimal(totalweek) / Math.Max(model.UserSignupModel.MaxValue, 1)) * 100) }); // TOTAL OF SIGNUPS THIS MONTH model.UserSignupModel.Sections.Add(new BarGraphSection() { Title = "This Month", Class = "progress", Number = totalmonth, Percentage = Convert.ToInt32((Convert.ToDecimal(totalmonth) / Math.Max(model.UserSignupModel.MaxValue, 1)) * 100) }); // TOTAL OF SIGNUPS model.UserSignupModel.Sections.Add(new BarGraphSection() { Title = "Total Signups", Class = "progress progress-success", Number = totalall, Percentage = Convert.ToInt32((Convert.ToDecimal(totalall) / Math.Max(model.UserSignupModel.MaxValue, 1)) * 100) }); return(View(model)); }
public ActionResult Index() { AdminHomeModel adminHomeModel = new AdminHomeModel(); using (DBModels dbModels = new DBModels()) { adminHomeModel.UsersCount = dbModels.users.Count <user>(); adminHomeModel.TopicsCount = dbModels.topics.Count <topic>(); adminHomeModel.CommentsCount = 0; } return(View(adminHomeModel)); }
public ActionResult Manage() { // GET TOTALS int totalall = _service.GetCountByDateCreatedRange(DateTime.MinValue, DateTime.Now); int totaltoday = _service.GetCountByDateCreatedRange(DateTime.Now, DateTime.Now); int totalweek = _service.GetCountByDateCreatedRange(DateTime.Now.AddDays(DayOfWeek.Monday - DateTime.Now.DayOfWeek), DateTime.Now); int totalmonth = _service.GetCountByDateCreatedRange(new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1), DateTime.Now); // GET MODEL var model = new AdminHomeModel { UserSignupModel = new BarGraphModel() { MaxValue = totalall, Title = "User Signups" } }; // TOTAL OF SIGNUPS TODAY model.UserSignupModel.Sections.Add(new BarGraphSection() { Title = "Today", Class = "progress progress-warning", Number = totaltoday, Percentage = Convert.ToInt32((Convert.ToDecimal(totaltoday) / model.UserSignupModel.MaxValue) * 100) }); // TOTAL OF SIGNUPS THIS WEEK model.UserSignupModel.Sections.Add(new BarGraphSection() { Title = "This Week", Class = "progress progress-danger", Number = totalweek, Percentage = Convert.ToInt32((Convert.ToDecimal(totalweek) / model.UserSignupModel.MaxValue) * 100) }); // TOTAL OF SIGNUPS THIS MONTH model.UserSignupModel.Sections.Add(new BarGraphSection() { Title = "This Month", Class = "progress", Number = totalmonth, Percentage = Convert.ToInt32((Convert.ToDecimal(totalmonth) / model.UserSignupModel.MaxValue) * 100) }); // TOTAL OF SIGNUPS model.UserSignupModel.Sections.Add(new BarGraphSection() { Title = "Total Signups", Class = "progress progress-success", Number = totalall, Percentage = Convert.ToInt32((Convert.ToDecimal(totalall) / model.UserSignupModel.MaxValue) * 100) }); return View(model); }
public ActionResult Index() { AdminHomeModel Model = new AdminHomeModel(); using (ApplicationDbContext db = new ApplicationDbContext()) { Model.TotalUsers = db.Set <IdentityUserRole>().Count(); } using (var dbs = new MyLearnDBEntitiess()) { Model.TotalAnnoucements = db.Announcements.Count(); Model.TotalGroups = db.GroupMasters.Count(); Model.TotalQuiz = db.QuizDetails.Count(); } return(View(Model)); }
public ActionResult Index() { AdminHomeModel model = new AdminHomeModel(this.userManager.GetAllUsers()); return(this.View(model)); }