예제 #1
0
        override public void CargarClienteCompartido(ClienteEN cliente)
        {
            clienteCompartido = cliente;

            if (clienteCompartido != null)
            {
                f_cliente.controller.cargarDatosCliente(clienteCompartido);
                f_cliente.changeState(Utils.State.MODIFY);

                f_mascota.controller.cargarDatosCliente(clienteCompartido);
                f_mascota.changeState(Utils.State.MODIFY, null);

                f_consulta.controller.cargarDatosCliente(clienteCompartido);
                f_consulta.changeState(Utils.State.NEW, null);

                f_factura.controller.cargarDatosCliente(clienteCompartido);
                f_factura.changeState(Utils.State.MODIFY);
            }
            else
            {
                f_cliente.controller.ClearForm();
                f_mascota.controller.ClearForm();
                f_consulta.controller.ClearForm();
                f_factura.controller.ClearForm();
            }
        }
예제 #2
0
        public void cargarDatosCliente(ClienteEN cliente)
        {
            clienteEN = cliente;

            if (clienteEN != null)
            {
                form.changeState(Utils.State.MODIFY);
                form.text_dni.Text       = clienteEN.DNI;
                form.text_nombre.Text    = clienteEN.Nombre;
                form.text_apellidos.Text = clienteEN.Apellidos;
                form.text_direccion.Text = clienteEN.Direccion;
                form.text_provincia.Text = clienteEN.Provincia;
                form.text_localidad.Text = clienteEN.Localidad;
                form.text_cp.Text        = clienteEN.Cp;
                form.text_telefono.Text  = clienteEN.Telefono;

                //Cargamos la imagen
                try
                {
                    System.IO.FileStream fs = new System.IO.FileStream(Environment.CurrentDirectory + @"\" + clienteEN.DNI + ".png", System.IO.FileMode.Open);
                    form.log_photo.Image    = Image.FromStream(fs);
                    form.log_photo.SizeMode = PictureBoxSizeMode.StretchImage;
                    fs.Close();
                }
                catch (Exception ex)
                {
                    System.IO.FileStream fs = new System.IO.FileStream(Environment.CurrentDirectory + @"\sinFoto.png", System.IO.FileMode.Open);
                    form.log_photo.Image = Image.FromStream(fs);
                    fs.Close();
                }

                Buscar();
            }
        }