private void btn_GuardarFoto_Click(object sender, EventArgs e) { using (var context = new lts_sindicatoDataContext()) { string destino = string.Empty; //@"D:\BackUp\SEC_Fotos_Afiliados\" + txtNombres.Text + ".Jpeg"; //picFoto.Image.Save(destino, ImageFormat.Jpeg); Image Imagen; convertir_imagen cnvImg = new convertir_imagen(); var fotos = from a in context.fotos.Where(x => x.FOTOS_CODFLIAR == 0)//.Take(100) //where a.FOTOS_CODFLIAR == 0 Take(10) select new { foto = a.FOTOS_FOTO, cuil = a.FOTOS_CUIL, tamaño = a.FOTOS_FOTO.Length, tamaño2 = a.FOTOS_FOTO.Length / 1024 //CnvImg.ByteArrayToImage(a.FOTOS_FOTO.ToArray()).Size.ToString() }; foreach (var item in fotos.ToList()) { Imagen = cnvImg.ByteArrayToImage(item.foto.ToArray()); destino = @"D:\BackUp\SEC_Fotos_Afiliados\" + item.cuil + ".Jpeg"; Bitmap newBmp = new Bitmap(Imagen); Imagen.Dispose(); newBmp.Save(destino, ImageFormat.Jpeg); } } }
private void dgv_titu_benef_SelectionChanged(object sender, EventArgs e) { socios soc = new socios(); convertir_imagen img = new convertir_imagen(); double Codigo_Fliar; //dgv_jugadores_inscriptos.CurrentRow.Cells["jugcuil"].Value Codigo_Fliar = Convert.ToDouble(dgv_titu_benef.CurrentRow.Cells["CodigoFliar"].Value); if (Codigo_Fliar > 0) { picbox_socio.Image = img.ByteArrayToImage(soc.get_foto_benef_binary(Codigo_Fliar).ToArray()); } else { if ((Codigo_Fliar == 0) && (Convert.ToInt32(dgv_titu_benef.CurrentRow.Cells["Exepcion"].Value) == 0)) // es por que es titular { picbox_socio.Image = img.ByteArrayToImage(soc.get_foto_titular_binary(_cuil).ToArray()); } else // Es por que es Exepcion { picbox_socio.Image = img.ByteArrayToImage(soc.get_foto_benef_binary(1).ToArray()); } } }
private void btn_CopiarFotos_Click(object sender, EventArgs e) { convertir_imagen cnvImg = new convertir_imagen(); Image fto; using (var context = new lts_sindicatoDataContext()) { var fotos = from a in context.fotos.Where(x => x.FOTOS_CODFLIAR > 0)//.Take(30) //where a.FOTOS_CODFLIAR == 0 Take(10) select a; if (fotos.Count() > 0) { lbl_Inicio.Text = DateTime.Now.ToLongTimeString(); foreach (var foto in fotos) { using (var context2 = new lts_sindicatoDataContext()) { fotos2 FotoInsert = new fotos2(); FotoInsert.FOTOS_CUIL = foto.FOTOS_CUIL; FotoInsert.FOTOS_CODFLIAR = foto.FOTOS_CODFLIAR; FotoInsert.FOTOS_FECHA = foto.FOTOS_FECHA; fto = cnvImg.ByteArrayToImage(foto.FOTOS_FOTO.ToArray()); FotoInsert.FOTOS_FOTO = cnvImg.ConvertImageToByteArray(fto); context2.fotos2.InsertOnSubmit(FotoInsert); context2.SubmitChanges(); } } lbl_Fin.Text = DateTime.Now.ToLongTimeString(); } } }
private void btn_GuardarFotoBenef_Click(object sender, EventArgs e) { using (var context = new lts_sindicatoDataContext()) { string PathCarpeta, PathFoto = string.Empty; //@"D:\BackUp\SEC_Fotos_Afiliados\" + txtNombres.Text + ".Jpeg"; //picFoto.Image.Save(destino, ImageFormat.Jpeg); Image Imagen; convertir_imagen cnvImg = new convertir_imagen(); var fotos = (from a in context.fotos//.Take(50) where a.FOTOS_CODFLIAR > 0 group a by a.FOTOS_CUIL into benef select new { Titular = benef.Key, FotoBenef = benef.ToList() }); foreach (var tit in fotos.ToList()) { if (tit.FotoBenef.Count() > 0) { PathCarpeta = @"D:\BackUp\SEC_Fotos_Beneficiarios\" + tit.Titular.ToString(); DirectoryInfo di = Directory.CreateDirectory(PathCarpeta); foreach (var benef in tit.FotoBenef) { Imagen = cnvImg.ByteArrayToImage(benef.FOTOS_FOTO.ToArray()); PathFoto = PathCarpeta + "\\" + benef.FOTOS_CODFLIAR.ToString() + ".Jpeg"; Bitmap newBmp = new Bitmap(Imagen); Imagen.Dispose(); newBmp.Save(PathFoto, ImageFormat.Jpeg); } } } } }
private void MostrarFotoTitular(double cuil) { convertir_imagen cnvimg = new convertir_imagen(); socios soc = new socios(); var foto = soc.get_foto_titular_binary(cuil); picbox_socio.Image = cnvimg.ByteArrayToImage(foto.ToArray()); }
public para_inspeccionar(double cuil) { InitializeComponent(); // Buscadores obtener_foto = new Buscadores(); futbol obtener_foto = new futbol(); convertir_imagen conv_img = new convertir_imagen(); picbox_socio.Image = conv_img.ByteArrayToImage(obtener_foto.get_Foto(cuil).ToArray());// .get_foto(cuil).ToArray()); }
private void MostrarFotoBeneficiario(double CodigoDeFamiliar) { using (var context = new lts_sindicatoDataContext()) { convertir_imagen cnvimg = new convertir_imagen(); socios soc = new socios(); var foto = soc.get_foto_benef_binary(CodigoDeFamiliar); picbox_beneficiario.Image = cnvimg.ByteArrayToImage(foto.ToArray()); lbl_Parentesco.Text = dgv_MostrarBeneficiario.CurrentRow.Cells["parentesco"].Value.ToString(); } }
private void LlenarDataSetReImpresion(int NumeroDeComprobante, int BotonPresionado) { DS_cupones Ds = new DS_cupones(); DataTable Dt = Ds.EntradaDDEDC; Dt.Clear(); DataRow Dr = Dt.NewRow(); string ReporteAMostrar = string.Empty; if (BotonPresionado == 1) { convertir_imagen ConvertirImagen = new convertir_imagen(); Dr["Nombre"] = txt_Nombre.Text; Dr["DNI"] = txt_Dni.Text; Dr["Empresa"] = txt_Empresa.Text; Dr["NumeroDeSocio"] = txt_NroSocio.Text; Dr["NumeroDeEntrada"] = _NumeroDeEntradaSocio; Dr["NumeroDeRecibo"] = 0; Dr["EsInvitado"] = "NO"; Dr["Foto"] = ConvertirImagen.ImageToByteArray(picbox_socio.Image); Dr["Reimpresion"] = "1"; ReporteAMostrar = "entrega_cupones.Reportes.rpt_EntradaSocioDDEDC.rdlc"; } if (BotonPresionado == 2 || BotonPresionado == 3) { Func_Utiles fu = new Func_Utiles(); Dr["NumeroDeRecibo"] = fu.generar_ceros(NumeroDeComprobante.ToString(), 5); Dr["DNI"] = fu.generar_ceros(txt_Dni.Text, 10); Dr["Reimpresion"] = "1"; ReporteAMostrar = "entrega_cupones.Reportes.rpt_EntradaInvitadoDDEDC.rdlc"; } Dt.Rows.Add(Dr); try { //Instanciamos un LocalReport, le indicamos el report a imprimir y le cargamos los datos LocalReport rdlc = new LocalReport(); rdlc.ReportEmbeddedResource = ReporteAMostrar; rdlc.DataSources.Add(new ReportDataSource("DataSet1", Dt)); //Imprime el report Impresor imp = new entrega_cupones.Impresor(); imp.Imprime(rdlc); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void MostrarDatosDeSocio() { socios GetDatosSocio = new socios(); convertir_imagen ConvertirImagen = new convertir_imagen(); var DatosSocio = GetDatosSocio.get_datos_socio(_cuil, 0); txt_NroSocio.Text = DatosSocio.nrosocio; txt_Nombre.Text = DatosSocio.apellido.Trim() + " " + DatosSocio.nombre.Trim(); txt_Dni.Text = DatosSocio.dni.Trim(); txt_Empresa.Text = DatosSocio.empresa.Trim(); var foto = GetDatosSocio.get_foto_titular_binary(_cuil); picbox_socio.Image = ConvertirImagen.ByteArrayToImage(foto.ToArray()); }
private void mostrar_foto(Binary fot, int estado) { if (fot != null) { convertir_imagen conv_img = new convertir_imagen(); picbox_socio.Image = conv_img.ByteArrayToImage(fot.ToArray()); } else { //picbox_socio.Image = entrega_cupones.Properties.Resources.imagen_no_disponible_PNG; } if (estado == 1) { lbl_apto.Text = "SOCIO APTO"; } else { lbl_apto.Text = "SOCIO NO APTO"; } }
private void dgv_titu_benef_SelectionChanged_1(object sender, EventArgs e) { int cantfilas = dgv_titu_benef.Rows.Count; if (cantfilas > 0) // este if lo hago por que me da error cuando limpio el grid y llamo a mostrar los beneficiarios de las mochilas { socios soc = new socios(); convertir_imagen img = new convertir_imagen(); int edad = Convert.ToInt32(dgv_titu_benef.CurrentRow.Cells["Edad"].Value); double Codigo_Fliar; Codigo_Fliar = Convert.ToDouble(dgv_titu_benef.CurrentRow.Cells["CodigoFliar"].Value); if (Codigo_Fliar > 0) { picbox_socio.Image = img.ByteArrayToImage(soc.get_foto_benef_binary(Codigo_Fliar).ToArray()); } else { if ((Codigo_Fliar == 0) && (Convert.ToInt32(dgv_titu_benef.CurrentRow.Cells["Exepcion"].Value) == 0)) // es por que es titular { picbox_socio.Image = img.ByteArrayToImage(soc.get_foto_titular_binary(_cuil).ToArray()); } else // Es por que es Exepcion { picbox_socio.Image = img.ByteArrayToImage(soc.get_foto_benef_binary(1).ToArray()); } } HabilitarBotonEmitirCupon(Convert.ToInt32(dgv_titu_benef.CurrentRow.Cells["Exepcion"].Value), Convert.ToInt32(dgv_titu_benef.CurrentRow.Cells["ExepcionId"].Value), Convert.ToInt32(dgv_titu_benef.CurrentRow.Cells["CodigoFliar"].Value), edad, Convert.ToInt32(cbx_eventos.SelectedValue), (Codigo_Fliar == 0 ? true : false) ); } }
public void LlenarDtEntradaDDEDC(int NumeroDeEntrada, int NumeroDeComprobante) { DS_cupones Ds = new DS_cupones(); DataTable Dt = Ds.EntradaDDEDC; Dt.Clear(); DataRow Dr = Dt.NewRow(); if (_EsSocio) { convertir_imagen ConvertirImagen = new convertir_imagen(); Dr["Nombre"] = txt_Nombre.Text; Dr["DNI"] = txt_Dni.Text; Dr["Empresa"] = txt_Empresa.Text; Dr["NumeroDeSocio"] = txt_NroSocio.Text; Dr["NumeroDeEntrada"] = NumeroDeEntrada; Dr["NumeroDeRecibo"] = NumeroDeComprobante; Dr["EsInvitado"] = "NO"; Dr["Foto"] = ConvertirImagen.ImageToByteArray(picbox_socio.Image); Dr["Reimpresion"] = "0"; } else { Func_Utiles fu = new Func_Utiles(); Dr["NumeroDeRecibo"] = fu.generar_ceros(NumeroDeComprobante.ToString(), 5); Dr["DNI"] = fu.generar_ceros(txt_Dni.Text, 10); } Dt.Rows.Add(Dr); string ReporteAMostrar = string.Empty; if (_EsSocio) { if (NumeroDeEntrada > 0) //pregunto pro la entrada = a cero por que entonces Es socio { //frm_reportes.nombreReporte = "rpt_EntradaSocioDDEDC"; ReporteAMostrar = "entrega_cupones.Reportes.rpt_EntradaSocioDDEDC.rdlc"; } else { //frm_reportes.nombreReporte = "rpt_EntradaInvitadoDDEDC"; ReporteAMostrar = "entrega_cupones.Reportes.rpt_EntradaInvitadoDDEDC.rdlc"; } } else { //frm_reportes.nombreReporte = "rpt_EntradaInvitadoDDEDC"; ReporteAMostrar = "entrega_cupones.Reportes.rpt_EntradaInvitadoDDEDC.rdlc"; } try { //Instanciamos un LocalReport, le indicamos el report a imprimir y le cargamos los datos LocalReport rdlc = new LocalReport(); rdlc.ReportEmbeddedResource = ReporteAMostrar; rdlc.DataSources.Add(new ReportDataSource("DataSet1", Dt)); //Imprime el report Impresor imp = new entrega_cupones.Impresor(); imp.Imprime(rdlc); } catch (Exception ex) { MessageBox.Show(ex.Message); } }