private void button8_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(textBox1.Text) == true || string.IsNullOrWhiteSpace(textBox2.Text) == true || string.IsNullOrWhiteSpace(textBox3.Text) == true || string.IsNullOrWhiteSpace(maskedTextBox1.Text) == true || string.IsNullOrWhiteSpace(textBox6.Text) == true)
            {
                MessageBox.Show("No se permiten campos vacios");
            }

            else
            {
                string Query = "select *from Contactos where Rtn= " + textBox1.Text + "";

                contactos cl = new contactos();
                if (cl.Buscar(Query) == true)
                {
                    MessageBox.Show("Rtn ya existe");
                }
                else
                {
                    string cadenasql = "insert  into Contactos  values ('" + textBox2.Text + "', '" + textBox3.Text + "','" + maskedTextBox1.Text + "', " + 16 + ", " + int.Parse(textBox6.Text) + ", " + int.Parse(textBox1.Text) + ", " + 1 + ")";
                    contactos.insetarCon(cadenasql);
                    textBox1.Clear();
                    textBox2.Clear();
                    textBox3.Clear();
                    textBox5.Clear();
                    textBox6.Clear();
                    textBox1.Clear();
                    maskedTextBox1.Clear();
                    this.Hide();
                    clientes clifrm = new clientes();
                    clifrm.Show();
                }
            }
        }
        private void button8_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(txtrtnid.Text) == true || string.IsNullOrWhiteSpace(txtnom.Text) == true || string.IsNullOrWhiteSpace(txtdirec.Text) == true || string.IsNullOrWhiteSpace(comboBox1.Text) == true)
            {
                MessageBox.Show("No se permiten campos vacios");
            }

            else
            {
                string Query = "select *from CLIENTE where [RTN/ID]= " + txtrtnid.Text + "";

                contactos cl = new contactos();
                if (cl.Buscar(Query) == true)
                {
                    MessageBox.Show("Rtn ya existe");
                }
                else
                {
                    string idtype = "select IDType from IDTypes where Descripcion = '" + comboBox1.Text + "'";
                    int    idbd   = 0;
                    idbd = clients.idtypecheck(idtype);

                    string cadenasql = "insert  into CLIENTE values (" + txtrtnid.Text + ", '" + txtnom.Text + "', '" + txtdirec.Text + "', " + 16 + ", " + idbd + ");";
                    clients.insetarclien(cadenasql);
                    txtdirec.Clear();
                    txtnom.Clear();
                    txtrtnid.Clear();
                    comboBox1.Text = " ";
                    this.Hide();
                    clientes clifrm = new clientes();
                    clifrm.Show();
                }
            }
        }
Exemplo n.º 3
0
        private void btnsave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(txteid.Text) == true || string.IsNullOrWhiteSpace(txtertnid.Text) == true || string.IsNullOrWhiteSpace(txtenom.Text) == true || string.IsNullOrWhiteSpace(txtedirec.Text) == true)
            {
                MessageBox.Show("No se permiten campos vacios");
            }
            else
            {
                string idtype = "select IDType from IDTypes where Descripcion = '" + comboBox1.Text + "'";
                int    idbd   = 0;
                idbd = clients.idtypecheck(idtype);


                if (radioButton1.Checked == true)
                {
                    MessageBox.Show(cli.edit((Convert.ToInt32(txteid.Text)), (Convert.ToInt32(txtertnid.Text)), txtenom.Text, txtedirec.Text, 16, idbd));
                }

                if (radioButton2.Checked == true)
                {
                    MessageBox.Show(cli.edit((Convert.ToInt32(txteid.Text)), (Convert.ToInt32(txtertnid.Text)), txtenom.Text, txtedirec.Text, 17, idbd));
                }

                this.Hide();
                clientes clifrm = new clientes();
                clifrm.Show();
            }
        }
        private void button3_Click(object sender, EventArgs e)
        {
            //this.Hide();
            this.Hide();
            clientes clifrm = new clientes();

            clifrm.Show();
        }
Exemplo n.º 5
0
        private void button8_Click(object sender, EventArgs e)

        {
            if (string.IsNullOrWhiteSpace(textBox11.Text) == true || string.IsNullOrWhiteSpace(textBox22.Text) == true || string.IsNullOrWhiteSpace(textBox33.Text) == true || string.IsNullOrWhiteSpace(maskedTextBox11.Text) == true || string.IsNullOrWhiteSpace(textBox66.Text) == true)
            {
                MessageBox.Show("No se permiten campos vacios");
            }

            else
            {
                contactos co = new contactos();
                MessageBox.Show(co.edit((Convert.ToInt32(textBox11.Text)), textBox22.Text, textBox33.Text, maskedTextBox11.Text, 1, (Convert.ToInt32(textBox66.Text))));
                this.Hide();
                clientes clifrm = new clientes();
                clifrm.Show();
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            clientes frm3 = new clientes();

            frm3.Show();
        }