Example #1
0
 private void TxtClave_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         BtnAceptar.Focus();
     }
 }
 private void TxtMotivo_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == 13)
     {
         BtnAceptar.Focus();
     }
 }
Example #3
0
 private void txtContraseña_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         BtnAceptar.Focus();
     }
 }
Example #4
0
 private void TxtClave_KeyPress(object sender, KeyPressEventArgs e)
 {
     try
     {
         if (e.KeyChar == '\r')
         {
             e.Handled = true;
             BtnAceptar.PerformClick();
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #5
0
        private void InsertaPartida()
        {
            if (producto == null && TxtProducto.Text.Trim().Length == 0)
            {
                Ambiente.Mensaje("Producto no encontrado");
                return;
            }

            producto = productoController.SelectOne(TxtProducto.Text.Trim());


            if (producto == null)
            {
                return;
            }
            try
            {
                if ((bool)producto.Ocupado)
                {
                    Ambiente.Mensaje("Operación abortada, el articulo está bloqueado por otro proceso [INVENTARIOS, AJUSTES, AUTORIZACIONES, ETC]");
                    return;
                }
            }
            catch (Exception ex)
            {
                Ambiente.Mensaje(ex.Message);
            }

            if (conceptoMovInv == null)
            {
                return;
            }



            var partida = new Devolucionp();


            if (producto.TieneLote && conceptoMovInv.Es.Equals("E"))
            {
                using (var form = new FrmLoteCaducidad(0, NCantidad.Value, producto.ProductoId, devolucion.DevolucionId, conceptoMovInv.ConceptoMovInvId))
                {
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        partida.LoteId    = form.lotes[0].LoteId;
                        partida.NoLote    = form.lotes[0].NoLote;
                        partida.Caducidad = form.lotes[0].Caducidad;
                    }
                    else
                    {
                        partida.LoteId    = null;
                        partida.NoLote    = null;
                        partida.Caducidad = null;
                    }
                }
                BtnAceptar.Focus();
            }

            if (producto.TieneLote && conceptoMovInv.Es.Equals("S"))
            {
                producto.Lote = new List <Lote>();
                if (lote == null)
                {
                    Ambiente.Mensaje("Seleccione el lote del articulo");
                    return;
                }
                else
                {
                    producto.Lote.Add(lote);
                    partida.LoteId    = lote.LoteId;
                    partida.NoLote    = lote.NoLote;
                    partida.Caducidad = lote.Caducidad;
                }
            }

            //control lotes



            partida.DevolucionId = devolucion.DevolucionId;
            partida.ProductoId   = producto.ProductoId;
            partida.Descripcion  = producto.Descripcion;
            partida.Cantidad     = (int)NCantidad.Value;
            partida.Stock        = (int)producto.Stock;
            partida.PrecioCompra = producto.PrecioCompra;
            partida.ImpuestoId1  = producto.Impuesto1Id;
            partida.ImpuestoId2  = producto.Impuesto2Id;
            partida.Impuesto1    = Ambiente.GetTasaImpuesto(partida.ImpuestoId1);
            partida.Impuesto2    = Ambiente.GetTasaImpuesto(partida.ImpuestoId2);
            //Totales de la partida
            partida.Subtotal         = partida.Cantidad * partida.PrecioCompra;
            partida.ImporteImpuesto1 = partida.Subtotal * partida.Impuesto1;
            partida.ImporteImpuesto2 = partida.Subtotal * partida.Impuesto2;
            partida.Total            = partida.Subtotal + partida.ImporteImpuesto1 + partida.ImporteImpuesto2;



            //partida al grid
            Malla.Rows.Add();
            Malla.Rows[Malla.RowCount - 1].Cells[0].Value = partida.Descripcion;
            Malla.Rows[Malla.RowCount - 1].Cells[1].Value = partida.Stock;
            Malla.Rows[Malla.RowCount - 1].Cells[2].Value = partida.Cantidad;
            Malla.Rows[Malla.RowCount - 1].Cells[3].Value = partida.PrecioCompra;
            Malla.Rows[Malla.RowCount - 1].Cells[4].Value = partida.Impuesto1;
            Malla.Rows[Malla.RowCount - 1].Cells[5].Value = partida.Impuesto2;
            Malla.Rows[Malla.RowCount - 1].Cells[6].Value = partida.Subtotal;
            Malla.Rows[Malla.RowCount - 1].Cells[7].Value = partida.Subtotal + partida.ImporteImpuesto1 + partida.ImporteImpuesto2;
            Malla.Rows[Malla.RowCount - 1].Cells[8].Value = partida.NoLote;
            Malla.Rows[Malla.RowCount - 1].Cells[9].Value = partida.Caducidad;
            partidas.Add(partida);
            ResetPartida();
            CalculaTotales();
        }
Example #6
0
 private void BtnImagen_Leave(object sender, EventArgs e)
 {
     BtnAceptar.Focus();
 }