Example #1
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            if (!hasEmptytxt())
            {
                try
                {
                    BL_Cliente client = new BL_Cliente();
                    client.Cedula   = TextBox1.Text;
                    client.Nombre   = TextBox2.Text;
                    client.Apellido = TextBox3.Text;
                    client.Correo   = TextBox4.Text;
                    client.Telefono = TextBox5.Text;

                    client.insertClient();

                    clearTxtbx();
                    lblError.Text = "El cliente se ha ingresado correctamente";
                }
                catch (Exception)
                {
                    clearTxtbx();
                    lblError.Text = "La cedula ingresada ya pertenece a un cliente ingresado, ingrese una cedula diferente";
                }
            }
            else
            {
                clearTxtbx();
                lblError.Text = "Los campos de texto no deben estar sin texto";
            }
        }