public ActionResult Edit(int id, Temporada collection) { try { // TODO: Add update logic here TemporadaCEN cen = new TemporadaCEN(); cen.Modify(collection.id, collection.Nombre); //cen.New_(collection.Nombre, collection.Precio, collection.Descripcion, collection.Imagen, collection.Valor, collection.Stock, collection.Talla); //return RedirectToAction("Index"); string action = "Details"; string controller = "Serie"; int arg = (int)System.Web.HttpContext.Current.Session["id_serie"]; return(RedirectToAction(action, controller, new { id = arg })); } catch { return(View()); } }
// GET: Articulo/Delete/5 public ActionResult Delete(int id) { TemporadaCEN cen = new TemporadaCEN(); TemporadaEN en = new TemporadaEN(); en = cen.ReadOID(id); AssemblerTemporada ass = new AssemblerTemporada(); Temporada sol = ass.ConvertENToModelUI(en); return(View(sol)); }
// GET: Articulo public ActionResult Index() { TemporadaCEN cen = new TemporadaCEN(); IList <TemporadaEN> enlinst = cen.ReadAll(0, int.MaxValue); AssemblerTemporada ass = new AssemblerTemporada(); IList <Temporada> listart = ass.ConvertListENToModel(enlinst); System.Web.HttpContext.Current.Session["controller2"] = "Temporada"; System.Web.HttpContext.Current.Session["action2"] = "Index"; System.Web.HttpContext.Current.Session["arg2"] = null; //articuloAsembler.covert return(View(listart)); }
// GET: Articulo/Details/5 public ActionResult Details(int id) { TemporadaCEN cen = new TemporadaCEN(); TemporadaEN en = new TemporadaEN(); System.Web.HttpContext.Current.Session["idtemp"] = id; en = cen.ReadOID(id); AssemblerTemporada ass = new AssemblerTemporada(); Temporada sol = ass.ConvertENToModelUI(en); return(View(sol)); }
// GET: Articulo/Edit/5 public ActionResult Edit(int id) { TemporadaCEN cen = new TemporadaCEN(); TemporadaEN en = new TemporadaEN(); en = cen.ReadOID(id); // SessionInitializeTransaction(); //IProducto productoCAD = new productoCAD(session); // ProductoEN en = new Pro; AssemblerTemporada ass = new AssemblerTemporada(); Temporada sol = ass.ConvertENToModelUI(en); return(View(sol)); }
public ActionResult Create(int id, Temporada collection) { try { // TODO: Add insert logic here TemporadaCEN cen = new TemporadaCEN(); cen.New_(id, collection.Nombre); string action = "Details"; string controller = "Serie"; int arg = (int)System.Web.HttpContext.Current.Session["id_serie"]; return(RedirectToAction(action, controller, new { id = arg })); } catch { return(View()); } }
public ActionResult Delete(int id, FormCollection collection) { try { // TODO: Add delete logic here TemporadaCEN cen = new TemporadaCEN(); cen.Destroy(id); string action = "Details"; string controller = "Serie"; int arg = (int)System.Web.HttpContext.Current.Session["id_serie"]; return(RedirectToAction(action, controller, new { id = arg })); } catch { return(View()); } }
public ActionResult Create_temp(int id, Temporada collection) { try { TemporadaEN en = new TemporadaEN(); // TODO: Add insert logic here TemporadaCEN cen = new TemporadaCEN(); cen.New_(id, collection.Nombre); //IList<int> resu = new List<int>(); //resu.Add(temp); //resu.Aggregate<int>(temp); //SerieCEN cens = new SerieCEN(); //cens.Addtemporada(id, resu); return(RedirectToAction("mostrar_temp", "Serie", new { id = id })); } catch { return(View()); } }
// GET: Articulo/mostrar_cap/5 public ActionResult mostrar_cap(int id) { //lazy-fetching = false; SessionInitialize(); TemporadaCAD cad = new TemporadaCAD(session); TemporadaCEN cen = new TemporadaCEN(cad); TemporadaEN en = cen.ReadOID(id); IList <CapituloEN> ten = en.Capitulo; AssemblerCapitulo ass = new AssemblerCapitulo(); IList <Capitulo> sol = ass.ConvertListENToModel(ten); SessionClose(); System.Web.HttpContext.Current.Session["idtemp"] = id; return(View(sol)); }
public void Anyadircap(int p_oid, string p_nombre, Nullable <DateTime> p_fecha, string p_descripcion, string p_imagen) { /*PROTECTED REGION ID(SMPGenNHibernate.CP.SMP_Temporada_anyadircap) ENABLED START*/ ITemporadaCAD temporadaCAD = null; TemporadaCEN temporadaCEN = null; try { SessionInitializeTransaction(); temporadaCAD = new TemporadaCAD(session); temporadaCEN = new TemporadaCEN(temporadaCAD); // Write here your custom transaction ... throw new NotImplementedException("Method Anyadircap() not yet implemented."); SessionCommit(); } catch (Exception ex) { SessionRollBack(); throw ex; } finally { SessionClose(); } /*PROTECTED REGION END*/ }
public void Borrarcap(int p_oid, int p_id_cap) { /*PROTECTED REGION ID(SMPGenNHibernate.CP.SMP_Temporada_borrarcap) ENABLED START*/ ITemporadaCAD temporadaCAD = null; TemporadaCEN temporadaCEN = null; try { SessionInitializeTransaction(); temporadaCAD = new TemporadaCAD(session); temporadaCEN = new TemporadaCEN(temporadaCAD); // Write here your custom transaction ... throw new NotImplementedException("Method Borrarcap() not yet implemented."); SessionCommit(); } catch (Exception ex) { SessionRollBack(); throw ex; } finally { SessionClose(); } /*PROTECTED REGION END*/ }