コード例 #1
0
        public csRespuestaValidacion BuscaParticipante_Email(string email, decimal participante_id)
        {
            csRespuestaValidacion result = new csRespuestaValidacion();

            using (DbContextJulio db = new DbContextJulio())
            {
                var _participante = (from p in db.participante
                                     join t in db.transaccion on p.id equals t.participante_id
                                     where p.correo_electronico == email.Trim() && p.status_participante_id != 13 && p.status_participante_id != 14 && t.tipo_transaccion_id == 1 && p.id != participante_id
                                     select new
                {
                    id = p.id,
                    clave = p.clave,
                    nombre = p.nombre,
                    apellido_paterno = p.apellido_paterno,
                    apellido_materno = p.apellido_materno,
                    correo_electronico = p.correo_electronico,
                    fecha_nacimiento = p.fecha_nacimiento,
                    fecha = t.fecha
                }).OrderByDescending(t => t.fecha).FirstOrDefault();
                if (_participante != null)
                {
                    result.id                 = _participante.id;
                    result.clave              = _participante.clave;
                    result.nombre             = _participante.nombre;
                    result.apellido_paterno   = _participante.apellido_paterno;
                    result.apellido_materno   = _participante.apellido_materno;
                    result.correo_electronico = _participante.correo_electronico;
                    result.fecha_nacimiento   = _participante.fecha_nacimiento;
                    result.telefono_celular   = null;
                }
            }
            return(result);
        }
コード例 #2
0
        public csRespuestaValidacion ConsultaDominio_Email(string email)
        {
            csRespuestaValidacion result = new csRespuestaValidacion();

            try
            {
                using (DbContextJulio db = new DbContextJulio())
                {
                    Dictionary <string, object> parameters = new Dictionary <string, object>();
                    parameters.Add("@email", email);
                    DataSet setTables = db.GetDataSet("[dbo].[usp_Consulta_dominio_email]", CommandType.StoredProcedure, parameters);
                    if (setTables.Tables[0].Rows.Count > 1)
                    {
                        result.status  = Int16.Parse(setTables.Tables[0].Rows[0]["status"].ToString());
                        result.result  = setTables.Tables[0].Rows[0]["result"].ToString();
                        result.message = setTables.Tables[0].Rows[0]["message"].ToString();
                        return(result);
                    }
                    else
                    {
                        result.status  = 0;
                        result.result  = "ok";
                        result.message = "Correo valido";
                        return(result);
                    }
                }
            }
            catch (Exception ex)
            {
                return(result);
            }
        }
コード例 #3
0
        public csRespuestaValidacion BuscaParticipante_TelCel(string telcel, decimal participante_id)
        {
            csRespuestaValidacion result = new csRespuestaValidacion();

            using (DbContextJulio db = new DbContextJulio())
            {
                var _participante_TelCel = (from p in db.participante
                                            join pt in db.participante_telefono on p.id equals pt.participante_id
                                            join t in db.transaccion on p.id equals t.participante_id
                                            where pt.telefono == telcel.Trim() && pt.tipo_telefono_id == 3 && p.status_participante_id != 13 && p.status_participante_id != 14 && t.tipo_transaccion_id == 1 && p.id != participante_id
                                            select new
                {
                    p.id,
                    p.clave,
                    p.nombre,
                    p.apellido_paterno,
                    p.apellido_materno,
                    p.correo_electronico,
                    p.fecha_nacimiento,
                    pt.telefono,
                    t.fecha
                }).OrderByDescending(t => t.fecha).FirstOrDefault();
                if (_participante_TelCel != null)
                {
                    result.id                 = _participante_TelCel.id;
                    result.clave              = _participante_TelCel.clave;
                    result.nombre             = _participante_TelCel.nombre;
                    result.apellido_paterno   = _participante_TelCel.apellido_paterno;
                    result.apellido_materno   = _participante_TelCel.apellido_materno;
                    result.correo_electronico = null;
                    result.fecha_nacimiento   = _participante_TelCel.fecha_nacimiento;
                    result.telefono_celular   = _participante_TelCel.telefono;
                }
            }
            return(result);
        }