示例#1
0
        public int GuardarError(LogBE be)
        {
            LogBC bc = new LogBC();

            if (!Blindaje.InvalidString(be.Descripcion) && !Blindaje.InvalidString(be.Id.ToString()) && !Blindaje.InvalidString(be.UsuarioId.ToString()))
            {
                return(bc.LogInsertar(be));
            }
            else
            {
                return(-1);
            }
        }
示例#2
0
        public int InsertarResultadoAdulto(ResultadoBE resultado)
        {
            ResultadoBC bc = new ResultadoBC();

            try
            {
                return(bc.InsertarResultadoAdulto(resultado));
            }
            catch (Exception ex)
            {
                LogBC  objLogBC = new LogBC();
                string mensaje  = "Metodo: InsertarResultadoAdulto. Mensaje: " + ex.Message;
                objLogBC.InsertarLog(mensaje);

                throw ex;
            }
        }
示例#3
0
        public int InsertarResultadoTemporal(int idParticipante, string lstIDTalentos, int idBuzon)
        {
            ResultadoBC bc = new ResultadoBC();

            try
            {
                bc.InsertaResultadoTemp(idParticipante, lstIDTalentos, idBuzon);
            }
            catch (Exception ex)
            {
                LogBC  objLogBC = new LogBC();
                string mensaje  = "Metodo: InsertarResultado. Mensaje: " + ex.Message;
                objLogBC.InsertarLog(mensaje);

                throw ex;
            }

            return(0);
        }
示例#4
0
        public string DevolverParticipanteAdulto(string id, string token)
        {
            ParticipanteBC objParticipanteBC = new ParticipanteBC();
            bool           existe            = false;

            try
            {
                if (id.Substring(0, 1).Equals("0"))
                {
                    return("");
                }

                long entero     = 0;
                bool canConvert = long.TryParse(id, out entero);

                if (canConvert == false)
                {
                    return("");
                }
            }

            catch (Exception)
            {
                return("");
            }

            try
            {
                existe = objParticipanteBC.VerificaParticipanteAdultoActivo(id);
            }
            catch (Exception ex)
            {
                LogBC  objLogBC = new LogBC();
                string mensaje  = "Metodo: DevolverParticipanteAdulto (Verificar Existencia Participante). Mensaje: " + ex.Message;
                objLogBC.InsertarLog(mensaje);

                return("");
            }

            if (existe)
            {
                string vacio = "";
                return(vacio);
            }
            else
            {
                string json = "";
                // hosting: sdch-upc.davidfischman.com
                // produccion: 66.135.63.156
                string url = ConfigurationManager.AppSettings["JSON_PERSONA_ADULTO"] + id + "/person?token=" + token;
                try
                {
                    var syncClient = new WebClient();
                    json = syncClient.DownloadString(url);
                }
                catch (Exception ex)
                {
                    LogBC  objLogBC = new LogBC();
                    string mensaje  = "Metodo: DevolverParticipante. Mensaje: " + ex.Message;
                    objLogBC.InsertarLog(mensaje);

                    return("");
                }

                return(json);
            }
        }