private bool ValidarModificar()
        {
            if (TextBox_nombre.Text.IsNullOrWhiteSpace())
            {
                MensajeEstado("Debe ingresar el nombre del proveedor a modificar", true, true);
                return(false);
            }

            if (TextBox_direccion.Text.IsNullOrWhiteSpace())
            {
                MensajeEstado("Debe ingresar la dirección del proveedor a modificar", true, true);
                return(false);
            }

            if (TextBox_telefono.Text.IsNullOrWhiteSpace())
            {
                MensajeEstado("Debe ingresar el teléfono del proveedor a modificar", true, true);
                return(false);
            }

            if (!VG.CadenaSoloNumeros(TextBox_telefono.Text))
            {
                MensajeEstado("Debe ingresar el teléfono valido", true, true);
                return(false);
            }

            if (!VG.CadenaSoloNumeros(TextBox_codigo.Text))
            {
                MensajeEstado("Debe ingresar un código valido", true, true);
                return(false);
            }

            return(true);
        }
コード例 #2
0
        protected async void btnEliminar_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(TextBox_codigo.Text) &&
                VG.CadenaSoloNumeros(TextBox_codigo.Text))
            {
                string codigoEliminado = string.Empty;
                string codigoElemento  = string.Empty;

                codigoElemento = TextBox_codigo.Text;

                codigoEliminado =
                    await modelosManager.Eliminar(codigoElemento, VG.usuarioActual.CadenaToken);

                if (!string.IsNullOrEmpty(codigoEliminado))
                {
                    MensajeEstado("Registro ha sido eliminado correctamente", false, true);
                    InicializarControles();
                }
                else
                {
                    MensajeEstado("El registro no puede ser eliminado. (Registry does not exist or foreign key constraint)", true, true);
                }
            }
            else
            {
                MensajeEstado("Debe ingresar el código para eliminar un registro", true, true);
            }
        }
コード例 #3
0
        async protected void btnEliminar_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtCodigo.Text) &&
                VG.CadenaSoloNumeros(txtCodigo.Text))
            {
                string codigoHotelEliminado = string.Empty;
                string codigoHotel          = string.Empty;

                codigoHotel = txtCodigo.Text;

                codigoHotelEliminado =
                    await hotelManager.Eliminar(codigoHotel, VG.usuarioActual.CadenaToken);

                if (!string.IsNullOrEmpty(codigoHotelEliminado))
                {
                    lblStatus.Text    = "Hotel eliminado correctamente";
                    lblStatus.Visible = true;
                    InicializarControles();
                }
                else
                {
                    lblStatus.Text      = "Hubo un error al eliminar el hotel";
                    lblStatus.ForeColor = Color.Maroon;
                    lblStatus.Visible   = true;
                }
            }
            else
            {
                lblStatus.Text      = "Debe ingresar el código del hotel";
                lblStatus.ForeColor = Color.Maroon;
                lblStatus.Visible   = true;
            }
        }
コード例 #4
0
        private bool ValidarModificar()
        {
            if (txtCodigo.Text.IsNullOrWhiteSpace())
            {
                lblStatus.Text      = "Debe ingresar el codigo del hotel";
                lblStatus.ForeColor = Color.Maroon;
                lblStatus.Visible   = true;
                return(false);
            }

            if (txtNombre.Text.IsNullOrWhiteSpace())
            {
                lblStatus.Text      = "Debe ingresar el nombre del hotel";
                lblStatus.ForeColor = Color.Maroon;
                lblStatus.Visible   = true;
                return(false);
            }

            if (txtEmail.Text.IsNullOrWhiteSpace())
            {
                lblStatus.Text      = "Debe ingresar el email del hotel";
                lblStatus.ForeColor = Color.Maroon;
                lblStatus.Visible   = true;
                return(false);
            }

            if (txtDireccion.Text.IsNullOrWhiteSpace())
            {
                lblStatus.Text      = "Debe ingresar la direccion del hotel";
                lblStatus.ForeColor = Color.Maroon;
                lblStatus.Visible   = true;
                return(false);
            }

            if (txtTelefono.Text.IsNullOrWhiteSpace())
            {
                lblStatus.Text      = "Debe ingresar el telefono del hotel";
                lblStatus.ForeColor = Color.Maroon;
                lblStatus.Visible   = true;
                return(false);
            }

            if (!VG.CadenaSoloNumeros(txtTelefono.Text))
            {
                lblStatus.Text      = "Debe ingresar un telefono valido";
                lblStatus.ForeColor = Color.Maroon;
                lblStatus.Visible   = true;
                return(false);
            }

            if (!VG.CadenaSoloNumeros(txtCodigo.Text))
            {
                lblStatus.Text      = "Debe ingresar un código valido";
                lblStatus.ForeColor = Color.Maroon;
                lblStatus.Visible   = true;
                return(false);
            }

            return(true);
        }
コード例 #5
0
        private bool ValidarModificar()
        {
            if (TextBox_identificacion.Text.IsNullOrWhiteSpace())
            {
                MensajeEstado("Debe ingresar su número de identifiación", true, true);
                return(false);
            }

            if (TextBox_Nombre.Text.IsNullOrWhiteSpace())
            {
                MensajeEstado("Debe ingresar el nombre del usuario", true, true);
                return(false);
            }

            if (TextBox_primerApellido.Text.IsNullOrWhiteSpace())
            {
                MensajeEstado("Debe ingresar su primer apellido", true, true);
                return(false);
            }

            if (TextBox_segundoApellido.Text.IsNullOrWhiteSpace())
            {
                MensajeEstado("Debe ingresar su segundo apellido", true, true);
                return(false);
            }

            if (TextBox_direccion.Text.IsNullOrWhiteSpace())
            {
                MensajeEstado("Debe ingresar su dirección", true, true);
                return(false);
            }

            if (TextBox_telefono.Text.IsNullOrWhiteSpace())
            {
                MensajeEstado("Debe ingresar un número de teléfono", true, true);
                return(false);
            }

            if (!VG.CadenaSoloNumeros(TextBox_telefono.Text))
            {
                MensajeEstado("Debe ingresar el teléfono valido", true, true);
                return(false);
            }

            if (!VG.CadenaSoloNumeros(TextBox_identificacion.Text))
            {
                MensajeEstado("Debe ingresar un código valido", true, true);
                return(false);
            }

            return(true);
        }
コード例 #6
0
        private bool ValidarInsertar()
        {
            if (DropDownList_marca.SelectedValue.ToString().Equals("seleccionar"))
            {
                MensajeEstado("Debe seleccionar una marca", true, true);
                return(false);
            }

            if (DropDownList_modelo.SelectedValue.ToString().Equals("seleccionar"))
            {
                MensajeEstado("Debe seleccionar un modelo", true, true);
                return(false);
            }

            if (DropDownList_combustible.SelectedValue.ToString().Equals("seleccionar"))
            {
                MensajeEstado("Debe seleccionar un combustible", true, true);
                return(false);
            }

            if (DropDownList_sucursal.SelectedValue.ToString().Equals("seleccionar"))
            {
                MensajeEstado("Debe seleccionar una sucursal", true, true);
                return(false);
            }

            if (TextBox_cantidad.Text.IsNullOrWhiteSpace())
            {
                MensajeEstado("Debe ingresar la cantidad de autos en posesión", true, true);
                return(false);
            }

            if (!VG.CadenaSoloNumeros(TextBox_cantidad.Text))
            {
                MensajeEstado("Debe introducir una cantidad de autos valida", true, true);
                return(false);
            }

            if (TextBox_precio.Text.IsNullOrWhiteSpace())
            {
                MensajeEstado("Debe ingresar el precio del auto para guardar", true, true);
                return(false);
            }

            if (!VG.CadenaSoloNumeros(TextBox_precio.Text))
            {
                MensajeEstado("Debe introducir un precio valido", true, true);
                return(false);
            }

            return(true);
        }
コード例 #7
0
        private bool ValidarModificar()
        {
            if (TextBox_nombre.Text.IsNullOrWhiteSpace())
            {
                MensajeEstado("Debe ingresar el nombre de la sucurcal a modificar", true, true);
                return(false);
            }

            if (TextBox_direccion.Text.IsNullOrWhiteSpace())
            {
                MensajeEstado("Debe ingresar la dirección de la sucursal a modificar", true, true);
                return(false);
            }

            if (TextBox_telefono.Text.IsNullOrWhiteSpace())
            {
                MensajeEstado("Debe ingresar el teléfono de la sucursal a guardar", true, true);
                return(false);
            }

            if (!VG.CadenaSoloNumeros(TextBox_telefono.Text))
            {
                MensajeEstado("Debe ingresar el teléfono valido", true, true);
                return(false);
            }

            if (DropDownList_proveedor.SelectedValue.ToString().Equals("seleccionar"))
            {
                MensajeEstado("Debe seleccionar un proveedor", true, true);
                return(false);
            }

            if (DropDownList_gerente.SelectedValue.ToString().Equals("seleccionar"))
            {
                MensajeEstado("Debe seleccionar un gerente", true, true);
                return(false);
            }

            if (!VG.CadenaSoloNumeros(TextBox_codigo.Text))
            {
                MensajeEstado("Debe ingresar un código valido", true, true);
                return(false);
            }

            return(true);
        }
コード例 #8
0
        private bool ValidarInsertar()
        {
            if (TextBox_nombre.Text.IsNullOrWhiteSpace())
            {
                MensajeEstado("Debe ingresar el nombre del empleado a guardar", true, true);
                return(false);
            }

            if (TextBox_direccion.Text.IsNullOrWhiteSpace())
            {
                MensajeEstado("Debe ingresar la dirección del empleado a guardar", true, true);
                return(false);
            }

            if (TextBox_telefono.Text.IsNullOrWhiteSpace())
            {
                MensajeEstado("Debe ingresar el teléfono del empleado a guardar", true, true);
                return(false);
            }

            if (!VG.CadenaSoloNumeros(TextBox_telefono.Text))
            {
                MensajeEstado("Debe ingresar el teléfono valido", true, true);
                return(false);
            }

            if (TextBox_primerApellido.Text.IsNullOrWhiteSpace())
            {
                MensajeEstado("Debe ingresar el apellido paterno del empleado a guardar", true, true);
                return(false);
            }

            if (TextBox_segundoApellido.Text.IsNullOrWhiteSpace())
            {
                MensajeEstado("Debe ingresar el apellido materno del empleado a guardar", true, true);
                return(false);
            }

            return(true);
        }
コード例 #9
0
        private bool ValidarModificar()
        {
            if (TextBox_combustible.Text.IsNullOrWhiteSpace())
            {
                MensajeEstado("Debe ingresar el nombre del combustible a modificar", true, true);
                return(false);
            }

            if (!VG.CadenaSoloNumeros(TextBox_codigo.Text))
            {
                MensajeEstado("Debe ingresar un código valido", true, true);
                return(false);
            }

            if (TextBox_codigo.Text.IsNullOrWhiteSpace())
            {
                MensajeEstado("Debe ingresar el código del combustible a modificar", true, true);
                return(false);
            }

            return(true);
        }
コード例 #10
0
        private bool ValidarModificar()
        {
            if (DropDownList_auto.SelectedValue.ToString().Equals("seleccionar"))
            {
                MensajeEstado("Debe seleccionar un auto", true, true);
                return(false);
            }

            if (DropDownList_empleado.SelectedValue.ToString().Equals("seleccionar"))
            {
                MensajeEstado("Debe seleccionar un empleado", true, true);
                return(false);
            }

            if (TextBox_descripcion.Text.IsNullOrWhiteSpace())
            {
                MensajeEstado("Debe ingresar una descripción a al renta", true, true);
                return(false);
            }

            if (TextBox_cantidadRenta.Text.IsNullOrWhiteSpace())
            {
                MensajeEstado("Debe ingresar la cantidad de vehiculos a rentar", true, true);
                return(false);
            }

            if (!VG.CadenaSoloNumeros(TextBox_cantidadRenta.Text))
            {
                MensajeEstado("Debe introducir una cantidad de renta valida", true, true);
                return(false);
            }

            if (TextBox_precio.Text.IsNullOrWhiteSpace())
            {
                MensajeEstado("Debe ingresar el precio de la renta", true, true);
                return(false);
            }

            if (!VG.CadenaSoloNumeros(TextBox_precio.Text))
            {
                MensajeEstado("Debe introducir la cantidad del precio de forma valida", true, true);
                return(false);
            }

            if (Calendar_FechaRetiro.SelectedDate.Date == DateTime.MinValue)
            {
                MensajeEstado("Debe ingresar una fecha de retiro del auto.", true, true);
                return(false);
            }

            if (Calendar_FechaRetorno.SelectedDate.Date == DateTime.MinValue)
            {
                MensajeEstado("Debe ingresar una fecha de retorno del auto.", true, true);
                return(false);
            }

            if (!VG.CadenaSoloNumeros(TextBox_codigo.Text))
            {
                MensajeEstado("Debe ingresar un código valido", true, true);
                return(false);
            }

            return(true);
        }