private async void ActionGetData() { WSService ws = new WSService(); var result = await ws.GetAllDevice(); this.ComboBoxDevice = new ObservableCollection <Device>(result); }
public MainPage() { this.InitializeComponent(); wsService = WSService.GetInstance(); ActionGetData(); }
private async void getMontantDeviseValue() { double conversion = 0.0; bool noValue = string.IsNullOrEmpty(this.montant_euros_value.Text); bool noTarget = this.devise_value.SelectedValue == null; // if there is a problem if (noValue || noTarget) { string message = ""; if (noValue) { message = "A Euros value must be set"; } else if (noTarget) { message = "A target currency must be selected"; } var messageDialog = new MessageDialog(message); messageDialog.Commands.Add( new UICommand("Close") ); messageDialog.DefaultCommandIndex = 0; await messageDialog.ShowAsync(); } else { double montantEuros = Convert.ToDouble(this.montant_euros_value.Text); string selectedId = this.devise_value.SelectedValue.ToString(); Devise deviseTo = await WSService.getDeviseByIdAsync("devise/" + selectedId); conversion = WSService.getConversion(deviseTo, montantEuros); } this.montant_devise_value.DataContext = conversion; }
/// <summary> /// Récupère la liste des devises via le service connecté à l'API /// </summary> private async void ActionGetData() { WSService connection = WSService.GetInstance(); var result = await connection.GetAllDevisesAsync("Devise"); this.ComboBoxDevises = new ObservableCollection <Devise>(result); }
public AjouterCompteVM() { _wsService = new WSService(); AddedCompte = new Compte(); BtnClearCompteCommand = new RelayCommand(ClearCompte); BtnAddCompteCommand = new RelayCommand(AddCompte); }
/// <summary> /// Récupère la liste des devises via l'API /// </summary> private async void ActionGetData() { WSService wSService = WSService.GetInstance(); List <Devise> devises = await wSService.GetAllDevisesAsync("Devise"); this.comboBox.DataContext = devises; }
public async void InitializeData() { WSService service = WSService.GetInstance(); var result = await service.GetDevisesAsync(); this.deviseBox.DataContext = result.ToList(); this.deviseBox.SelectedValue = 1; }
public VMAjouterCompte() { _bingService = new BingService(); _wsService = new WSService(); AddedCompte = new Compte(); BtnClearCompteCommand = new RelayCommand(ClearCompte); BtnAddCompteCommand = new RelayCommand(AddCompte); }
public VMCompte() { this.Mail = "*****@*****.**"; _wsService = new WSService(); BtnSearchCompteByMail = new RelayCommand(SearchCompteByEmail); BtnClearCompteCommand = new RelayCommand(ClearCompte); BtnAddCompteCommand = new RelayCommand(AddCompte); }
public async void AlimData() { WSService ws = new WSService(); var resu = await ws.GetAllDevice(); this.CbDevise.DataContext = resu; this.CbDevise.ItemsSource = resu; this.CbDevise.SelectedValuePath = "Id"; this.CbDevise.DisplayMemberPath = "Nom"; }
public void CargarServicios() { List<Service> listService = new List<Service>(); WSService wsservice = new WSService(); listService = wsservice.ListService(); this.service.DataSource = listService; this.service.DataValueField = "idService"; this.service.DataTextField = "name"; this.service.DataBind(); this.service.Items.Insert(0, new ListItem("-- SELECCIONE EL SERVICIO --")); }
public RechercheCompteVM() { //alim pr test this.Mail = "*****@*****.**"; // Fctn _wsService = new WSService(); BtnSearchCompteByMail = new RelayCommand(SearchCompteByEmail); BtnClearCompteCommand = new RelayCommand(ClearCompte); BtnModifyCompteCommand = new RelayCommand(ModifCompte); BtnAddCompteCommand = new RelayCommand(RedirectToAddCompte); }
private async Task <List <ContaTipo> > TrazerContaTipos() { WSService ws = new WSService(); var contaTipos = await ws.Get <List <ContaTipo> >(Constantes.SERVER_CONTATIPOS); if (contaTipos.GetType() == typeof(Response)) { var response = (Response)contaTipos; Message.Erro((string)response.Data); return(null); } return(contaTipos as List <ContaTipo>); }
private async void ActionSave() { try { await WSBingMaps.FillCompteLocation(Compte); await WSService.CreateCompte(Compte); await ShowDialog($"Compte {Compte.Nom} (localisé {Compte.Latitude}/{Compte.Longitude}) créé !"); } catch (Exception e) { await ShowDialog(e.Message); } }
private async void ActionModifyCompteCommand() { WSService wsService = WSService.GetInstance(); try { Compte = await wsService.PutCompteAsync(_cpt.CPT_ID, _cpt); } catch (Exception e) { var messageDialog = new MessageDialog("Pas de connexion au webService concerné"); await messageDialog.ShowAsync(); } }
private async Task <Cliente> GetCliente(Guid id_cliente) { WSService s = new WSService(); var result = await s.Get <Cliente>(Constantes.SERVER_CLIENTES + id_cliente.ToString()); if (result.GetType() == typeof(Response)) { var response = (Response)result; Message.Erro((string)response.Data); return(null); } return(result as Cliente); }
private async void ActionGetData() { try { var result = await WSService.GetInstance().GetAllDeviseAsync(); this.ComboBoxDevises = new ObservableCollection <Devise>(result); } catch (Exception e) { MessageDialog dialog = new MessageDialog("Une erreur est survenu en essayant de recupérer les données du serveur"); await dialog.ShowAsync(); } }
/// <summary> /// Change to convertissor page = go to DeviseEuros /// </summary> private async void ActionMailRecherche() { WSService wsService = WSService.GetInstance(); try { Compte = await wsService.GetCompteMailAsync(_mailBoxRech); } catch (Exception e) { var messageDialog = new MessageDialog("Pas de connexion au webService concerné"); await messageDialog.ShowAsync(); } }
private async void ActionGetData() { WSService Service = WSService.GetInstance(); try { var result = await Service.GetAllDeviseAsync(); this.CBDevise.DataContext = new List <Devise>(result); } catch (Exception e) { MessageDialog dialog = new MessageDialog("Une erreur est survenu en essayant de recupérer les données du serveur"); await dialog.ShowAsync(); } }
private async void abb_salvar_Click(object sender, RoutedEventArgs e) { if (!Edit) { if (contatos.Any()) { clienteViewModel.Cliente.Contatos = (from contato in contatos.ToList() select contato.ContaContato).ToList(); } if (enderecos.Any()) { clienteViewModel.Cliente.Enderecos = (from endereco in enderecos.ToList() select endereco.ContaEndereco).ToList(); } } WSService ws = new WSService(); var result = await ws.Post(Constantes.SERVER_CLIENTES, clienteViewModel.Cliente); }
/// <summary> /// Essaie de récupérer les devises dans un appel asynchrone /// Erreur deconnexion gérée par un try catch /// </summary> private async void ActionGetData() { WSService wsService = WSService.GetInstance(); try { var result = await wsService.GetAllDevisesAsync(); ComboBoxDevises = new ObservableCollection <Devise>(result); } catch (Exception e) { var messageDialog = new MessageDialog("Pas de connexion au webService concerné"); await messageDialog.ShowAsync(); Application.Current.Exit(); } }
private async void ActionGetData() { WSService wsService = WSService.GetInstance(); try { var result = await wsService.GetAllDevisesAsync(); ComboBoxDevises = new ObservableCollection <Devise>(result); } catch (Exception e) { var messageDialog = new MessageDialog("Pas de connexion au webService concerné"); await messageDialog.ShowAsync(); // IL FAUDRAIT FERMER L'APPLICATION } }
private async void ActionCreateAccount() { WSService wsService = WSService.GetInstance(); try { _cptNew.CPT_PWD = PasswordChp; await wsService.PostCompteAsync(_cptNew); var messageDialog = new MessageDialog("Nouvel utilisateur ajouté"); await messageDialog.ShowAsync(); } catch (Exception e) { var messageDialog = new MessageDialog("Pas de connexion au webService concerné"); await messageDialog.ShowAsync(); } }
private async void ActionSave() { if (Compte == null) { await ShowDialog("Veuillez sélectionner un compte"); return; } try { await WSService.UpdateCompte(Compte); await ShowDialog($"Compte {Compte.Nom} modifié !"); } catch (Exception ex) { await ShowDialog(ex.Message); } }
private async void ActionSearch() { // TODO Check that `Search` is a valid email address if (Search.Length == 0) { await ShowDialog("Veuillez entrez une adresse e-mail valide"); return; } var compte = await WSService.GetCompteByEmail(Search); if (compte == null) { await ShowDialog("Compte introuvable"); return; } Compte = compte; }
private async void b_login_Click(object sender, RoutedEventArgs e) { LoginViewModel login = new LoginViewModel { Login = "******", Senha = "adm123*" }; WSService ws = new WSService(); var result = await ws.Login(login); if (result.GetType() == typeof(Response)) { var response = ((Response)result); MessageDialog msg = new MessageDialog(response.Data.ToString()); await msg.ShowAsync(); return; } MessageDialog msgOk = new MessageDialog("Ok"); await msgOk.ShowAsync(); }
protected void BtnInsert_Click(object sender, EventArgs e) { //// REGISTRANDO PACIENTE Service objService = GetValues(); // ACCEDIENDO AL WEB SERVICE WSService wsservice = new WSService(); bool response = wsservice.InsertService(objService); if (response) { this.divSuccess.Visible = true; this.TextSuccess.Text = "¡Servicio creado con éxito!"; this.txtName.Text = string.Empty; } else { this.divError.Visible = true; this.TextError.Text = "¡El servicio no fue creado!"; } }
protected async void ActionSearch() { String email = Convert.ToString(_valeurEmail); WSService connection = WSService.GetInstance(); try { var result = await connection.GetCompteByEmailAsync("Comptes/GetCompteByEmail/" + email); if (result.Nom == null) { this.MessageBox("Aucun compte correspondant n'a été trouvé"); } else { this.ValeurCompteNom = result.Nom; } } catch (HttpRequestException e) { this.MessageBox("La connexion à la base de donnée à échoué"); } }
private async void ActionGetData() { CompteSearch = await WSService.getCompteByMailAsync(_compteSearch.CPT_MEL); }
private async void ActionUpdateData() { await WSService.updateCompte(_compteSearch); }