public ResponseRegisterCard RegisterCard(RequestRegisterCard card) { ResponseRegisterCard result = new ResponseRegisterCard() { Registered = true }; if (card.CardId > 0) { try { if (myChannelFactory != null) { _RegisterCardClient = myChannelFactory.CreateChannel(); result = _RegisterCardClient.RegisterCard(card); ((ICommunicationObject)_RegisterCardClient).Close(); } } catch { if (_RegisterCardClient != null) { ((ICommunicationObject)_RegisterCardClient).Abort(); } } } else { throw new InvalidOperationException("Empty argument! Declare - RequestRegisterCard"); } return(result); }
private async void Button_Click(object sender, RoutedEventArgs e) { var result = new RequestRegisterCard() { CardId = int.Parse(cardIdTxtBox.Text), Deleted = TrueCB.IsChecked == true ? true : false, EndTime = (DateTime)EndDate.SelectedDate, Password = int.Parse(PasswordBox.Password.ToString()), StartTime = (DateTime)StartDate.SelectedDate }; await Task.Run(() => { RegisterCard(result); }); _mcard.OnNext(this); var myWindow = Window.GetWindow(this); myWindow.Close(); }
private ResponseRegisterCard RegisterCard(RequestRegisterCard card) { return(_presenter.RegisterCard(card)); }
public ResponseRegisterCard RegisterCard(RequestRegisterCard card) { return(_model.RegisterCard(card)); }