public ActionResult CautaComanda() { var repo = new ReadRepository(); comandaRepo = ReadRepository.IncarcaDinListaDeComenzi(); var eventRepo = ReadRepository.IncarcaDinListaDeEvenimente(); List <ComandaMvc> comanda = new List <ComandaMvc>(); foreach (Comanda c in comandaRepo) { // string idCom = c.iDComanda.ToString(); /* var mVC = new ComandaMvc( * x.CIV.ToString(), x.Tip, x.Marca.ToString(), x.Model.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() * ); */ var mvc = new ComandaMvc(c.mecanic.nume, c.mecanic.idMecanic, c.client.nume, c.client.idClient, c.iDComanda, c.masina.Model, c.masina.anFabricatie, c.masina.civ, c.masina.serieSasiu, c.cerereClient); comanda.Add(mvc); } ViewBag.Model = comanda; return(View(comanda)); }
public ActionResult AfisareComenzi() { //var repo = new ReadRepository(); // comandaRepo = ReadRepository.IncarcaDinListaDeComenzi(); var comandaRepo = ReadRepository.IncarcaDinListaDeEvenimente(); // List<ComandaMvc> comanda = new List<ComandaMvc>(); // foreach (Comanda c in comandaRepo) //{ // string idCom = c.iDComanda.ToString(); /* var mVC = new ComandaMvc( * x.CIV.ToString(), x.Tip, x.Marca.ToString(), x.Model.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() * ); */ /* var mvc = new ComandaMvc(c.mecanic.nume, c.mecanic.idMecanic, c.client.nume, c.client.idClient, * c.iDComanda, c.masina.Model, c.masina.anFabricatie, c.masina.civ, c.masina.serieSasiu, * c.cerereClient); */ comandaMcv = comandaRepo.Select(c => new ComandaMvc { mecanic = c.mecanic, client = c.client, iDComanda = c.iDComanda, stareComanda = c.stareComanda, masina = c.masina, cerereClient = c.cerereClient, cost = c.cost, evaluareMecanic = c.evaluareMecanic }).ToList(); //comanda.Add(mvc); // } ViewBag.Model = comandaMcv; return(View(comandaMcv)); }