// GET: ModelLaboratorios/Edit/5 public ActionResult Edit(int id) { ModelLaboratorio sm = new ModelLaboratorio(); sm = Converte.ToModelLaboratorio(server.getById(id)); return(View(sm)); }
public ActionResult Edit(ModelLaboratorio modelLaboratorio) { try { server.Editar(Converte.ToLaboratorio(modelLaboratorio)); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Create(ModelLaboratorio lab) { try { server.Inserir(Converte.ToLaboratorio(lab)); return(RedirectToAction("Index")); } catch { return(View()); } }
public static ModelLaboratorio ToSalaModel(Laboratorio lab) { ModelLaboratorio labModel = new ModelLaboratorio(); labModel.Nome = lab.nome; labModel.Projetor = Convert.ToBoolean(lab.projetor); labModel.qtdAlunos = (int)lab.qtdeAlunos; labModel.qtdComputadores = (int)lab.qtdeComputadores; labModel.SistemaOperacional = lab.sistemaOperacional; labModel.Software1 = lab.software1; labModel.Software2 = lab.software2; labModel.Software3 = lab.software3; return(labModel); }
public static Laboratorio ToSala(ModelLaboratorio labModel) { Laboratorio lab = new Laboratorio(); lab.nome = labModel.Nome; lab.projetor = labModel.Projetor; lab.qtdeAlunos = labModel.qtdAlunos; lab.qtdeComputadores = labModel.qtdComputadores; lab.sistemaOperacional = labModel.SistemaOperacional; lab.software1 = labModel.Software1; lab.software2 = labModel.Software2; lab.software3 = labModel.Software3; return(lab); }
// GET: ModelLaboratorios public ActionResult Index() { List <ModelLaboratorio> lstLab = new List <ModelLaboratorio>(); var lst = server.Listar(); foreach (var item in lst) { ModelLaboratorio s = new ModelLaboratorio(); s = Converte.ToModelLaboratorio(item); lstLab.Add(s); } return(View(lstLab)); }