private void Rol_V_btn_edit_Click_1(object sender, EventArgs e) { using (ferreteriaEntities1 db = new ferreteriaEntities1()) { String id = Rol_list.CurrentRow.Cells[0].Value.ToString(); int idC = int.Parse(id); user = db.usuario.Where(VerificarID => VerificarID.id_rol == idC).First(); user.nombre = txtrol.Text; db.Entry(user).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } }
private void Marca_V_btn_edit_Click(object sender, EventArgs e) { using (ferreteriaEntities1 db = new ferreteriaEntities1()) { String id = dgvMarca.CurrentRow.Cells[0].Value.ToString(); int idC = int.Parse(id); mar = db.marca.Where(VerificarID => VerificarID.id_marca == idC).First(); mar.nombre_marca = txtmarca.Text; db.Entry(mar).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } }
private void Proveedor_V_btn_edit_Click(object sender, EventArgs e) { using (ferreteriaEntities1 db = new ferreteriaEntities1()) { String id = dtgprov.CurrentRow.Cells[0].Value.ToString(); int idC = int.Parse(id); prov = db.proveedor.Where(VerificarID => VerificarID.id_proveedor == idC).First(); prov.nombre_proveedor = txtProv.Text; db.Entry(prov).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } CargarTabla(); }
private void Cat_V_btn_edit_Click(object sender, EventArgs e) { using (ferreteriaEntities1 db = new ferreteriaEntities1()) { String id = dtvCategoria.CurrentRow.Cells[0].Value.ToString(); int idC = int.Parse(id); cate = db.categoria.Where(VerificarID => VerificarID.id_categoria == idC).First(); cate.nombre_categoria = txtcategoria.Text; db.Entry(cate).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } CargarDatos(); }