// GET: Puja public ActionResult Index() { SessionInitialize(); PujaCAD pujaCAD = new PujaCAD(session); PujaCEN pujaCEN = new PujaCEN(pujaCAD); IList <PujaEN> pujas = pujaCEN.ReadAll(0, -1); IEnumerable <Puja> puj = new AssemblerPuja().ConvertListENToModel(pujas).ToList(); SessionClose(); return(View(puj)); }
public ActionResult Create(int Articulo, float Puja) { try { bool repetido = false; PujaCEN pujaCEN = new PujaCEN(); IList <PujaEN> pujas = pujaCEN.ReadAll(0, -1); foreach (var item in pujas) { if (item.Articulo.Id == Articulo) { repetido = true; break; } } pujaCEN.New_(DateTime.Now, Puja, Articulo, Puja, -1, false, false); /* * if (!repetido) * { * * } * else * { * System.Web.HttpContext.Current.Session["PujaError"] = "Repetida"; * return RedirectToAction("../Registrado/Admin"); * } */ return(RedirectToAction("Index")); } catch { return(View()); } }