Example #1
0
 private void button2_Click(object sender, EventArgs e)
 {
     try
     {
         Int32 indice =  Int32.Parse(label4.Text);
         PDVEntities p = new PDVEntities();
         Usuario a = (Usuario)p.Usuario.Where(z => z.id == indice).FirstOrDefault();
         p.DeleteObject(a);
         p.SaveChanges();
         MessageBox.Show("Borrado Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
         actualizagrid();
         limpia();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }