private void Client_SmsSentCompletedEvent(object obj, sms_msg msg) { Dispatcher.Invoke(DispatcherPriority.Normal, new Action(delegate { SearchCondition1 con = new SearchCondition1(); con.StartDate = pb.sdate.Value; con.EndDate = pb.edate.Value; // Smses smslists = new Smses(); if (pb.smslist == null) pb.smslist = new Smses(con); Customer itm = smscustomers.FirstOrDefault(x => x.Cellular.Equals(msg.receiverphones)); if (itm != null) { Sms item = new Sms() { Cust_Name = itm.Name, Cust_Tel = msg.receiverphones, Memo = msg.message, Regdate = DateTime.Now, Result = msg.status }; pb.smslist.add(item); pb.dgSmsList.ItemsSource = pb.smslist; smscustomers.Remove(itm); this.SendSms(null, smsmsg, smssender); } })); }
private void Client_SmsRecievedRequestedEvent(object obj, sms_msg msg) { Dispatcher.Invoke(DispatcherPriority.Normal, new Action(delegate { if (pb.smslist != null) { Sms item = new Sms() { Cust_Tel = msg.receiverphones, Memo = msg.message }; pb.smslist.add(item); pb.tabs.SelectedIndex = 2; } })); }