Esempio n. 1
0
        private bool ValidateData()
        {
            if (String.IsNullOrWhiteSpace(TxNombre.Text))
            {
                MessageBox.Show("Debe ingresar el nombre del empleado.");
                TxNombre.Focus();
                return(false);
            }

            if (String.IsNullOrWhiteSpace(TxApellido.Text))
            {
                MessageBox.Show("Debe ingresar el apellido del empleado.");
                TxApellido.Focus();
                return(false);
            }

            if (String.IsNullOrWhiteSpace(TxEmail.Text))
            {
                MessageBox.Show("Debe ingresar el email del empleado.");
                TxEmail.Focus();
                return(false);
            }

            if (String.IsNullOrWhiteSpace(TxClave.Text))
            {
                MessageBox.Show("Debe ingresar la clave del empleado.");
                TxClave.Focus();
                return(false);
            }

            if (comboTanda.SelectedIndex == -1)
            {
                MessageBox.Show("Debe seleccionar la tanda del empleado.");
                comboTanda.Focus();
                return(false);
            }

            if (String.IsNullOrWhiteSpace(TxPorcientoComision.Text))
            {
                MessageBox.Show("Debe ingresar el porciento de comision del empleado.");
                TxPorcientoComision.Focus();
                return(false);
            }

            if (String.IsNullOrWhiteSpace(DPFechaIngreso.Text))
            {
                MessageBox.Show("Debe ingresar la fecha de ingreso del empleado.");
                DPFechaIngreso.Focus();
                return(false);
            }

            if (comboTipoEmpleado.SelectedIndex == -1)
            {
                MessageBox.Show("Debe seleccionar el tipo de empleado.");
                comboTipoEmpleado.Focus();
                return(false);
            }

            return(true);
        }
Esempio n. 2
0
 private bool ValidateData()
 {
     if (String.IsNullOrWhiteSpace(TxNombre.Text))
     {
         MessageBox.Show("Debe ingresar el tipo de vehiculo.");
         TxNombre.Focus();
         return(false);
     }
     return(true);
 }
 private bool ValidateData()
 {
     if (String.IsNullOrWhiteSpace(TxNombre.Text))
     {
         MessageBox.Show("Debe ingresar el tipo de combustible.");
         TxNombre.Focus();
         return false;
     }
     return true;
 }
        private bool ValidateData()
        {
            if (String.IsNullOrWhiteSpace(TxNombre.Text))
            {
                MessageBox.Show("Debe ingresar el modelo del vehiculo.");
                TxNombre.Focus();
                return(false);
            }

            if (comboMarca.SelectedIndex == -1)
            {
                MessageBox.Show("Debe seleccionar la marca del vehiculo.");
                comboMarca.Focus();
                return(false);
            }

            return(true);
        }
        protected void TxBusqueda_TextChanged(object sender, EventArgs e)
        {
            try{
                if (TxBusqueda.Text != "" || TxBusqueda.Text != string.Empty)
                {
                    String    vQuery        = "[RSP_Seguridad] 16,'" + TxBusqueda.Text + "'";
                    DataTable vVerificacion = vConexion.obtenerDataTable(vQuery);
                    if (vVerificacion.Rows.Count > 0)
                    {
                        TxBusqueda.Focus();
                        limpiarFormulario();
                        Mensaje("El número de serie tiene una entrada pendiente. Favor ingrese otro.", WarningType.Warning);
                    }
                    else
                    {
                        vQuery = "[RSP_Seguridad] 21,'" + TxBusqueda.Text + "'";
                        DataTable vDatos1 = vConexion.obtenerDataTable(vQuery);
                        if (vDatos1.Rows.Count > 0)
                        {
                            LbAprobacion.Text = "Aprobado!";
                            LbAprobacion.Attributes.CssStyle.Value = "color:Green; margin-top:100px; margin-left:20px;";

                            //divAutorizado.Visible = false;
                            Session["SEC_APROBACION_SALIDA"] = vDatos1;
                        }
                        else
                        {
                            LbAprobacion.Text = "No Aprobado!";
                            LbAprobacion.Attributes.CssStyle.Value = "color:Tomato; margin-bottom:10px; margin-left:20px;";
                            //divAutorizado.Visible = true;
                        }
                        LbAprobacion.Visible = true;

                        vQuery = "[RSP_Seguridad] 6,'" + TxBusqueda.Text + "'";
                        DataTable vDatos = vConexion.obtenerDataTable(vQuery);
                        if (vDatos.Rows.Count > 0)
                        {
                            Session["ID_ENTRADA"] = vDatos.Rows[0]["id"].ToString();

                            DivEntradas.Visible      = true;
                            LbIdEntrada.Text         = vDatos.Rows[0]["id"].ToString();
                            LbNombreEntrada.Text     = vDatos.Rows[0]["nombre"].ToString();
                            LbArticuloEntrada.Text   = vDatos.Rows[0]["articulo"].ToString();
                            LbSerieEntrada.Text      = vDatos.Rows[0]["serie"].ToString();
                            LbInventarioEntrada.Text = vDatos.Rows[0]["inventario"].ToString();
                            LbFechaEntrada.Text      = vDatos.Rows[0]["fechaEntrada"].ToString();

                            TxInventario.Text         = vDatos.Rows[0]["inventario"].ToString();
                            DDLArticulo.SelectedValue = vDatos.Rows[0]["idArticulo"].ToString();

                            DivBody.Visible   = true;
                            TxMensaje.Text    = "";
                            TxMensaje.Visible = false;
                            UpdatePanel1.Update();
                        }
                        else
                        {
                            TxInventario.Text         = string.Empty;
                            DDLArticulo.SelectedIndex = -1;
                            Session["ID_ENTRADA"]     = null;
                            DivEntradas.Visible       = false;
                            DivBody.Visible           = false;
                            TxMensaje.Visible         = true;
                            TxMensaje.Text            = LbAprobacion.Text == "Aprobado!" ? "Cree un nuevo registro." : string.Empty;
                            UpdatePanel1.Update();
                        }
                        TxNombre.Focus();
                        TxSerie.Text = TxBusqueda.Text;
                    }
                    UpdatePanel2.Update();
                }
                else
                {
                    limpiarFormulario();
                }
            }catch (Exception ex) {
                Mensaje(ex.Message, WarningType.Danger);
            }
        }
Esempio n. 6
0
        protected void TxBusqueda_TextChanged(object sender, EventArgs e)
        {
            try{
                if (TxBusqueda.Text != "" || TxBusqueda.Text != string.Empty)
                {
                    String    vQuery        = "[RSP_Seguridad] 15,'" + TxBusqueda.Text + "'";
                    DataTable vVerificacion = vConexion.obtenerDataTable(vQuery);
                    if (vVerificacion.Rows.Count > 0)
                    {
                        TxBusqueda.Focus();
                        limpiarFormulario();
                        Mensaje("El número de serie tiene una salida pendiente. Favor ingrese otro.", WarningType.Warning);
                    }
                    else
                    {
                        vQuery = "[RSP_Seguridad] 8,'" + TxBusqueda.Text + "'";
                        DataTable vDatos = vConexion.obtenerDataTable(vQuery);
                        if (vDatos.Rows.Count > 0)
                        {
                            Session["ID_SALIDA"] = vDatos.Rows[0]["id"].ToString();

                            DivSalidas.Visible      = true;
                            LbIdSalida.Text         = vDatos.Rows[0]["id"].ToString();
                            LbNombreSalida.Text     = vDatos.Rows[0]["nombreSalida"].ToString();
                            LbSerieSalida.Text      = vDatos.Rows[0]["serie"].ToString();
                            LbArticuloSalida.Text   = vDatos.Rows[0]["articulo"].ToString();
                            LbInventarioSalida.Text = vDatos.Rows[0]["inventario"].ToString();
                            LbFechaSalida.Text      = vDatos.Rows[0]["fechaSalida"].ToString();

                            TxInventario.Text          = vDatos.Rows[0]["inventario"].ToString();
                            DDLArticulos.SelectedValue = vDatos.Rows[0]["idArticulo"].ToString();

                            DivBody.Visible   = true;
                            TxMensaje.Text    = "";
                            TxMensaje.Visible = false;
                            UpdatePanel1.Update();
                        }
                        else
                        {
                            TxInventario.Text          = string.Empty;
                            DDLArticulos.SelectedIndex = -1;
                            Session["ID_SALIDA"]       = null;
                            DivSalidas.Visible         = false;
                            DivBody.Visible            = false;
                            TxMensaje.Visible          = true;
                            TxMensaje.Text             = "Cree un nuevo registro.";
                            UpdatePanel1.Update();
                        }
                        TxNombre.Focus();
                        TxSerie.Text = TxBusqueda.Text;
                    }
                    UpdatePanel2.Update();
                }
                else
                {
                    limpiarFormulario();
                }
            }catch (Exception ex) {
                Mensaje(ex.Message, WarningType.Danger);
            }
        }