Exemple #1
0
        private void btn_Guardar_Click(object sender, RoutedEventArgs e)
        {
            LibrosRef.Service1Client cliente = new LibrosRef.Service1Client();
            if (cmb_libros.SelectedIndex == -1)
            {
                if (txt_nombre.Text != "")
                {


                    cliente.NuevoEditorial(txt_nombre.Text.ToString(), txt_direccion.Text.ToString(), txt_estado.Text.ToString(), txt_pais.Text.ToString());
                    MessageBox.Show(" Guardado ");
                }
                else
                {
                    MessageBox.Show(" Faltan Datos ");
                }
            }
            else
            {
                if (txt_nombre.Text != "")
                {
                    string a = cmb_libros.SelectedValue.ToString();
                    int id = Convert.ToInt32(a);
                    cliente.EditaEditorial(id, txt_nombre.Text.ToString(), txt_direccion.Text.ToString(), txt_estado.Text.ToString(), txt_pais.Text.ToString());
                    MessageBox.Show(" Editado ");
                }
                else
                {
                    MessageBox.Show(" Faltan Datos ");
                }



            }
            txt_nombre.Text = "";
            txt_direccion.Text = "";
            txt_estado.Text = "";
            txt_pais.Text = "";
            banderaUpdate = 1;
            llenaCombo();

        }