예제 #1
0
        private void syncClient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                string json = e.Result;

                UsuarioJson obj = JsonHelper.DeserializeToPerson(json);
            }
        }
예제 #2
0
        private void ws_DevolverParticipanteCompleted(object sender, Talentos_Master.TalentosReference.DevolverParticipanteCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                string json = e.Result;

                UsuarioJson obj = JsonHelper.DeserializeToPerson(json);

                if (json != "" && obj.user != null)
                {
                    Talentos_Master.TalentosReference.ParticipanteBE objParticipanteBE = new Talentos_Master.TalentosReference.ParticipanteBE();
                    objParticipanteBE.Nombres           = obj.user.names;
                    objParticipanteBE.ApellidoPaterno   = (obj.user.surname == null) ? "" : obj.user.surname;
                    objParticipanteBE.ApellidoMaterno   = (obj.user.lastname == null) ? "" : obj.user.lastname;
                    objParticipanteBE.Sexo              = (obj.user.sex == null) ? "" : obj.user.sex;
                    objParticipanteBE.CorreoElectronico = (obj.user.email == null) ? "" : obj.user.email;
                    objParticipanteBE.Cargo             = (obj.user.charge == null) ? "" : obj.user.charge;
                    objParticipanteBE.NivelInstruccion  = (obj.user.charge == null) ? "" : obj.user.charge;
                    objParticipanteBE.Institucion       = (obj.user.company == null) ? "" : obj.user.company;
                    objParticipanteBE.DNI = obj.user.numberidentity.ToString();
                    objParticipanteBE.CodigoEvaluacion = obj.user.id.ToString();
                    objParticipanteBE.FechaNacimiento  = (obj.user.birthday == null) ? "" : obj.user.birthday.date;

                    sesion.participante.NickName    = obj.user.names + " " + obj.user.surname;
                    sesion.CorreoParticipanteMasivo = obj.user.email;
                    sesion.CodEvaluacion            = obj.user.id.ToString();
                    sesion.DNI = obj.user.numberidentity;
                    sesion.participante.Nombres = obj.user.names + " " + obj.user.surname;
                    sesion.participante.Sexo    = (obj.user.sex.ToUpper().Equals("F")) ? 1 : 2;

                    TalentosReference.WSTalentosSoapClient ws = new Talentos_Master.TalentosReference.WSTalentosSoapClient();

                    ws.InsertarParticipanteUnicoCompleted += new EventHandler <Talentos_Master.TalentosReference.InsertarParticipanteUnicoCompletedEventArgs>(InsertarParticipanteUnicoCompleted);
                    ws.InsertarParticipanteUnicoAsync(objParticipanteBE);
                }
                else
                {
                    BusyWindow.IsBusy            = false;
                    btnIniciarSession.Visibility = Visibility.Collapsed;
                    txtSinSesion.Visibility      = Visibility.Visible;
                    txtSinSesion.Text            = "No se encontraron datos para el participante solicitado. Favor de revisar si los parametros suministrados son los correctos.";
                }
            }
            else
            {
                BusyWindow.IsBusy            = false;
                btnIniciarSession.Visibility = Visibility.Collapsed;
                txtSinSesion.Visibility      = Visibility.Visible;
                txtSinSesion.Text            = "No se encontraron datos para el participante solicitado. Favor de revisar si los parametros suministrados son los correctos.";
            }
        }