private ObjetoLibro CrearLibro() { ObjetoLibro libro = new ObjetoLibro(); libro.Titulo = txtTitulo.Text; libro.ISBN = txtISBN.Text; libro.Editorial = cboEditorial.Text; libro.Año = txtAño.Text; libro.Copias = Convert.ToInt16(numCopias.Value); libro.Numero = Convert.ToInt16(numEdicion.Value); libro.Tema = cboTema.Text; libro.Autor = txtCodAutor.Text; libro.Lugar = txtLugar.Text; if (pctImgLibro.Image != null) { libro.Imagen = ImagenAutor.ImageToBase64(pctImgLibro.Image, ImageFormat.Jpeg); } else { libro.Imagen = ""; } return(libro); }
private ObjetoAutor CrearAutor() { ObjetoAutor autor = new ObjetoAutor(); autor.Codigo = txtID.Text; autor.Nombres = txtNombres.Text; autor.Apellidos = txtApellidos.Text; autor.Pais = cboPais.Text; autor.Ciudad = txtCiudad.Text; autor.Comentarios = txtComentarios.Text; autor.Imagen = ImagenAutor.ImageToBase64(pictureBox1.Image, ImageFormat.Jpeg); return(autor); }
private ObjetoAutor CrearAutor(string location) { ObjetoAutor obj = new ObjetoAutor(); if (txtID.Text != "") { obj.Codigo = txtID.Text; } if (txtNombre.Text != "") { obj.Nombres = txtNombre.Text; } if (txtApellidos.Text != "") { obj.Apellidos = txtApellidos.Text; } if (chkDesconocido.CheckState == CheckState.Checked) { obj.Pais = "Desconocido"; } else { obj.Pais = cboCountry.Text; } if (txtCiudad.Text != "") { obj.Ciudad = txtCiudad.Text; } if (txtComentarios.Text != "") { obj.Comentarios = txtComentarios.Text; } if (pctAutor.Image != null) { obj.Imagen = ImagenAutor.ImageToBase64(pctAutor.Image, ImageFormat.Jpeg); } else { obj.Imagen = null; } return(obj); }
private void LoadAutor() { this.txtID.Text = Autor.Codigo; this.txtNombres.Text = Autor.Nombres; this.txtApellidos.Text = Autor.Apellidos; this.txtCiudad.Text = Autor.Ciudad; this.txtComentarios.Text = Autor.Comentarios; char[] separadores = { '[', ']', ',' }; string pais = Autor.Pais.Split(separadores)[1]; this.cboPais.SelectedRegion = new RegionInfo(pais); this.pictureBox1.Image = ImagenAutor.Base64ToImage(Autor.Imagen); }
private ObjetoMiembro crearMiembro() { ObjetoMiembro miembro = new ObjetoMiembro(); try { miembro.CURP = cURPTextBox.Text; miembro.Nombres = nombreTextBox.Text; miembro.Apellidos = apellidosTextBox.Text; miembro.Entidad = entidadComboBox.Text; miembro.Sexo = cboSexo.Text; miembro.Domicilio = domicilioTextBox.Text; if (pctUsuario.Image != null) { miembro.Imagen = ImagenAutor.ImageToBase64(pctUsuario.Image, ImageFormat.Jpeg); } else { miembro.Imagen = null; } if (nacimientoDateTimePicker.Value == DateTime.Today) { MessageBox.Show("Atencion!", "Por favor seleccione una fecha"); } else { DateTime fechaNac = nacimientoDateTimePicker.Value; string fecha = ($"{fechaNac.Month.ToString()}-{fechaNac.Day.ToString()}-{fechaNac.Year.ToString()}"); miembro.FechaNac = fecha; } return(miembro); } catch (System.NullReferenceException exception) { Console.WriteLine(exception.Message); return(null); } catch (Exception e) { Console.WriteLine(e.Message); return(null); } }