コード例 #1
0
        protected void SearchButton_Click(object sender, EventArgs e)
        {
            Solicitudes so = new Solicitudes();

            so.Buscar(Convert.ToInt32(IdTextBox.Text));
            Limpar();
            LlenarCampos(so);
        }
コード例 #2
0
 protected void BuscarButton_Click1(object sender, EventArgs e)
 {
     if (IdTextBox.Text == "")
     {
         Response.Write("<script>Alert('Introdusca el ID')</script>");
     }
     if (IdTextBox.Text.Length > 0)
     {
         if (solicitud.Buscar(Id(IdTextBox.Text)))
         {
             LlenarCampos(solicitud);
         }
         else
         {
             Response.Write("<script>Alert('Id no existe')</script>");
         }
     }
     else
     {
         Response.Write("<script>Alert('Id no Encontrado.')</script>");
     }
 }
コード例 #3
0
 protected void EliminarButton_Click(object sender, EventArgs e)
 {
     try
     {
         ObtenerDatos();
         if (sol.Buscar(sol.SolicitudlId))
         {
             if (sol.Eliminar())
             {
                 Limpiar();
             }
             else
             {
                 Response.Write("<script>alert('error')</script>");
             }
         }
     }
     catch (Exception)
     {
         Response.Write("<script>alert('error')</script>");
     }
 }
コード例 #4
0
        protected void BuscarButton_Click(object sender, EventArgs e)
        {
            int id = ConvertirId();

            if (string.IsNullOrEmpty(IdTextBox.Text))
            {
                Response.Write("<script>alert('Debe insertar un Id')</script>");
            }
            else
            {
                sol.Buscar(id);
                LLamarValores();
            }
        }
コード例 #5
0
        protected void IdButton_Click(object sender, EventArgs e)
        {
            int id = 0;

            int.TryParse(IdTextBox.Text, out id);
            if (IdTextBox.Text == "")
            {
                Response.Write("<script>alert('Introdusca el Id Campos')</script>");
            }
            else
            {
                sol.Buscar(id);
                LlenarValores();
            }
        }
コード例 #6
0
        protected void BuscarButton_Click(object sender, EventArgs e)
        {
            int  Id      = 0;
            bool retorno = true;

            ValidacionLimpiar();

            if (!Seguridad.ValidarSoloNumero(SolicitudIdTextBox.Text))
            {
                Mensajes.ShowToastr(this, "Error", "Id de Solicitud Invalido", "Error");
                SolicitudIdDiv.Attributes.Add("class", " col-md-8 has-error ");
                retorno = false;
            }

            if (retorno)
            {
                Id = Seguridad.ValidarEntero(SolicitudIdTextBox.Text);
            }

            if (Id > 0)
            {
                if (Solicitud.Buscar(Id))
                {
                    LlenarForm();
                    EliminarButton.Visible = true;
                    GuardarButton.Text     = "Modificar";
                }
                else
                {
                    Mensajes.ShowToastr(this.Page, "No hay Registro", "Informacion", "info");
                    Limpiar();
                }
            }
            else
            {
                Mensajes.ShowToastr(this.Page, "Ingrese un Id valido primero", "Error", "Error");
            }
        }