コード例 #1
0
ファイル: HomeController.cs プロジェクト: ThomasGiaTran/NBID
        //[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));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
ファイル: HomeController.cs プロジェクト: thdubois/ManageSub
 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));
     }
 }
コード例 #4
0
 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));
     }
 }
コード例 #5
0
        public ActionResult Index()
        {
            HomeViewModels model = new HomeViewModels();

            model.Categories = categoriesService.GetCategories();
            return(View(model));
        }
コード例 #6
0
        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));
        }
コード例 #7
0
        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));
        }
コード例 #8
0
        //helpers
        private void GetHomeViewModel(HomeViewModels viewModel)
        {
            ApplicationUser user = userRepository.GetUser(User.Identity.GetUserId());

            viewModel.YourGames = gameRepository.GetUserGames(user);
            viewModel.OpenGames = gameRepository.GetOpenGames(viewModel.YourGames);
        }
コード例 #9
0
        public IActionResult ListBooks()
        {
            HomeViewModels model = new HomeViewModels();

            model.BooksDisplayedInStore = _bookStore.GetBooks();
            return(View(model));
        }
コード例 #10
0
        //CategoriesService categoryService = new CategoriesService();
        // GET: Home
        public ActionResult Index()
        {
            HomeViewModels model = new HomeViewModels();

            model.FeaturedCategories = CategoriesService.Instance.GetFeaturedCategories();
            return(View(model));
        }
コード例 #11
0
        //[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));
        }
コード例 #12
0
ファイル: HomeController.cs プロジェクト: AaronTee/FIX
        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());
            }
        }
コード例 #13
0
        //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;
        }
コード例 #14
0
        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));
        }
コード例 #15
0
ファイル: HomeController.cs プロジェクト: ThomasGiaTran/NBID
        public PartialViewResult Get_newNBID(HomeViewModels vm)
        {
            NewIDManager mgr = new NewIDManager();

            ViewBag.newNBID = mgr.Get_newNBID();
            return(PartialView());
        }
コード例 #16
0
        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));
        }
コード例 #17
0
        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));
        }
コード例 #18
0
        public ActionResult Index()
        {
            HomeViewModels model = new HomeViewModels();

            model.FeaturedCategory = process.GetFeaturedCategories();

            return(View(model));
        }
コード例 #19
0
ファイル: HomeController.cs プロジェクト: ThomasGiaTran/NBID
        public ActionResult SearchResults(HomeViewModels vm) //Partial View
        {
            QueryManager mgr = new QueryManager();

            vm.queryList = mgr.Get(vm);

            return(PartialView("_SearchResults", vm));
        }
コード例 #20
0
        public ActionResult Index()
        {
            HomeViewModels model = new HomeViewModels();

            EditionLastAndNewRecipes.MeilleuresRecettes(model.LastAndBest.lastRecipes);
            EditionLastAndNewRecipes.DernieresRecettes(model.LastAndBest.bestRecipes);
            return(View(model));
        }
コード例 #21
0
        public ViewResult Index()
        {
            var homeCars = new HomeViewModels
            {
                favCars = _carRep.getFavCars
            };

            return(View(homeCars));
        }
コード例 #22
0
        public ViewResult Index()
        {
            var homeViewModel = new HomeViewModels
            {
                LanchesPreferidos = _lancheRepository.LanchesPreferidos
            };

            return(View(homeViewModel));
        }
コード例 #23
0
        public async Task <ActionResult> Index()
        {
            var homeVM = new HomeViewModels()
            {
                ModuleGroups = await GetModuleGroups()
            };

            return(View(homeVM));
        }
コード例 #24
0
        public ViewResult Index()
        {
            var homeProduct = new HomeViewModels
            {
                favProducts = _allProducts.GetFavoriteProduct
            };

            return(View(homeProduct));
        }
コード例 #25
0
        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));
        }
コード例 #26
0
ファイル: HomeController.cs プロジェクト: waleedShah72/HMSv
        public ActionResult Index()
        {
            var viewModel = new HomeViewModels()
            {
                AccomodationType    = _serviceAccomodationType.GetAllAccomodationTypes(),
                AccomodationPackage = _serviceAccomodationPackage.GetAllAccomodationPackages()
            };

            return(View(viewModel));
        }
コード例 #27
0
        public IActionResult Giderekle()
        {
            var homeViewModel = new HomeViewModels()
            {
                GiderKategoris = _giderKategoriService.GetAll(),
                UrunKategoris  = _urunKategoriService.GetAll(),
            };

            return(View(homeViewModel));
        }
コード例 #28
0
        public IActionResult Transferlerigor()
        {
            var homeViewModel = new HomeViewModels()
            {
                // GunSonu =  HomeRepository.Homes,
                TransferEkles = _transferEkleService.GetAll()
            };

            return(View(homeViewModel));
        }
コード例 #29
0
        public ActionResult Index()
        {
            HomeViewModels model = new HomeViewModels();

            AccomodationTypesService service = new AccomodationTypesService();

            model.AccomodationTypes = service.GetAllAccomodationTypes();

            return(View());
        }
コード例 #30
0
        public ActionResult Index()
        {
            HomeViewModels model = new HomeViewModels();

            model.AccomodationTypes = typeService.GetAllAccomodationTypes();

            model.AccomodationPackages = packageservices.GetAllAccomodationPackage();

            return(View(model));
        }