private void PackIcon_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { string id = sender.ToString().Replace("seta", ""); institutoPage paginainstituto = new institutoPage(Convert.ToInt32(id), this); this.NavigationService.Navigate(paginainstituto); }
public void loadInfo() { institutoPage pagina = new institutoPage(-1, this); listaInstitutos = pagina.readInstituto(); servicePage pagina2 = new servicePage(-1, this); listaServicos = pagina2.readService(); }
public void loadInfo() { institutoPage institutoPagina = new institutoPage(-1, this); List <InstitutoInfo> institutos = new List <InstitutoInfo>(); institutos = institutoPagina.readInstituto(); listaInstitutos = institutos; LoginPage logPage = new LoginPage(); currentUser = logPage.getCurrentUser(); }
private void loadInfo() { LoginPage pagina = new LoginPage(); currentUser = pagina.getCurrentUser(); institutoPage pagina2 = new institutoPage(-1, this); listaInstiutos = pagina2.readInstituto(); servicePage pagina3 = new servicePage(-1, this); listaServicos = pagina3.readService(); }
private void FavIcon_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { int id = Convert.ToInt32(sender.ToString().Replace("seta", "")); LoginPage logPage = new LoginPage(); currentUser = logPage.getCurrentUser(); List<String> novoConteudoFicheiro = new List<String>(); RegisterPage registerpageobject = new RegisterPage(); List<UtilizadorInfo> utilizadores = registerpageobject.readRegisto(); bool adicionar = true; foreach (UtilizadorInfo u in utilizadores) { if (u.id == currentUser.id) { foreach (int i in u.favoritos) { if (i==id) { adicionar = false; } } if (adicionar == true) { u.favoritos.Add(id); } else { u.favoritos.Remove(id); } } string conteudo = u.id + "-" + u.tipoConta + "-" + u.email + "-" + u.username + "-" + u.password + "-" + u.localidade + "-" + u.foto + "-{"; foreach (int i in u.favoritos) { conteudo = conteudo + i + ","; } conteudo = conteudo + "}-{"; foreach (string s in u.reservas) { conteudo = conteudo + s + ","; } conteudo = conteudo + "}-{"; foreach (int i in u.user_institutos_id) { conteudo = conteudo + i + ","; } conteudo = conteudo + "}"; novoConteudoFicheiro.Add(conteudo); } registarAlteracoes(novoConteudoFicheiro); institutoPage nova = new institutoPage(currentInstituto.id, paginaAnterior); this.NavigationService.Navigate(nova); }
public void loadInfo() { servicePage servicoPagina = new servicePage(-1, this); List <ServiceInfo> servicos = new List <ServiceInfo>(); institutoPage institutoPagina = new institutoPage(-1, this); List <InstitutoInfo> institutos = new List <InstitutoInfo>(); servicos = servicoPagina.readService(); institutos = institutoPagina.readInstituto(); listaServicos = servicos; listaInstitutos = institutos; foreach (ServiceInfo s in listaServicos) { if (tiposervico.Items.Contains(s.tipo) == false) { tiposervico.Items.Add(s.tipo); } } }
public void loadInfo() { LoginPage loginPagina = new LoginPage(); currentUser = loginPagina.getCurrentUser(); servicePage servicoPagina = new servicePage(-1, this); institutoPage institutoPagina = new institutoPage(-1, this); listaServicos = servicoPagina.readService(); listaInstitutos = institutoPagina.readInstituto(); foreach (InstitutoInfo i in listaInstitutos) { if (currentUser.user_institutos_id.Contains(i.id) && institutosBox.Items.Contains(i.nome) == false) { institutosBox.Items.Add(i.nome); } } this.getListaUtitilizadores(); }
private void Grid_PreviewMouseLeftButtonDown_1(object sender, MouseButtonEventArgs e) { institutoPage institutoPage = new institutoPage(3, this); this.NavigationService.Navigate(institutoPage); }
public servicePage(int id, Page paginaanterior) { InitializeComponent(); if (id == -1) { return; } paginaAnterior = paginaanterior; LoginPage logPage = new LoginPage(); currentUser = logPage.getCurrentUser(); List <ServiceInfo> servicos = readService(); foreach (ServiceInfo s in servicos) { if (s.id == id) { currentService = s; } } descricaoServico.Document.Blocks.Clear(); descricaoServico.Document.Blocks.Add(new Paragraph(new Run(currentService.descricao)) { FontSize = 16 }); preco.Document.Blocks.Clear(); preco.Document.Blocks.Add(new Paragraph(new Run(currentService.preco)) { FontSize = 18 }); nomeservico.Content = currentService.tipo; //nomeservico.Document.Blocks.Clear(); //nomeservico.Document.Blocks.Add(new Paragraph(new Run(currentService.tipo)) { FontSize = 18 }); nomeinstituto.Document.Blocks.Clear(); nomeinstituto.Document.Blocks.Add(new Paragraph(new Run(currentService.instituto_nome)) { FontSize = 18 }); if (currentService.foto != "null") { ImageBrush myBrush = new ImageBrush(); Image image = new Image(); image.Source = new BitmapImage( new Uri( BaseUriHelper.GetBaseUri(this), currentService.foto)); myBrush.ImageSource = image.Source; userfotogrid.Background = myBrush; } data.Items.Insert(0, "Data"); data.SelectedIndex = 0; hora.Items.Insert(0, "Hora"); hora.SelectedIndex = 0; institutoPage InstitutoPage = new institutoPage(-1, this); List <InstitutoInfo> institutos = InstitutoPage.readInstituto(); foreach (InstitutoInfo i in institutos) { if (i.id == currentService.instituto_id) { respectiveInstitute = i; } } foreach (int dia in respectiveInstitute.dias) { data.Items.Insert(data.Items.Count, dia); } foreach (string h in respectiveInstitute.horas) { hora.Items.Insert(hora.Items.Count, h); } foreach (int favoritoid in currentUser.favoritos) { if (favoritoid == currentService.id) { favoritos.Kind = MaterialDesignThemes.Wpf.PackIconKind.Star; flag++; } } }
private void PackIcon_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { institutoPage institutoPage = new institutoPage(currentService.instituto_id, this); this.NavigationService.Navigate(institutoPage); }