示例#1
0
        private void BtnEliminar_Click(object sender, EventArgs e)
        {
            EmpleadoNegocio neg = new EmpleadoNegocio();
            Empleado        em  = (Empleado)dgvEmpleados.CurrentRow.DataBoundItem;

            try
            {
                using (var popup = new Confirmacion(@"eliminar """ + em.ToString() + @""""))
                {
                    var R = popup.ShowDialog();
                    if (R == DialogResult.OK)
                    {
                        bool conf = popup.R;
                        if (em != null && conf == true)
                        {
                            neg.EliminarLogico(em.IdEmpleado);
                            LlenarTabla();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Mensaje m = new Mensaje(ex.ToString()); m.ShowDialog();
            }
        }
示例#2
0
 private void BtnEliminar_Click(object sender, EventArgs e)
 {
     if (dgvContactos.SelectedCells.Count > 0)
     {
         ContactoNegocio neg = new ContactoNegocio();
         Contacto        C   = (Contacto)dgvContactos.CurrentRow.DataBoundItem;
         try
         {
             using (var popup = new Confirmacion(@"eliminar """ + C.ToString() + @""""))
             {
                 var R = popup.ShowDialog();
                 if (R == DialogResult.OK)
                 {
                     bool conf = popup.R;
                     if (C != null && conf == true)
                     {
                         neg.EliminarLogico(C.IdContacto);
                         LlenarTabla();
                     }
                 }
             }
         }
         catch (Exception ex)
         {
             Mensaje m = new Mensaje(ex.ToString()); m.ShowDialog();
         }
     }
     else
     {
         Mensaje m = new Mensaje("Ningun item seleccionado.");
         m.ShowDialog();
     }
 }
示例#3
0
 private void BtnAnular_Click(object sender, EventArgs e)
 {
     if (dgvVentas.SelectedCells.Count > 0)
     {
         VentaNegocio           negV  = new VentaNegocio();
         ProductoVendidoNegocio negPV = new ProductoVendidoNegocio();
         Venta v = (Venta)dgvVentas.CurrentRow.DataBoundItem;
         try
         {
             using (var popup = new Confirmacion(@"anular la venta """ + v.ToString() + @""""))
             {
                 var R = popup.ShowDialog();
                 if (R == DialogResult.OK)
                 {
                     bool conf = popup.R;
                     if (v != null && conf == true)
                     {
                         negV.AnularVenta(v);
                         LlenarTabla();
                     }
                 }
             }
         }
         catch (Exception ex)
         {
             Mensaje m = new Mensaje(ex.ToString()); m.ShowDialog();
         }
     }
     else
     {
         Mensaje m = new Mensaje("Ningun item seleccionado.");
         m.ShowDialog();
     }
 }
示例#4
0
 private void BtnEliminar_Click(object sender, EventArgs e)
 {
     if (dgvVenta.SelectedCells.Count > 0)
     {
         ProductoVendidoNegocio neg = new ProductoVendidoNegocio();
         ProductoVendido        l   = (ProductoVendido)dgvVenta.CurrentRow.DataBoundItem;
         try
         {
             using (var popup = new Confirmacion(@"eliminar """ + l.ToString() + @""""))
             {
                 var R = popup.ShowDialog();
                 if (R == DialogResult.OK)
                 {
                     bool conf = popup.R;
                     if (l != null && conf == true)
                     {
                         neg.EliminarFisico(l.IdPxv);
                         BindProductos.Remove(l);
                         LlenarTabla();
                     }
                 }
             }
         }
         catch (Exception ex)
         {
             Mensaje m = new Mensaje(ex.ToString()); m.ShowDialog();
         }
     }
     else
     {
         Mensaje m = new Mensaje("Ningun item seleccionado.");
         m.ShowDialog();
     }
 }
示例#5
0
 private void BtnAnular_Click(object sender, EventArgs e)
 {
     if (dgvCompras.SelectedCells.Count > 0)
     {
         CompraNegocio neg = new CompraNegocio();
         Compra        c   = (Compra)dgvCompras.CurrentRow.DataBoundItem;
         try
         {
             using (var popup = new Confirmacion(@"anular la compra """ + c.ToString() + @""""))
             {
                 var R = popup.ShowDialog();
                 if (R == DialogResult.OK)
                 {
                     bool conf = popup.R;
                     if (c != null && conf == true)
                     {
                         if (neg.AnularCompra(c))
                         {
                             LlenarTabla();
                         }
                         else
                         {
                             Mensaje me = new Mensaje("No se puede anular compra con productos faltantes."); me.ShowDialog();
                         }
                     }
                 }
             }
         }
         catch (Exception ex)
         {
             Mensaje mex = new Mensaje(ex.ToString()); mex.ShowDialog();
         }
     }
     else
     {
         Mensaje m = new Mensaje("Ningun item seleccionado.");
         m.ShowDialog();
     }
 }
 private void BtnCerrar_Click(object sender, EventArgs e)
 {
     try
     {
         using (var popup = new Confirmacion(@"salir sin guardar los cambios?" + @""""))
         {
             var R = popup.ShowDialog();
             if (R == DialogResult.OK)
             {
                 bool conf = popup.R;
                 if (conf == true)
                 {
                     this.Close();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Mensaje m = new Mensaje(ex.ToString()); m.ShowDialog();
     }
 }