예제 #1
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            if (TextBox1.Text == "")
            {
                MessageBox.alert("No deje el campo vacio");
            }
            else
            {
                GridView1.DataBind();
                Docentes ObjDocente = new Docentes();


                try
                {
                    bool respuestaSQL = ObjDocente.CambiarEstado(TextBox1.Text);


                    if (respuestaSQL == true)
                    {
                        TextBox6.Text  = "";
                        TextBox18.Text = "";
                        TextBox19.Text = "";
                        TextBox2.Text  = "";
                        TextBox3.Text  = "";
                        TextBox5.Text  = "";
                        TextBox7.Text  = "";
                        TextBox8.Text  = "";
                        TextBox18.Text = "";
                        TextBox9.Text  = "";



                        Label1.Text  = "";
                        Label2.Text  = "";
                        Label3.Text  = "";
                        Label4.Text  = "";
                        Label5.Text  = "";
                        Label6.Text  = "";
                        Label7.Text  = "";
                        Label8.Text  = "";
                        Label9.Text  = "";
                        Label10.Text = "";


                        MessageBox.alert("El docente ha cambiado su estado a inactivo correctamente");
                    }
                    else
                    {
                        MessageBox.alert(ObjDocente.Mensaje);
                    }
                }

                catch (Exception Ex)
                {
                    MessageBox.alert("Error!: " + Ex.Message + " " + ObjDocente.Mensaje);
                }
            }
        }