private void BtnInsert_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                using (var context = new SDXCatering_Emp010Entities())
                {
                    var empleado = new CtMae_Empleados
                    {
                        Cedula            = "4",
                        EmpleadoCodigo    = "4",
                        EmpleadoNombres   = "otro empleado",
                        EmpleadoApellidos = "otro empleado",
                        EmpresaCodigo     = "1307",
                        PuntoVentaCodigo  = "03",
                        CargoId           = 1
                    };

                    context.CtMae_Empleados.Add(empleado);
                    context.SaveChanges();
                    load();
                }
            }
            catch (Exception w)
            {
                MessageBox.Show("error al insertar:" + w);
            }
        }
 private void BtnDelte_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         using (var context = new SDXCatering_Emp010Entities())
         {
             var empleado = (CtMae_Empleados)gridA.SelectedItem;
             //context.CtMae_Empleados.Remove(empleado);
             context.Entry(empleado).State = System.Data.Entity.EntityState.Deleted;
             context.SaveChanges();
             load();
         }
     }
     catch (Exception w)
     {
         MessageBox.Show("error al eliminar:" + w);
     }
 }
 private void BtnUpdate_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         var empleado = (CtMae_Empleados)gridA.SelectedItem;
         //MessageBox.Show(a.EmpleadoCodigo);
         //empleado.EmpleadoNombres = "cambiado";
         using (var context = new SDXCatering_Emp010Entities())
         {
             context.Entry(empleado).State = System.Data.Entity.EntityState.Modified;
             context.SaveChanges();
             load();
         }
     }
     catch (Exception w)
     {
         MessageBox.Show("error al actualizar:" + w);
     }
 }