public ActionResult DeleteConfirmed(int id) { TANDA tANDA = db.TANDAs.Find(id); db.TANDAs.Remove(tANDA); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "IdTanda,Nombre,Estado")] TANDA tANDA) { if (ModelState.IsValid) { db.Entry(tANDA).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tANDA)); }
public ActionResult Create([Bind(Include = "IdTanda,Nombre,Estado")] TANDA tANDA) { if (ModelState.IsValid) { db.TANDAs.Add(tANDA); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tANDA)); }
public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TANDA tANDA = db.TANDAs.Find(id); if (tANDA == null) { return(HttpNotFound()); } return(View(tANDA)); }
private void dataGridView1_DoubleClick(object sender, EventArgs e) { if (dataGridView1.CurrentRow.Index != -1) { model.ID = Convert.ToInt32(dataGridView1.CurrentRow.Cells["ID"].Value); using (RentaCarEntities db = new RentaCarEntities()) { model = db.TANDA.Where(x => x.ID == model.ID).FirstOrDefault(); textBox1.Text = model.DESCRIPCION; checkBox1.Checked = Convert.ToBoolean(model.ESTADO); } btnCrear.Text = "Actualizar"; btnBorrar.Enabled = true; } }