1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
public int nbLogs;
public List<LogsConnexion>LesLogs = new List<LogsConnexion>();
public Logs()
{
InitializeComponent();
Loaded += new RoutedEventHandler(Logs_Loaded);
}
void Logs_Loaded(object sender, RoutedEventArgs e)
{
ServiceWCF.ServiceWCFClient client = new SilverlightApplication2.ServiceWCF.ServiceWCFClient();
client.GetNbLogsCompleted += new EventHandler<SilverlightApplication2.ServiceWCF.GetNbLogsCompletedEventArgs>(client_GetNbLogsCompleted);
client.GetNbLogsAsync(App.CodeIdent, App.MonPdaSelectionne.IMEI);
}
void client_GetNbLogsCompleted(object sender, SilverlightApplication2.ServiceWCF.GetNbLogsCompletedEventArgs e)
{
nbLogs = e.Result;
ServiceWCF.ServiceWCFClient client = new SilverlightApplication2.ServiceWCF.ServiceWCFClient();
client.GetIdConnexionCompleted += new EventHandler<SilverlightApplication2.ServiceWCF.GetIdConnexionCompletedEventArgs>(client_GetIdConnexionCompleted);
client.GetIdConnexionAsync(App.CodeIdent, App.MonPdaSelectionne.IMEI);
}
void client_GetIdConnexionCompleted(object sender, SilverlightApplication2.ServiceWCF.GetIdConnexionCompletedEventArgs e)
{
decimal[] IdConnexion = e.Result.ToArray();
ServiceWCF.ServiceWCFClient client = new SilverlightApplication2.ServiceWCF.ServiceWCFClient();
client.GetInfosLogCompleted += new EventHandler<SilverlightApplication2.ServiceWCF.GetInfosLogCompletedEventArgs>(client_GetInfosLogCompleted);
for (int i = 0; i < nbLogs; i++)
{
LogsConnexion log = new LogsConnexion() { Id = IdConnexion[i] };
client.GetInfosLogAsync(IdConnexion[i], log);
}
}
void client_GetInfosLogCompleted(object sender, SilverlightApplication2.ServiceWCF.GetInfosLogCompletedEventArgs e)
{
ServiceWCF.ServiceWCFClient client = new SilverlightApplication2.ServiceWCF.ServiceWCFClient();
LogsConnexion log = e.UserState as LogsConnexion;
string[] infos = e.Result.ToArray();
log.Date = infos[0];
log.ICCID = infos[1];
log.OS = infos[2];
log.Revision = infos[3];
log.AKU = infos[4];
log.Identifiant = infos[5];
log.OSEburo = infos[6];
log.Sim = infos[7];
LesLogs.Add(log);
MaDataGrid.ItemsSource = LesLogs;
} |
Partager