public ActionResult AfisareMasiniRezervate() { var repo = new ReadRepository(); masinaRepo = repo.IncarcaListaMasini(); // masinaRepo.Sort(); var id = repo.IncarcaIdRadacina(); //for (int i=0; i < masinaRepo.Count();i++) //{ // if(masinaRepo[i].CIV.ToString().Equals(masinaRepo[i+1].CIV.ToString())) // masina //} var eventRepo = repo.IncarcaListaDeEvenimente(); 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() ); if (mVC.Stare == proiect_pssc.Model.Masina.StareMasina.Rezervata) { mVC.Stare = x.stare; masina.Add(mVC); } } ViewBag.Model = masina; return(View("AfisareMasini", masina)); }