Exemplo n.º 1
0
        public void ShowColumnVMs_FalseWhenNoColumns()
        {
            //given
            var indexVM = new IndexVM();
            //when
            var showColumns = indexVM.ShowColumnVMs;

            //then
            Assert.IsFalse(showColumns);
        }
Exemplo n.º 2
0
        // GET: Man
        public ActionResult Index()
        {
            var model = new IndexVM
            {
                broj      = ctx.Proizvodi.Where(x => x.VrstaID == 2).Count(),
                proizvodi = ctx.Proizvodi.Where(x => x.VrstaID == 2).ToList()
            };

            return(View("Index", model));
        }
        public ActionResult Index()
        {
            var model = new IndexVM
            {
                Products = unitOfWork.Products.Random(10).ToList(),
                Tags     = unitOfWork.Tags.Random(6)
            };

            return(View(model));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Index()
        {
            IndexVM listOfParksAndTrails = new IndexVM()
            {
                NationalParkList = await _npRepo.GetAllAsync(SD.NationalParkAPIPath),
                TrailList        = await _trailRepo.GetAllAsync(SD.TrailAPIPath),
            };

            return(View(listOfParksAndTrails));
        }
Exemplo n.º 5
0
        public ActionResult Index()
        {
            var model = new IndexVM();

            WF_STREAMBusiness = Get <WF_STREAMBusiness>();
            var searchmodel = new WF_STREAM_SEARCHBO();

            SessionManager.SetValue("wfstreamSearchModel", null);
            model.LstLuong = WF_STREAMBusiness.GetDaTaByPage(null);
            return(View(model));
        }
Exemplo n.º 6
0
        public IActionResult Index()
        {
            IndexVM mdl = new IndexVM();

            mdl         = (IndexVM)UserToMdl(mdl);
            mdl.News    = new List <NewsMdl>();
            mdl.Reviews = new List <Review>();
            mdl.Reviews = db.Reviews.Include(rv => rv.User).OrderByDescending(rv => rv.PostDT).Take(3).ToList();
            mdl.News    = db.NewsMdls.OrderByDescending(n => n.PostDT).Take(3).ToList();
            return(View(mdl));
        }
Exemplo n.º 7
0
        public ActionResult Index()
        {
            IndexVM model = new IndexVM();

            model.vols = Volunteers.vols;
            //Volunteer vol1 = new Volunteer();
            //DateTime time;


            return(View(model));
        }
Exemplo n.º 8
0
        public ActionResult Index()
        {
            IndexVM Bucket = new IndexVM();
            Bucket.Rect = new Rectangle(35.1, 75.1);
            List<Rectangle> Rectangles = new List<Rectangle>();
            Rectangles.Add(new Rectangle(45, 64));
            Rectangles.Add(new Rectangle(65, 93));
            Rectangles.Add(new Rectangle(23, 94));

            return View(Rectangles);
        }
Exemplo n.º 9
0
        public async Task <IActionResult> Index()
        {
            IndexVM listOfParksAndTrails = new IndexVM()
            {
                NationalParkList = await _npRepo.GetAllAsync(SD.NationalParkAPIPath, HttpContext.Session.GetString("JWToken")),
                Trails           = await _trailRepo.GetAllAsync(SD.TrailAPIPath, HttpContext.Session.GetString("JWToken"))
            };

            return(View(listOfParksAndTrails));
            //return View();
        }
Exemplo n.º 10
0
        public IActionResult IndexWithCategory(string category)
        {
            IndexVM IndexVM = new IndexVM()
            {
                Product = _unitOfWork.Product.GetAll(u => u.Category.Name == category, includeProperties: "Category,AgeGroup"),
                Coupon = _unitOfWork.Coupon.GetAll(u => u.IsActive == true)

        };

            return View(IndexVM);
        }
Exemplo n.º 11
0
        public async Task <IActionResult> ClearPlayerScores()
        {
            var userId = accountService.GetUserId();
            await service.ClearPlayerScores(userId);

            IndexVM viewModel = await service.GetIndexVMAsync(accountService.GetUserId());

            var players = viewModel.Leaderboard;

            return(Json(players));
        }
Exemplo n.º 12
0
        public IActionResult Index()
        {
            IndexVM model = new IndexVM()
            {
                proizvodi = context.Proizvod.OrderBy(r => Guid.NewGuid()).Take(9).ToList(),
                postovi   = context.Post.Include(p => p.Autor).OrderByDescending(p => p.DatumObjave).Take(3).ToList(),
                oglasi    = context.Oglas.OrderBy(o => o.DatumObjave).Take(3).ToList()
            };

            return(View(model));
        }
        public ActionResult Index(int id)
        {
            IndexVM indexVM = new IndexVM();

            indexVM.contact          = db.Contacts.First();
            indexVM.xidmetlers       = db.Services.ToList();
            indexVM.xidmetlerBasliqs = db.ServicesHeaders.ToList();
            indexVM.sp_ID            = id;

            return(View(indexVM));
        }
Exemplo n.º 14
0
        public IModelResult <IndexVM> SelectStudent(IndexVM vm = null)
        {
            IModelResult <IndexVM> modelResult;

            try
            {
                doEventLog($"查詢資料:input=>{JsonConvert.SerializeObject(vm)}");
                doLog($"查詢資料:input=>{JsonConvert.SerializeObject(vm)}");

                selectStudentModel = null;
                if (vm != null)
                {
                    selectStudentModel = AutoMapper.Mapper.Map <SelectStudentDaoReqModel>(vm);
                }

                dao = GetDao();
                IModelResult <IList <SelectStudentDaoResModel> > dbResult = dao.StudentSelect(selectStudentModel);
                if (dbResult.IsOk)
                {
                    modelResult = new ModelResult <IndexVM>();
                    if (dbResult.ResultData.Any())
                    {
                        modelResult.ResultData = new IndexVM();
                        modelResult.ResultData.lstStudentInfo = dbResult.ResultData.Select(x =>
                        {
                            IndexStudentItem item = AutoMapper.Mapper.Map <IndexStudentItem>(x);
                            return(item);
                        }).ToList();
                    }
                    else
                    {
                        modelResult.ResultData = new IndexVM();
                    }
                }
                else
                {
                    modelResult = new ModelResult <IndexVM>(dbResult.ErrorCode.Value)
                    {
                        SystemMessage = dbResult.SystemMessage
                    };
                }
                doEventLog($"查詢結果:input=>{JsonConvert.SerializeObject(vm)},result=>{JsonConvert.SerializeObject(modelResult)}");
                doLog($"查詢結果:input=>{JsonConvert.SerializeObject(vm)},result=>{JsonConvert.SerializeObject(modelResult)}");
            }
            catch (Exception ex)
            {
                modelResult = new ModelResult <IndexVM>(SystemCodes.Codes.ApplicationError01)
                {
                    SystemMessage = ex.Message
                };
            }

            return(modelResult);
        }
Exemplo n.º 15
0
        public IActionResult Index()
        {
            var model = new IndexVM
            {
                Brands    = UnitOfWork.Brands.FindAll(),
                NewItems  = UnitOfWork.StoredProcedures.GetItemsInfo(8, newItems: true, userId: SystemUser?.Id),
                SaleItems = UnitOfWork.StoredProcedures.GetItemsInfo(8, saleItems: true, userId: SystemUser?.Id)
            };

            return(View(model));
        }
Exemplo n.º 16
0
        // GET: Home
        public ActionResult Index()
        {
            IndexVM IndexVM = new IndexVM
            {
                Sliders = repoSlider.GetAll().OrderBy(o => o.pIndex).ToList(),
            };

            ViewBag.Location = new SelectList(db.Location.ToList(), "ID", "Name");

            return(View(IndexVM));
        }
        public ActionResult Index()
        {
            IndexVM IndexVM = new IndexVM
            {
                Categories = repoCategory.GetAll().Include(i => i.Children).Include(i => i.Products).ToList(),
                Brands     = repoBrand.GetAll().Include(i => i.Products).ToList(),
                Products   = repoProduct.GetAll().Include(i => i.Pictures).ToList()
            };

            return(View(IndexVM));
        }
Exemplo n.º 18
0
        public async Task <IActionResult> Index()
        {
            // showing national parks and trails
            IndexVM listOfParksAndTrails = new IndexVM()
            {
                NationalParkList = await _nationalParkRepository.GetAllAsync(SD.NationalParkAPIPath, HttpContext.Session.GetString("JWToken")),
                TrailList        = await _trailRepository.GetAllAsync(SD.TrailAPIPath, HttpContext.Session.GetString("JWToken")),
            };

            return(View(listOfParksAndTrails));
        }
Exemplo n.º 19
0
        public async Task <IActionResult> Index(IndexVM IndexVM2)
        {
            if (!ModelState.IsValid)
            {
                return(View("Index"));
            }

            try
            {
                MailMessage mail = new MailMessage();
                // you need to enter your mail address
                mail.From = new MailAddress("*****@*****.**");

                //To Email Address - your need to enter your to email address
                mail.To.Add("*****@*****.**");

                mail.Subject = IndexVM2.Subject;



                mail.IsBodyHtml = true;

                string content = "Name : " + IndexVM2.Name;
                content += "<br/> Email : " + IndexVM2.Email;
                content += "<br/> Phone Number : " + IndexVM2.PhoneNumber;
                content += "<br/> Subject : " + IndexVM2.Subject;
                content += "<br/> Message : " + IndexVM2.Message;

                mail.Body = content;


                //create SMTP instant

                //you need to pass mail server address and you can also specify the port number if you required
                SmtpClient smtpClient = new SmtpClient("smtp.gmail.com", 587);

                //Create nerwork credential and you need to give from email address and password
                NetworkCredential networkCredential = new NetworkCredential("*****@*****.**", "Pass Of Sender Email");
                smtpClient.UseDefaultCredentials = false;
                smtpClient.Credentials           = networkCredential;
                smtpClient.Port      = 587;  // this is default port number - you can also change this
                smtpClient.EnableSsl = true; // if ssl required you need to enable it
                smtpClient.Send(mail);



                // now i need to create the from
                ModelState.Clear();
            }
            catch (Exception ex)
            {
            }
            return(RedirectToAction(nameof(Index)));
        }
Exemplo n.º 20
0
        public async Task <IActionResult> Index()
        {
            IndexVM listOfGenresSubGenresAndMovies = new IndexVM
            {
                GenreList    = await _genreRepo.GetAllAsync(SD.GenreAPIPath, HttpContext.Session.GetString("JWToken")),
                SubGenreList = await _subGenreRepo.GetAllAsync(SD.SubGenreAPIPath, HttpContext.Session.GetString("JWToken")),
                MovieList    = await _movieRepo.GetAllAsync(SD.MovieAPIPath, HttpContext.Session.GetString("JWToken"))
            };

            return(View(listOfGenresSubGenresAndMovies));
        }
Exemplo n.º 21
0
        public ActionResult Index()
        {
            IndexVM indexVM = new IndexVM();

            indexVM.contact          = db.Contacts.First();
            indexVM.homeSlides       = db.HomeSlides.ToList();
            indexVM.about            = db.AboutUS.First();
            indexVM.xidmetlers       = db.Services.ToList();
            indexVM.xidmetlerBasliqs = db.ServicesHeaders.ToList();

            return(View(indexVM));
        }
Exemplo n.º 22
0
        public async Task <IActionResult> Index(IndexVM.SortCondEnum?SortCond, string searchString)
        {
            if (SortCond == null && TempData["SortCond"] != null)
            {
                SortCond = (IndexVM.SortCondEnum)TempData["SortCond"];
            }

            TempData["SortCond"] = SortCond;

            _logger.LogInformation($"INDEX {DateTime.UtcNow.ToLongTimeString()}");

            ViewData["CurrentFilter"] = searchString;

            var games = _context.Game.Include(g => g.Reviews);

            if (!String.IsNullOrEmpty(searchString))
            {
                games = games.Where(g => g.Title.Contains(searchString)).Include(g => g.Reviews);
            }

            IOrderedQueryable <Game> orderedGames = null;

            switch (SortCond)
            {
            case IndexVM.SortCondEnum.not_sort:
                orderedGames = games.OrderByDescending(g => g.ID);
                break;

            case IndexVM.SortCondEnum.title:
                orderedGames = games.OrderBy(g => g.Title);
                break;

            case IndexVM.SortCondEnum.grade:
                orderedGames = games.OrderBy(g => g.Reviews.FirstOrDefault().Grade);
                break;

            case IndexVM.SortCondEnum.release_date:
                orderedGames = games.OrderByDescending(g => g.ReleaseDate);
                break;

            default:
                orderedGames = games.OrderByDescending(g => g.ID);
                break;
            }

            var indexVM = new IndexVM();

            indexVM.Game = await orderedGames.ToListAsync();

            indexVM.SortCond = SortCond;

            return(View(indexVM));
        }
 public ActionResult Index(IndexVM model)
 {
     model.Items = new List <FacultiesService.FacultyDTO>();
     using (_service.Service)
     {
         foreach (var item in _service.Service.GetFaculties())
         {
             model.Items.Add(item);
         }
     }
     return(View(model));
 }
Exemplo n.º 24
0
        public ActionResult Index()
        {
            IndexVM IndexVM = new IndexVM
            {
                Sliders            = repoSlider.GetAll().OrderBy(o => o.PIndex).ToList(),
                NewestProducts     = repoProduct.GetAll().Include(i => i.Pictures).OrderByDescending(o => o.ID).Take(8).ToList(),
                BestSellerProducts = repoProduct.GetAll().Include(i => i.Pictures).OrderByDescending(o => o.OrderDetail.Sum(s => s.Quantity)).Take(8).ToList(),
                Advertisements     = repoAdvertisement.GetAll().ToList()
            };

            return(View(IndexVM));
        }
Exemplo n.º 25
0
        public ActionResult ListSelect(IndexVM indexVM)
        {
            var selectedList = sharePointService.GetListPOCO(indexVM.SelectedListVM.Title);

            indexVM = GetDefaultIndexVM();
            if (selectedList != null)
            {
                indexVMFactory.GetIndexVMWithSelectedList(indexVM, selectedList);
            }
            ModelState.Clear();
            return(View("Index", indexVM));
        }
Exemplo n.º 26
0
        public async Task <IActionResult> Index()
        {
            var token = HttpContext.Session.GetString("JwToken");

            IndexVM indexVM = new IndexVM()
            {
                NationalParkList = await _npRepository.GetAllAsync(SD.NationalParkAPIPath, token),
                TrailList        = await _tRepository.GetAllAsync(SD.TrailAPIPath, token)
            };

            return(View(indexVM));
        }
 // GET: Students
 public ActionResult Index(IndexVM model)
 {
     model.Items = new List <StudentsService.StudentDTO>();
     using (_service.Service)
     {
         foreach (var item in _service.Service.GetStudents())
         {
             model.Items.Add(item);
         }
     }
     return(View(model));
 }
        /*
         * public IActionResult Index()
         * {
         *  return View();
         * }
         */

        // 11. Part 2
        // ----------------------------

        public async Task <IActionResult> Index()
        {
            var asd = HttpContext.Session.GetString("JWToken");

            IndexVM indexVM = new IndexVM()
            {
                NationalParkList = await _npRepo.GetAllSync(_npUrl, HttpContext.Session.GetString("JWToken")),
                TrailList        = await _trailRepo.GetAllSync(_trailUrl, HttpContext.Session.GetString("JWToken"))
            };

            return(View(indexVM));
        }
Exemplo n.º 29
0
        public ActionResult Index(IndexVM model)
        {
            UsersRepository    repo         = new UsersRepository();
            PostsRepository    postsRepo    = new PostsRepository();
            CommentsRepository commentsRepo = new CommentsRepository();

            model.User     = repo.GetById(model.UserId);
            model.Posts    = postsRepo.GetAll(p => p.UserId == model.UserId);
            model.Comments = commentsRepo.GetAll(c => c.UserId == model.UserId);

            return(View(model));
        }
Exemplo n.º 30
0
        // GET: Movies
        public ActionResult Index(IndexVM model, string searchName, MoviesTable movieTb)
        {
            MoviesModel context = new MoviesModel();
            MoviesTable item    = new MoviesTable();

            //if(!String.IsNullOrEmpty(searchName))
            // {
            model.Items = context.MoviesTable.OrderByDescending(i => i.MovieName).ToList();
            // }

            return(View(model));
        }
Exemplo n.º 31
0
        public IActionResult Index()
        {
            var model = new IndexVM
            {
                Rows = new List <IndexVM.MainRow>()
            };
            var angazovanList = _context.Angazovan
                                .Include(a => a.AkademskaGodina)
                                .Include(a => a.Nastavnik)
                                .Include(a => a.Predmet)
                                .ToList();
            var razlicitiPredmeti = new List <Predmet>();

            foreach (var a in angazovanList)
            {
                if (!razlicitiPredmeti.Contains(a.Predmet))
                {
                    razlicitiPredmeti.Add(a.Predmet);
                }
            }

            foreach (var predmet in razlicitiPredmeti)
            {
                var mainRow = new IndexVM.MainRow
                {
                    NazivPredmeta = predmet.Naziv
                };
                mainRow.InsideRows = new List <IndexVM.MainRow.Row>();
                foreach (var a in angazovanList)
                {
                    if (a.Predmet == predmet)
                    {
                        var insideRow = new IndexVM.MainRow.Row
                        {
                            AngazovanId   = a.Id,
                            Nastavnik     = a.Nastavnik.Ime + " " + a.Nastavnik.Prezime,
                            SkolskaGodina = a.AkademskaGodina.Opis,
                            OdrzanoCasova = _context.OdrzaniCas
                                            .Where(oc => oc.Angazovani == a)
                                            .Count(),
                            StudenataNaPredmetu = _context.SlusaPredmet
                                                  .Where(sp => sp.Angazovan == a)
                                                  .Count()
                        };
                        mainRow.InsideRows.Add(insideRow);
                    }
                }
                model.Rows.Add(mainRow);
            }

            return(View(model));
        }
Exemplo n.º 32
0
 public ActionResult Index()
 {
     var vm = new IndexVM("", "");
     return View(vm);
 }
Exemplo n.º 33
0
 public ActionResult Opinion(String id = "")
 {
     var vm = new IndexVM("opinion", id);
     return View("Index", vm);
 }
Exemplo n.º 34
0
 public ActionResult Fact(String id = "")
 {
     var vm = new IndexVM("fact", id);
     return View("Index", vm);
 }