Beispiel #1
0
        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());
                }
            }
        }
Beispiel #2
0
        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 frm_Principal2_Load(object sender, EventArgs e)
        {
            Icon = new Icon("C:\\SEC_Gestion\\Imagen\\icono.ico");
            CargarLocalidad();
            CargarCategorias();

            cbx_buscar_por.SelectedIndex          = 0;
            cbx_filtrar.SelectedIndex             = 1;
            cbx_NroDeSocio.SelectedIndex          = 0;
            cbx_Jornada.SelectedIndex             = 0;
            cbx_Jornada.SelectedIndex             = 0;
            cbx_ActivoEnEmpresa.SelectedIndex     = 0;
            cbx_Jubilados.SelectedIndex           = 0;
            dgv_MostrarSocios.AutoGenerateColumns = false;
            cbx_Localidad.SelectedIndex           = 0;
            cbx_Categoria.SelectedIndex           = 0;

            lbl_Usuario.Text = _UserNombre;
            lbl_Rol.Text     = _RolNombre;
            //buscar.get_titular(_UserDNI).foto.ToArray();
            var foto = buscar.get_titular(_UserDNI);

            if (foto.foto != null)
            {
                roundPictureBox1.Image = cnvimg.ByteArrayToImage(foto.foto.ToArray());
            }
        }
Beispiel #4
0
        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();
                }
            }
        }
Beispiel #5
0
        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 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)
                                          );
            }
        }
Beispiel #10
0
        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());
        }
Beispiel #11
0
 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";
     }
 }