public ActionResult DeleteConfirmed(int id) { Cartela cartela = db.Cartela.Find(id); db.Cartela.Remove(cartela); db.SaveChanges(); return(RedirectToAction("Index")); }
public void chamarNovaCartela() { Cartela cart = new Cartela(); classCartela c = new classCartela(); cart.Text = "Cartela " + ++contNumCartela; c.Id = contNumCartela; cart.Controls.Add(c.Painel); cart.Show(); }
public ActionResult Edit([Bind(Include = "CartelaId,CodigoTabela,Campo1,Campo2,Campo3,Campo4,Campo5,Campo6,Campo7,Campo8,Campo9,Campo10,Campo11,Campo12,Campo13,Campo14,Campo15")] Cartela cartela) { if (ModelState.IsValid) { db.Entry(cartela).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cartela)); }
public ActionResult Create([Bind(Include = "CartelaId,CodigoTabela,Campo1,Campo2,Campo3,Campo4,Campo5,Campo6,Campo7,Campo8,Campo9,Campo10,Campo11,Campo12,Campo13,Campo14,Campo15")] Cartela cartela) { if (ModelState.IsValid) { db.Cartela.Add(cartela); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cartela)); }
// GET: Cartela/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Cartela cartela = db.Cartela.Find(id); if (cartela == null) { return(HttpNotFound()); } return(View(cartela)); }
// GET: Cartela/Create public ActionResult Create() { Cartela Cartela = new Cartela(); List <Cartela> listCartela = new List <Cartela>(); for (int i = 1; i <= 100; i++) { Cartela = new Cartela(); Cartela.CodigoTabela = i; Cartela.Campo1 = rand.Next(1, 4); Cartela.Campo2 = rand.Next(4, 8); Cartela.Campo3 = rand.Next(8, 12); Cartela.Campo4 = rand.Next(12, 16); Cartela.Campo5 = rand.Next(16, 20); Cartela.Campo6 = rand.Next(20, 24); Cartela.Campo7 = rand.Next(24, 28); Cartela.Campo8 = rand.Next(28, 32); Cartela.Campo9 = rand.Next(32, 36); Cartela.Campo10 = rand.Next(36, 40); Cartela.Campo11 = rand.Next(40, 44); Cartela.Campo12 = rand.Next(44, 48); Cartela.Campo13 = rand.Next(48, 52); Cartela.Campo14 = rand.Next(52, 56); Cartela.Campo15 = rand.Next(56, 71); listCartela.Add(Cartela); } return(View(listCartela)); }
//constructor da classe public Bingo(Form f) { tab = new Tabela(f); car = new Cartela(f); }