//[HttpPost] //public ActionResult Index(HomeViewModels vm) //{ // LoginViewModel lvm = new LoginViewModel(); // string s = User.Identity.Name.ToString(); // AccountManager mgr = new AccountManager(); // lvm = mgr.getUserNames(s); // ViewBag.name = lvm.userFullName; // ModelState.Clear(); // return View(vm); //} public PartialViewResult Details(HomeViewModels vm) { DetailsManager mgr = new DetailsManager(); if (vm.Dmode == "ACIS_Historical") { vm.Details_ACIS_Historical = mgr.GetDetails_ACIS_Historical(vm.detailsID_1, vm.detailsID_2); } if (vm.Dmode == "Alarm_Billing") { vm.Details_Alarm_Billing = mgr.GetDetails_Alarm_Billing(vm.detailsID_1); } if (vm.Dmode == "Business_License") { vm.Details_Business_License = mgr.GetDetails_Business_License(vm.detailsID_1); } if (vm.Dmode == "LEADS") { vm.Details_LEADS = mgr.GetDetails_LEADS(vm.detailsID_1); } if (vm.Dmode == "UB_MUNIS") { vm.Details_UB = mgr.GetDetails_UB_Munis(vm.detailsID_1); } if (vm.Dmode == "Vendors_MUNIS") { vm.Details_MUNIS_VENDORS = mgr.GetDetails_Vendors_Munis(vm.detailsID_1); } if (vm.Dmode == "GB_MUNIS") { vm.Details_GB = mgr.GetDetails_GB_Munis(vm.detailsID_1); } return(PartialView("_Details", vm)); }
public ActionResult Index() { HomeViewModels model = new HomeViewModels(); int totalActivePatients = 0; int totalPayment = 0; List <PatientModel> activePatients = new List <PatientModel>(); List <PaymentModel> paymentList = new List <PaymentModel>(); var patientslist = _patientRepository.GetPatients(); var payments = _paymentRepository.GetPayments(); if (patientslist != null) { activePatients = patientslist.Where(p => p.IsActive == true).ToList(); foreach (var pa in activePatients) { var pay = payments.Where(p => p.PatientCID == pa.PatientCID).ToList(); paymentList.AddRange(pay); } totalActivePatients = activePatients.Count(); totalPayment = paymentList.Count(); } model.TotalActivePatients = totalActivePatients; model.TotalPayments = totalPayment; model.TodayDateTime = DateTime.Now; return(View(model)); }
public ActionResult Index() { try { HomeViewModels homeViewModel = new HomeViewModels(); //nbTicket CarteModels carte = carteRepository.findCarteByUser(User.Identity.Name); int nbTicket = carte.TicketModels.Count; homeViewModel.nbTicket = nbTicket; //abonnement souscrit int nbAboSouscrit = carte.AbonnementsModels.Count; homeViewModel.nbAbo = nbAboSouscrit; var enumAbo = carte.AbonnementsModels.GetEnumerator(); List <string> intituleList = new List <string>(); while (enumAbo.MoveNext()) { AbonnementModels item = enumAbo.Current; int idType = item.TypeAbonnementModelsID; TypeAbonnementModels typeAbo = Context.TypeAbonnementModels.Find(idType); intituleList.Add(typeAbo.Intitule); } homeViewModel.intituleList = intituleList; return(View(homeViewModel)); } catch (Exception e) { HomeViewModels homeView = new HomeViewModels(); homeView.nbTicket = 0; homeView.nbAbo = 0; homeView.intituleList = new List <string>(); return(View(homeView)); } }
public ActionResult Contact(HomeViewModels model) { if (ModelState.IsValid) { using (DigiStoreDBModelContainer db = new DigiStoreDBModelContainer()) { //messing with this for the time being Review newReview = db.Reviews.Create(); newReview.Id = db.Reviews.Count(); if (model.ReviewText != null) { newReview.ReviewText = model.ReviewText; } newReview.Rating = 0; newReview.Date = DateTime.Now; newReview.ReviewerName = "*****@*****.**"; db.Reviews.Add(newReview); db.SaveChanges(); ViewBag.Message = "Review Submitted! Thanks!"; return(View()); } } else { return(View(model)); } }
public ActionResult Index() { HomeViewModels model = new HomeViewModels(); model.Categories = categoriesService.GetCategories(); return(View(model)); }
public ActionResult GameList([Bind(Prefix = "NewGame")] Game game) { HomeViewModels viewModel = new HomeViewModels(); ApplicationUser user = userRepository.GetUser(User.Identity.GetUserId()); if (ModelState.IsValid) { //sprawdzanie czy gracz nie ma juz zaczętych maksymalnej liczby gier if (userRepository.HaveMaxGames(user)) { viewModel.HaveMaxGames = true; } else { //sprawdzanie czy dana nazwa juz nie istnieje viewModel.NameUsed = gameRepository.NameUsed(game); if (!viewModel.NameUsed.GetValueOrDefault()) { gameRepository.CreateGame(game, user); } } } GetHomeViewModel(viewModel); return(View(viewModel)); }
public async Task <IActionResult> Index() { HomeViewModels HomeViewModel = new HomeViewModels(); var BookLatest = await _context.Book .Include(bk => bk.Authors) .ThenInclude(baj => baj.Author) .OrderByDescending(bk => bk.DateofImport) .Select(bk => new BookLatestViewModel { ImageURL = IMAGEPATH + bk.ISBN + ".jpg", ISBN = bk.ISBN, Title = bk.Title, Author = string.Join(",", bk.Authors.Select(at => at.Author.Name).ToArray()), }).Take(9).ToListAsync(); var BookMostBorrowed = await _context.Book .Include(bk => bk.Authors) .ThenInclude(baj => baj.Author) .Include(bk => bk.Publisher) .OrderByDescending(bk => bk.TotalBorrowed) .Select(bk => new BookBorrowedViewModel { ImageURL = IMAGEPATH + bk.ISBN + ".jpg", ISBN = bk.ISBN, Title = bk.Title, Author = string.Join(",", bk.Authors.Select(at => at.Author.Name).ToArray()), Publisher = bk.Publisher.Name }).Take(3).ToListAsync(); HomeViewModel.BookLatest = BookLatest; HomeViewModel.BookBorrowed = BookMostBorrowed; HomeViewModel.BookDay = await GetBookofTheDay(); return(View(HomeViewModel)); }
//helpers private void GetHomeViewModel(HomeViewModels viewModel) { ApplicationUser user = userRepository.GetUser(User.Identity.GetUserId()); viewModel.YourGames = gameRepository.GetUserGames(user); viewModel.OpenGames = gameRepository.GetOpenGames(viewModel.YourGames); }
public IActionResult ListBooks() { HomeViewModels model = new HomeViewModels(); model.BooksDisplayedInStore = _bookStore.GetBooks(); return(View(model)); }
//CategoriesService categoryService = new CategoriesService(); // GET: Home public ActionResult Index() { HomeViewModels model = new HomeViewModels(); model.FeaturedCategories = CategoriesService.Instance.GetFeaturedCategories(); return(View(model)); }
//[Authorize(Roles = "Admin")] public ActionResult Index() { ViewBag.Title = "Лучшие Фильмы"; var asd = _allfilms.GetFavoriteFilms(); var homeProduct = new HomeViewModels { favFilm = _allfilms.GetFavoriteFilms().Select(x => new FilmViewModel() { Id = x.Id, Name = x.Name, Img = x.Img, Actors = _allfilms.GetActorsForFilm(x.Id), Description = x.Description, CategoryID = x.CategoryID, Isfavorite = x.Isfavorite, CategoryName = x.Category.CategoryName, EnumForRelese = x.EnumForRelese, Producer = x.Producer, Release = x.Release }) }; return(View(homeProduct)); }
public ActionResult Index() { try { HomeViewModels model = new HomeViewModels(); var user = _userService.GetUserBy(User.Identity.GetUserId <int>()); var asdasd = User.Identity.GetUserId <int>(); model.userModel = new UserViewModel() { Username = user.Username, Name = user.UserProfile.Name, CreatedTimestamp = user.CreatedTimestamp.Date }; model.WalletBalance = _financialService.GetUserWalletAvailableBalance(user.UserWallet.First().WalletId) ?? decimal.Zero; model.ActivePackagesCount = _investmentService.GetAllUserPackage(user.UserId).Where(x => x.StatusId != (int)EStatus.Deactivated && x.StatusId != (int)EStatus.Void).Count(); model.BonusAmount = _financialService.GetMatchingBonusReceivedAmount(user.UserWallet.First().WalletId) ?? decimal.Zero; model.AnnouncementHtml = _articleService.GetPost((int)EPostType.Announcement).Content; return(View(model)); } catch (Exception ex) { Log.Error(ex.Message, ex); return(new AccountController(_userService).LogOff()); } }
//ADD NOTES public void AddNotes(HomeViewModels vm) { SqlConnection dbConn = new SqlConnection(); dbConn.ConnectionString = Jasmineconstring; dbConn.Open(); SqlCommand dbComm = default(SqlCommand); SqlDataReader dbread = default(SqlDataReader); string strSQL = null; if (vm.notes.icon == null) { vm.notes.icon = "note.gif"; } strSQL = "INSERT INTO nbid_notes values ("; strSQL += "'" + vm.notes.nbid + "', '" + vm.notes.user_id + "', '" + vm.notes.date_time + "', '" + vm.notes.subject + "', '" + vm.notes.comment + "', '" + vm.notes.icon + "')"; dbComm = new SqlCommand(strSQL, dbConn); dbread = dbComm.ExecuteReader(); dbread.Close(); dbComm.Dispose(); dbConn.Close(); dbConn = null; }
public async Task <JsonResult> CalculStoredProcedure(HomeViewModels vm) { string nameProc = vm.SpName; IList <StoredProcedureParameters> paramProc = vm.MyLstStoredProcedureParameters; TaskResult result = new TaskResult(); if (!ModelState.IsValid) { result.Succeeded = false; result.Message = "erreur de modèle"; return(Json(new { result })); } result = await _StoredProcedureManager.ExecStoredProcedureById(nameProc, paramProc, id_collaborateur); //TempData.Put("Tableau", result); //sélection des 10 premières lignes pour chaque resultset TaskResult resultAffichage = new TaskResult(); resultAffichage.LstResultSet = new List <dynamic>(); foreach (var item in result.LstResultSet) { dynamic toto = ListHelper.Top(item, 10); resultAffichage.LstResultSet.Add(toto); } //stockage du résultat total sous redis string resultJson = JsonConvert.SerializeObject(result.LstResultSet); TaskResult WriteData = await _StoredProcedureManager.SetRedisKey($"{nameProc}_{id_collaborateur}", resultJson); return(Json(resultAffichage)); }
public PartialViewResult Get_newNBID(HomeViewModels vm) { NewIDManager mgr = new NewIDManager(); ViewBag.newNBID = mgr.Get_newNBID(); return(PartialView()); }
public ActionResult Index() { HomeViewModels models = new HomeViewModels(); models.FeaturedCategories = categoriesService.GetFeaturedCategories(); models.NewProducts = ProductsService.Instance.GetAllProducts().OrderByDescending(x => x.ID).Take(4).ToList(); return(View(models)); }
public ActionResult GameList(bool?id) //jeżeli id==true to masz juz maksymalna liczbę gier { HomeViewModels viewModel = new HomeViewModels(); GetHomeViewModel(viewModel); viewModel.HaveMaxGames = id.GetValueOrDefault(); return(View(viewModel)); }
public ActionResult Index() { HomeViewModels model = new HomeViewModels(); model.FeaturedCategory = process.GetFeaturedCategories(); return(View(model)); }
public ActionResult SearchResults(HomeViewModels vm) //Partial View { QueryManager mgr = new QueryManager(); vm.queryList = mgr.Get(vm); return(PartialView("_SearchResults", vm)); }
public ActionResult Index() { HomeViewModels model = new HomeViewModels(); EditionLastAndNewRecipes.MeilleuresRecettes(model.LastAndBest.lastRecipes); EditionLastAndNewRecipes.DernieresRecettes(model.LastAndBest.bestRecipes); return(View(model)); }
public ViewResult Index() { var homeCars = new HomeViewModels { favCars = _carRep.getFavCars }; return(View(homeCars)); }
public ViewResult Index() { var homeViewModel = new HomeViewModels { LanchesPreferidos = _lancheRepository.LanchesPreferidos }; return(View(homeViewModel)); }
public async Task <ActionResult> Index() { var homeVM = new HomeViewModels() { ModuleGroups = await GetModuleGroups() }; return(View(homeVM)); }
public ViewResult Index() { var homeProduct = new HomeViewModels { favProducts = _allProducts.GetFavoriteProduct }; return(View(homeProduct)); }
public ActionResult Index() { HomeViewModels model = new HomeViewModels { FeaturedCategories = CategoriesService.Instance.GetFeaturedCategories(), // set the categories list in the home view model to the categories receieved from database FeaturedProducts = ProductsService.Instance.GetFeaturedProducts() }; return(View(model)); }
public ActionResult Index() { var viewModel = new HomeViewModels() { AccomodationType = _serviceAccomodationType.GetAllAccomodationTypes(), AccomodationPackage = _serviceAccomodationPackage.GetAllAccomodationPackages() }; return(View(viewModel)); }
public IActionResult Giderekle() { var homeViewModel = new HomeViewModels() { GiderKategoris = _giderKategoriService.GetAll(), UrunKategoris = _urunKategoriService.GetAll(), }; return(View(homeViewModel)); }
public IActionResult Transferlerigor() { var homeViewModel = new HomeViewModels() { // GunSonu = HomeRepository.Homes, TransferEkles = _transferEkleService.GetAll() }; return(View(homeViewModel)); }
public ActionResult Index() { HomeViewModels model = new HomeViewModels(); AccomodationTypesService service = new AccomodationTypesService(); model.AccomodationTypes = service.GetAllAccomodationTypes(); return(View()); }
public ActionResult Index() { HomeViewModels model = new HomeViewModels(); model.AccomodationTypes = typeService.GetAllAccomodationTypes(); model.AccomodationPackages = packageservices.GetAllAccomodationPackage(); return(View(model)); }