public ActionResult AltaPeliculaConElenco() { if (Session["AuxEmail"] == null) { ViewBag.Mensaje = "No inicio sesion"; return(RedirectToAction("Index", "Funcionario")); } if (Session["AuxEmail"] != null) { ServiceObligatorioClient client = new ServiceObligatorioClient(); client.Open(); ViewBag.genero = client.GeneroMaterial(); List <generoServi> ret = new List <generoServi>(); ViewBag.lstActores = client.ListaTodosLosActores(); List <ActoresServi> actoresSelecionados = new List <ActoresServi>(); ActoresServi actoresServi = new ActoresServi(); //actoresServi.Codigo = Convert.ToInt16(datosFormulario["lstActores"]); //actoresSelecionados.Add(actoresServi); ViewBag.lstActoresElejidos = actoresSelecionados; } return(View()); }
public ActionResult CargaActotesElegidos(FormCollection datosFormulario) { if (Session["AuxEmail"] == null) { ViewBag.Mensaje = "No inicio sesion"; return(RedirectToAction("Index", "Funcionario")); } if (Session["AuxEmail"] != null) { ServiceObligatorioClient client = new ServiceObligatorioClient(); client.Open(); ViewBag.genero = client.GeneroMaterial(); List <generoServi> ret = new List <generoServi>(); ViewBag.lstActores = client.ListaTodosLosActores(); List <ActoresServi> actoresSelecionados = new List <ActoresServi>(); ActoresServi actoresServi = new ActoresServi(); List <ActoresServi> temp = new List <ActoresServi>(); if (Session["AuxlstActoresElejidos"] != null) { temp = Session["AuxlstActoresElejidos"] as List <ActoresServi>; actoresSelecionados = temp; } actoresServi.Codigo = Convert.ToInt16(datosFormulario["lstActores"]); if (datosFormulario["lstActoresElejidos"] != null) { ActoresServi actoresServi1 = new ActoresServi(); } actoresSelecionados.Add(actoresServi); //ViewState["lInvConta"] = listInventario; //List<Inventario> temp = ViewState["lInvConta"] as List<Inventario>; ViewBag.lstActoresElejidoss = actoresSelecionados; Session["AuxlstActoresElejidos"] = actoresSelecionados; temp = actoresSelecionados; ViewBag.datosFormulario = datosFormulario; //actoresSelecionados =Convert. Session["AuxlstActoresElejidos"]; //lstActoresElejidos //return View("AltaPeliculaConElenco"); //return RedirectToAction("AltaPeliculaConElenco", "Funcionario"); } return(View()); }