public void RegistrarReporteFotografico(E_Reporte_Fotografico_General oE_Reporte_Fotografico, E_Visita oE_Visita)
        {
            try
            {
                D_Visita oD_Visita = new D_Visita();
                oD_Visita.RegistrarVisita(oE_Visita);

                //Tipo de Reporte por Defecto 01
                oCoon = new Conexion(2);
                oCoon.ejecutarDataTable("STP_JVM_INSERTAR_REPORTE_FOTOGRAFICO",
                                        Convert.ToInt32(oE_Reporte_Fotografico.Person_id),
                                        //El atributo Perfil_Id se reemplaza por el Canal_Id
                                        oE_Reporte_Fotografico.Perfil_id,
                                        oE_Reporte_Fotografico.Equipo_id,
                                        oE_Reporte_Fotografico.Cliente_id,
                                        oE_Reporte_Fotografico.ClientePDV_Code,
                                        "01",
                                        oE_Reporte_Fotografico.Categoria_id,
                                        oE_Reporte_Fotografico.Marca_id,
                                        oE_Reporte_Fotografico.FechaRegistro,
                                        oE_Reporte_Fotografico.Latitud,
                                        oE_Reporte_Fotografico.Longitud,
                                        oE_Reporte_Fotografico.OrigenCoordenada, " "
                                        //oE_Reporte_Fotografico.TipoReporteFotografico_id
                                        );


                //Insertar Foto Tipo de Proceso por defecto 1
                foreach (E_Foto Foto in oE_Reporte_Fotografico.listFotos)
                {
                    oCoon.ejecutarDataTable("stp_jvm_INSERTAR_FOTO",
                                            Convert.ToInt32(oE_Reporte_Fotografico.Person_id),
                                            oE_Reporte_Fotografico.Perfil_id,
                                            oE_Reporte_Fotografico.Equipo_id,
                                            oE_Reporte_Fotografico.Cliente_id,
                                            oE_Reporte_Fotografico.ClientePDV_Code,
                                            1,
                                            oE_Reporte_Fotografico.FechaRegistro,
                                            oE_Reporte_Fotografico.Comentario,
                                            DecodeFrom64(Foto.foto),
                                            " "//oE_Reporte_Fotografico.NombreFoto
                                            );
                }
            }
            catch (Exception ex) { }
        }
        /// <summary>
        /// Fecha: 19/04/2012
        /// Autor: Joseph Gonzales
        /// Descripción: Se agrega la validación para evitar que se releve datos duplicados en un periodo x PDV x Reporte x Opción de Reporte x SKU, para los canales Mayor y Menor
        /// y se agrega el reporte de Codigos ITT
        /// </summary>
        public string RegistrarReportesColgate_Mayoristas(List <E_Reporte_Presencia> oListE_Reporte_Presencia, List <E_Reporte_Fotografico> oListE_Reporte_Fotografico, List <E_Reporte_Codigo_ITT> oListE_Reporte_CodigoITT, E_Visita oE_Visita)
        {
            oCoon = new Conexion(2);

            string mensaje = "";
            int    valor   = 1;

            foreach (E_Reporte_Fotografico oE_Reporte_Fotografico in oListE_Reporte_Fotografico)
            {
                //Solo inserta en caso de que no exista un reporte fotografico teniendo en cuenta: Person_id,Equipo_id,Cliente_id,ClientePDV_Code, Categoria_id, Fecha_Registro
                //Hasta resolver el inconveniente de envio de Fotos Duplicadas en LuckyGestor
                //04/04/2012 pSalas
                DataTable dt = oCoon.ejecutarDataTable("SP_JMV_EXISTE_FOTO", oE_Reporte_Fotografico.Person_id, oE_Reporte_Fotografico.Equipo_id,
                                                       oE_Reporte_Fotografico.Cliente_id, oE_Reporte_Fotografico.ClientePDV_Code, "01", oE_Reporte_Fotografico.Categoria_id, oE_Reporte_Fotografico.FechaRegistro);
                if (dt.Rows[0]["EXISTE_FOTO"].ToString() == "0")
                {
                    RegistrarReporteFotografico(oE_Reporte_Fotografico);
                }
            }

            foreach (E_Reporte_Presencia oReporte_Presencia in oListE_Reporte_Presencia)
            {
                if (oReporte_Presencia.OpcionReporte_id == "04" || oReporte_Presencia.OpcionReporte_id == "05")
                {
                    //Verificar si Existe Producto para Presencia Colgate, para un Id_Equipo,Id_Cliente,ClientePDV_Code,Categoria_id y periodo  20/03/2012 pSalas
                    //En caso de Existir no insertará un nuevo registro.
                    foreach (E_Reporte_Presencia_Detalle oDetalle in oReporte_Presencia.PresenciaDetalle)
                    {
                        DataTable dt = oCoon.ejecutarDataTable("STP_JVM_VERIFICAR_PRODUCTO", oReporte_Presencia.Equipo_id, oReporte_Presencia.Cliente_id, oReporte_Presencia.ClientPDV_Code, oReporte_Presencia.Categoria_id, oReporte_Presencia.OpcionReporte_id,
                                                               oReporte_Presencia.FechaRegistro, oDetalle.Codigo);
                        if (dt.Rows[0]["EXISTE_CAB"].ToString() == "1" && dt.Rows[0]["EXISTE_PRO"].ToString() == "0")
                        {
                            //insertar Detalle
                            RegistrarReportePresenciaDetalle(oDetalle, dt.Rows[0]["ID_REG_PRESENCIA"].ToString());
                            valor = valor * 1;
                        }
                        else if (dt.Rows[0]["EXISTE_CAB"].ToString() == "0" && dt.Rows[0]["EXISTE_PRO"].ToString() == "0")
                        {
                            //Registrar Cabecera y Detalle
                            RegistrarReportePresencia(oReporte_Presencia);
                            valor = valor * 1;
                        }
                        else
                        {
                            valor = valor * 0;
                        }
                    }
                }
                //
                else if (oReporte_Presencia.OpcionReporte_id == "03")
                {
                    //Verificar si Existe Material de Apoyo, para un Id_Equipo, Id_Cliente, ClientePVD_Code y periodo. pSalas. 02/04/2012
                    //En caso de Existir no insertará un nuevo registro.
                    foreach (E_Reporte_Presencia_Detalle oDetalle in oReporte_Presencia.PresenciaDetalle)
                    {
                        DataTable dt = oCoon.ejecutarDataTable("STP_JVM_VERIFICAR_MATERIAL_APOYO", oReporte_Presencia.Equipo_id, oReporte_Presencia.Cliente_id, oReporte_Presencia.ClientPDV_Code, oReporte_Presencia.OpcionReporte_id,
                                                               oReporte_Presencia.FechaRegistro, oDetalle.Codigo);
                        if (dt.Rows[0]["EXISTE_CAB"].ToString() == "1" && dt.Rows[0]["EXISTE_MATERIAL_APOYO"].ToString() == "0")
                        {
                            //insertar Detalle
                            RegistrarReportePresenciaDetalle(oDetalle, dt.Rows[0]["ID_REG_PRESENCIA"].ToString());
                            valor = valor * 1;
                        }
                        else if (dt.Rows[0]["EXISTE_CAB"].ToString() == "0" && dt.Rows[0]["EXISTE_MATERIAL_APOYO"].ToString() == "0")
                        {
                            //Registrar Cabecera y Detalle
                            RegistrarReportePresencia(oReporte_Presencia);
                            valor = valor * 1;
                        }
                        else
                        {
                            valor = valor * 0;
                        }
                    }
                }
                else
                {
                    RegistrarReportePresencia(oReporte_Presencia);
                    valor = valor * 1;
                }
            }

            D_Reporte_Codigo_ITT dReporte_Codigo_ITT = new D_Reporte_Codigo_ITT();

            dReporte_Codigo_ITT.Registrar_Presencia_Codigo_ITT(oListE_Reporte_CodigoITT);

            D_Visita oD_Visita = new D_Visita();

            oD_Visita.RegistrarVisita(oE_Visita);

            if (valor == 1)
            {
                mensaje = "Registro Ok";
            }
            else
            {
                mensaje = "Obs: Algunos insumos de Pres.Colg, Pres.Comp. y/o Elem. Vis. ya fueron ingresados";
            }
            return(mensaje);
        }