Exemplo n.º 1
0
        public ActionResult AfisareMasini()
        {
            var repo       = new ReadRepository();
            var masinaRepo = repo.IncarcaListaMasini22222();
            // masinaRepo = repo.IncarcaListaMasini();
            var etc       = masinaRepo.Select(_ => _.CIV.ToString()).Distinct().ToList();
            var eventRepo = repo.IncarcaListaDeEvenimente();
            //   List<Masina> nouaMasina = masinaRepo.Select(_=>_.CIV).Distinct().ToList();
            //   var distincIndex = masinaRepo.FindIndex(_ => _.CIV.Text).Distinct();
            List <MasinaMVC> masina = new List <MasinaMVC>();

            foreach (Masina x in masinaRepo)
            {
                Console.WriteLine(x.CIV.ToString());
                string ceva = x.CIV.ToString();
                var    mVC  = new MasinaMVC(
                    x.CIV.ToString(), x.Tip, x.Marca.ToString(), x.ToString(), x.An.ToString(), x.Pret.ToString(), x.Kilometraj.ToString(),
                    x.Descriere.ToString(), x.Motorizare.ToString(), x.Culoare.ToString(), x.Putere.ToString(),
                    x.CapacitateCilindrica.ToString()
                    );


                mVC.Stare = x.stare;
                masina.Add(mVC);
            }
            ViewBag.Model = masina;
            return(View(masina));
        }