コード例 #1
0
        private void BAceptar_Click(object sender, EventArgs e)
        {
            ape = textBox2.Text;
            nombre = BM.Text;
            if (NDoc.Text != "")
            {
                nro_doc = int.Parse(NDoc.Text);
            }
            meil = Email.Text;

            Cliente cliente = new Cliente();

            Decimal usuariocodigo = RepositorioCliente.Instance.BuscarCliente(ape, nombre, nro_doc,
                                                            meil, tipo_docu);
            if (usuariocodigo == -1)
            {
                //new MostrarCliMod(ape, nombre, nro_doc, meil, tipo_docu).ShowDialog(this);
                new Muchos().ShowDialog(this);
            }
            else if (usuariocodigo == -2)
            {
                new NoExisteUsuario().ShowDialog(this);
            }
            else
            {
                new ModificarCli(usuariocodigo).ShowDialog(this);
                this.Close();
            }
        }
        private void Aceptar_Click(object sender, EventArgs e)
        {
            Decimal cerrar = 0;

            if (calle.Text == "" && cerrar == 0)
            {
                cerrar = 1;
                new TodosLosCampos().ShowDialog(this);
            }
            if (telefono.Text == "" && cerrar == 0)
            {
                cerrar = 1;
                new TodosLosCampos().ShowDialog(this);
            }
            if (nombre.Text == "" && cerrar == 0)
            {
                cerrar = 1;
                new TodosLosCampos().ShowDialog(this);
            }
            if (apellido.Text == "" && cerrar == 0)
            {
                cerrar = 1;
                new TodosLosCampos().ShowDialog(this);
            }
            if (documento.Text == "" && cerrar == 0)
            {
                cerrar = 1;
                new TodosLosCampos().ShowDialog(this);
            }
            if (cod_pos.Text == "" && cerrar == 0)
            {
                cerrar = 1;
                new TodosLosCampos().ShowDialog(this);
            }
            if (piso.Text == "" && cerrar == 0)
            {
                cerrar = 1;
                new TodosLosCampos().ShowDialog(this);
            }
            if (altura.Text == "" && cerrar == 0)
            {
                cerrar = 1;
                new TodosLosCampos().ShowDialog(this);
            }
            if (localidad.Text == "" && cerrar == 0)
            {
                cerrar = 1;
                new TodosLosCampos().ShowDialog(this);
            }
            if (ciudad.Text == "" && cerrar == 0)
            {
                cerrar = 1;
                new TodosLosCampos().ShowDialog(this);
            }
            if (mail.Text == "" && cerrar == 0)
            {
                cerrar = 1;
                new TodosLosCampos().ShowDialog(this);
            }
            if (Sexo.Text == "" && cerrar == 0)
            {
                cerrar = 1;
                new TodosLosCampos().ShowDialog(this);
            }
            if (departamento.Text == "" && cerrar == 0)
            {
                cerrar = 1;
                new TodosLosCampos().ShowDialog(this);
            }
            if (cerrar == 0)
            {
                cerrar = this.buscarDoc(documento.Text);
            }
            if (cerrar == 0)
            {
                cerrar = this.buscarTel(telefono.Text);
            }

            if (cerrar == 0)
            {
                call = calle.Text;
                telef = int.Parse(telefono.Text);
                nomb = nombre.Text;
                ape = apellido.Text;
                nro_doc = int.Parse(documento.Text);
                codpos = int.Parse(cod_pos.Text);
                pis = int.Parse(piso.Text);
                altu = int.Parse(altura.Text);
                loc = localidad.Text;
                ciud = ciudad.Text;
                meil = mail.Text;
                sex = Char.Parse(Sexo.Text);
                puert = departamento.Text;
                f_nac = dateTimePicker1.Value;

                Cliente clie = new Cliente(tipo_docu, nro_doc, nomb,
                                            ape, f_nac, sex, meil, telef, ciud, loc, call,
                                            altu, pis, codpos, puert);

                //encriptar password
                RepositorioCliente.Instance.InsertarCliente(clie);

                new UsuarioYPassCliente().ShowDialog(this);
                this.Close();
            }
        }
コード例 #3
0
        private void ModificarCli_Load(object sender, EventArgs e)
        {
            cliente = RepositorioCliente.Instance.BuscarClientePorClave(userId);

            if (cliente.tipo_doc == "dni")
            {
                CBcedula.Enabled = true;
                CBdni.Enabled = false;
            }
            else
            {
                CBcedula.Enabled = false;
                CBdni.Enabled = true;
            }

            documento.Text = cliente.nro_doc.ToString();
            docum = cliente.nro_doc.ToString();
            cod_pos.Text = cliente.codpos.ToString();
            departamento.Text = cliente.puert;
            piso.Text = cliente.pis.ToString();
            altura.Text = cliente.altu.ToString();
            calle.Text = cliente.call;
            localidad.Text = cliente.loc;
            ciudad.Text = cliente.ciud;
            mail.Text = cliente.mail;
            telefono.Text = cliente.telefono.ToString();
            telefo = cliente.telefono.ToString();
            apellido.Text = cliente.apellido;
            nombre.Text = cliente.nombre;
        }