private Cliente CargarCliente()
        {
            string nombre    = txtnombre.Text;
            string apellido  = txtapellido.Text;
            string direccion = txtdireccion.Text;
            string mail      = txtmail.Text;
            string telefono  = txttelefono.Text;

            bool     estado   = checkBox1.Checked;
            DateTime fechanac = dateTimePicker1.Value;

            string msj = "";

            msj += ValidacionesHelper.ValidarFecha(fechanac);
            msj += ValidacionesHelper.ValidarInt(txtdni.Text, "Dni");
            msj += ValidacionesHelper.ValidarSTRING(nombre, "Nombre");
            msj += ValidacionesHelper.ValidarSTRING(apellido, "Apellido");
            msj += ValidacionesHelper.ValidarSTRING(direccion, "Direccion");
            msj += ValidacionesHelper.ValidarSTRING(mail, "Email");
            msj += ValidacionesHelper.ValidarSTRING(telefono, "Telefono");

            if (!string.IsNullOrWhiteSpace(msj))
            {
                throw new Exception(msj.ToString());
            }
            int     dni     = int.Parse(txtdni.Text);
            Cliente cliente = new Cliente(dni, nombre, apellido, direccion, estado, mail, telefono, fechanac, _clienteServicio.ProximoId());

            return(cliente);
        }
Exemple #2
0
        private Cuenta CargarCuenta()
        {
            string  descripcion = (string)cmbdesc.SelectedItem;
            Cliente cliente     = (Cliente)cmbclienteagregar.SelectedItem;
            int     idcli       = cliente.Id;

            bool estado = checkBox1.Checked;

            string msj = "";

            msj += ValidacionesHelper.ValidarFloat(txtsaldo.Text, "Saldo");
            msj += ValidacionesHelper.ValidarInt(txtnumerocuenta.Text, "Numero de Cuenta");
            msj += ValidacionesHelper.ValidarSTRING(descripcion, "Descripcion");

            if (!string.IsNullOrWhiteSpace(msj))
            {
                throw new Exception(msj.ToString());
            }
            float  saldo     = float.Parse(txtsaldo.Text);
            int    nrocuenta = int.Parse(txtnumerocuenta.Text);
            Cuenta cuenta    = new Cuenta(cuentaServ.ProximoId(), nrocuenta, descripcion, idcli, estado, saldo);

            return(cuenta);
        }