Exemple #1
0
 private void Tcantidad_Leave(object sender, EventArgs e)
 {
     if (Tcantidad.Text != string.Empty)
     {
         int added;
         if (!int.TryParse(Tcantidad.Text, out added))
         {
             P.Mensaje.Advert("Solo puede ingresar números en la cantidad");
             Tcantidad.Focus();
             Tcantidad.Text = string.Empty;
         }
         else
         {
             Tcantidad.Text = added.ToString("#");
         }
     }
 }
Exemple #2
0
        private void btn_guardar_Click(Object sender, EventArgs e)  //Handles btn_guardar.Click
        {
            int cantidad;

            //validamos campos
            if (Tcantidad.Text == string.Empty)
            {
                P.Mensaje.Advert("Ingrese un monto para cantidad de articulos");
                Tcantidad.Focus();
                return;
            }
            else
            {
                if (!int.TryParse(Tcantidad.Text, out cantidad))
                {
                    P.Mensaje.Advert("Valor ingresado no corresponde a un número");
                    Tcantidad.Focus();
                    return;
                }
            }
            if (LvalorAF.Text == "0" || LvalorAF.Text == string.Empty)
            {
                P.Mensaje.Advert("Seleccione entradas para formar el valor del Activo Fijo");
                Tsaldos.Focus();
                return;
            }
            //fin validacion
            int valorAF, valor_uni, diferencia;

            valorAF    = int.Parse(LvalorAF.Text.Replace(sMil, ""));
            valor_uni  = (int)(valorAF / cantidad);
            diferencia = valorAF - (valor_uni * cantidad);
            //form_ingreso.Show();
            //Me.Hide()
            var nextStep = new ingreso();

            nextStep.ShowFrom(this);
            nextStep.LoadOBC(valorAF, cantidad, GetSalidasBinding());
            //nextStep.LoadOBC(valor_uni, cantidad, diferencia, GetSalidasBinding());
            //this.Close();
        }
Exemple #3
0
 private bool validar_campos()
 {
     //validar información ingresada
     if (Tdescrip.Text.Trim() == string.Empty)
     {
         P.Mensaje.Advert("Debe indicar la descripción del Activo Fijo");   //, MessageBoxButtons.OK
         Tdescrip.Focus();
         return(false);
     }
     if (cboZona.SelectedIndex == -1)
     {
         P.Mensaje.Advert("Debe indicar la zona del Activo Fijo");
         cboZona.Focus();
         return(false);
     }
     if (cboSubzona.SelectedIndex == -1)
     {
         P.Mensaje.Advert("Debe indicar una subzona para el Activo Fijo");
         cboSubzona.Focus();
         return(false);
     }
     if (cboClase.SelectedIndex == -1)
     {
         P.Mensaje.Advert("Debe indicar la clase del Activo Fijo");
         cboClase.Focus();
         return(false);
     }
     if (cboSubclase.SelectedIndex == -1)
     {
         P.Mensaje.Advert("Debe indicar una subclase para el Activo Fijo");
         cboSubclase.Focus();
         return(false);
     }
     if (cboCateg.SelectedIndex == -1)
     {
         P.Mensaje.Advert("Debe indicar el proveedor del Activo Fijo");
         cboCateg.Focus();
         return(false);
     }
     if (cboGestion.SelectedIndex == -1)
     {
         P.Mensaje.Advert("Debe indicar la gestion del Activo Fijo");
         cboGestion.Focus();
         return(false);
     }
     if (Tcantidad.Text == string.Empty)
     {
         P.Mensaje.Advert("Debe indicar la cantidad de artículos");
         Tcantidad.Focus();
         return(false);
     }
     if (Tprecio_compra.Text == string.Empty)
     {
         P.Mensaje.Advert("Debe indicar el precio de adquisición del Activo Fijo");
         Tprecio_compra.Focus();
         return(false);
     }
     if (TvuF.Text == string.Empty)
     {
         P.Mensaje.Advert("Debe indicar la vida útil del artículo");
         TvuF.Focus();
         return(false);
     }
     if (Tdoc.Text == string.Empty)
     {
         DialogResult eleccion = P.Mensaje.Confirmar("Desea continuar sin indicar el Nº de documento del Activo Fijo");
         if (eleccion != DialogResult.Yes)
         {  //no marco SI
             Tdoc.Focus();
             return(false);
         }
     }
     if (cbFecha_ing.SelectedIndex == -1)
     {
         P.Mensaje.Advert("Debe indicar el periodo contable del Activo Fijo");
         cbFecha_ing.Focus();
         return(false);
     }
     //fin validación
     return(true);
 }