Beispiel #1
0
        private void PackIcon_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            string      id            = sender.ToString().Replace("seta", "");
            servicePage paginaservico = new servicePage(Convert.ToInt32(id), this);

            this.NavigationService.Navigate(paginaservico);
        }
Beispiel #2
0
        public void loadInfo()
        {
            institutoPage pagina = new institutoPage(-1, this);

            listaInstitutos = pagina.readInstituto();
            servicePage pagina2 = new servicePage(-1, this);

            listaServicos = pagina2.readService();
        }
Beispiel #3
0
        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();
        }
Beispiel #4
0
        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);
                }
            }
        }
Beispiel #5
0
        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();
        }
Beispiel #6
0
        private void Grid_PreviewMouseLeftButtonDown_6(object sender, MouseButtonEventArgs e)
        {
            servicePage servicePage = new servicePage(1, this);

            this.NavigationService.Navigate(servicePage);
        }
Beispiel #7
0
        public MinhasReservas()
        {
            InitializeComponent();
            LoginPage logPage = new LoginPage();

            currentUser = logPage.getCurrentUser();
            int flag = 0;

            foreach (String reserva in currentUser.reservas)
            {
                if (reserva != "")
                {
                    int      servico_id = -1;
                    string   data       = "";
                    string[] cadaparte  = reserva.Split("|");
                    servico_id = Convert.ToInt32(cadaparte[0]);
                    data       = cadaparte[2] + "           " + cadaparte[1];
                    servicePage ServicePage = new servicePage(servico_id, this);
                    ServiceInfo servico     = ServicePage.getCurrentService();
                    Grid        novaGrid    = new Grid();
                    novaGrid.Height = 50;
                    ColumnDefinition colDef0 = new ColumnDefinition();
                    colDef0.Width = new GridLength(30, GridUnitType.Star);
                    ColumnDefinition colDef1 = new ColumnDefinition();
                    colDef1.Width = new GridLength(40, GridUnitType.Star);
                    ColumnDefinition colDef2 = new ColumnDefinition();
                    colDef2.Width = new GridLength(130, GridUnitType.Star);
                    ColumnDefinition colDef3 = new ColumnDefinition();
                    colDef3.Width = new GridLength(100, GridUnitType.Star);
                    ColumnDefinition colDef4 = new ColumnDefinition();
                    colDef4.Width = new GridLength(40, GridUnitType.Star);
                    ColumnDefinition colDef5 = new ColumnDefinition();
                    colDef5.Width = new GridLength(30, GridUnitType.Star);

                    novaGrid.ColumnDefinitions.Add(colDef0);
                    novaGrid.ColumnDefinitions.Add(colDef1);
                    novaGrid.ColumnDefinitions.Add(colDef2);
                    novaGrid.ColumnDefinitions.Add(colDef3);
                    novaGrid.ColumnDefinitions.Add(colDef4);
                    novaGrid.ColumnDefinitions.Add(colDef5);

                    var binicon = new nova {
                        Kind = PackIconKind.Bin
                    };
                    binicon.Width               = 25;
                    binicon.Height              = 25;
                    binicon.VerticalAlignment   = VerticalAlignment.Center;
                    binicon.HorizontalAlignment = HorizontalAlignment.Left;
                    binicon.SetValue(Grid.ColumnProperty, 1);
                    string hora    = cadaparte[1].Split(":")[0];
                    string minutos = cadaparte[1].Split(":")[1];
                    binicon.Name = "bin" + servico_id + "separador" + hora + "separador" + minutos + "separador" + cadaparte[2];
                    binicon.PreviewMouseLeftButtonDown += BinIcon_PreviewMouseLeftButtonDown;
                    TextBlock newTextBox = new TextBlock();
                    newTextBox.Text = servico.tipo;
                    newTextBox.VerticalAlignment   = VerticalAlignment.Center;
                    newTextBox.HorizontalAlignment = HorizontalAlignment.Left;
                    newTextBox.FontSize            = 16;
                    newTextBox.SetValue(Grid.ColumnProperty, 2);
                    TextBlock newTextBox2 = new TextBlock();
                    newTextBox2.Text                = data;
                    newTextBox2.FontSize            = 16;
                    newTextBox2.VerticalAlignment   = VerticalAlignment.Center;
                    newTextBox2.HorizontalAlignment = HorizontalAlignment.Left;
                    newTextBox2.SetValue(Grid.ColumnProperty, 3);
                    var icon = new nova {
                        Kind = PackIconKind.ArrowRight
                    };
                    icon.Width               = 25;
                    icon.Height              = 25;
                    icon.VerticalAlignment   = VerticalAlignment.Center;
                    icon.HorizontalAlignment = HorizontalAlignment.Right;
                    icon.SetValue(Grid.ColumnProperty, 4);
                    icon.Name = "seta" + servico_id;
                    icon.PreviewMouseLeftButtonDown += PackIcon_PreviewMouseLeftButtonDown;
                    painel.Children.Add(novaGrid);
                    novaGrid.Children.Add(binicon);
                    novaGrid.Children.Add(newTextBox);
                    novaGrid.Children.Add(newTextBox2);
                    novaGrid.Children.Add(icon);

                    if (flag % 2 == 0)
                    {
                        var converter = new System.Windows.Media.BrushConverter();
                        var brush     = (Brush)converter.ConvertFromString("#FFD0EDED");
                        novaGrid.Background = brush;
                    }
                    else
                    {
                        var converter = new System.Windows.Media.BrushConverter();
                        var brush     = (Brush)converter.ConvertFromString("#FFC2DCDC");
                        novaGrid.Background = brush;
                    }
                    flag++;
                }
            }
        }
Beispiel #8
0
        public favoritesPage()
        {
            InitializeComponent();
            LoginPage logPage = new LoginPage();

            currentUser = logPage.getCurrentUser();


            foreach (int service_id in currentUser.favoritos)
            {
                servicePage ServicePage = new servicePage(service_id, this);
                ServiceInfo servico     = ServicePage.getCurrentService();
                Grid        novaGrid    = new Grid();
                novaGrid.Height = 50;
                ColumnDefinition colDef0 = new ColumnDefinition();
                colDef0.Width = new GridLength(30, GridUnitType.Star);
                ColumnDefinition colDef1 = new ColumnDefinition();
                colDef1.Width = new GridLength(40, GridUnitType.Star);
                ColumnDefinition colDef2 = new ColumnDefinition();
                colDef2.Width = new GridLength(130, GridUnitType.Star);
                ColumnDefinition colDef3 = new ColumnDefinition();
                colDef3.Width = new GridLength(100, GridUnitType.Star);
                ColumnDefinition colDef4 = new ColumnDefinition();
                colDef4.Width = new GridLength(40, GridUnitType.Star);
                ColumnDefinition colDef5 = new ColumnDefinition();
                colDef5.Width = new GridLength(30, GridUnitType.Star);
                novaGrid.ColumnDefinitions.Add(colDef0);
                novaGrid.ColumnDefinitions.Add(colDef1);
                novaGrid.ColumnDefinitions.Add(colDef2);
                novaGrid.ColumnDefinitions.Add(colDef3);
                novaGrid.ColumnDefinitions.Add(colDef4);
                novaGrid.ColumnDefinitions.Add(colDef5);
                var bin = new nova {
                    Kind = PackIconKind.Bin
                };
                bin.Width               = 25;
                bin.Height              = 25;
                bin.VerticalAlignment   = VerticalAlignment.Center;
                bin.HorizontalAlignment = HorizontalAlignment.Left;
                bin.SetValue(Grid.ColumnProperty, 1);
                bin.Name = "bin" + service_id;
                bin.PreviewMouseLeftButtonDown += BinIcon_PreviewMouseLeftButtonDown;
                TextBlock newTextBox = new TextBlock();
                newTextBox.Text = servico.tipo;
                newTextBox.VerticalAlignment = VerticalAlignment.Center;
                newTextBox.FontSize          = 16;
                newTextBox.SetValue(Grid.ColumnProperty, 2);
                TextBlock newTextBox2 = new TextBlock();
                newTextBox2.Text              = servico.instituto_nome;
                newTextBox2.FontSize          = 16;
                newTextBox2.VerticalAlignment = VerticalAlignment.Center;
                newTextBox2.SetValue(Grid.ColumnProperty, 3);
                var icon = new nova {
                    Kind = PackIconKind.ArrowRight
                };
                icon.Width               = 25;
                icon.Height              = 25;
                icon.VerticalAlignment   = VerticalAlignment.Center;
                icon.HorizontalAlignment = HorizontalAlignment.Right;
                icon.SetValue(Grid.ColumnProperty, 4);
                icon.Name = "seta" + service_id;
                icon.PreviewMouseLeftButtonDown += PackIcon_PreviewMouseLeftButtonDown;
                painel.Children.Add(novaGrid);
                novaGrid.Children.Add(bin);
                novaGrid.Children.Add(newTextBox);
                novaGrid.Children.Add(newTextBox2);
                novaGrid.Children.Add(icon);

                if (flag % 2 == 0)
                {
                    var converter = new System.Windows.Media.BrushConverter();
                    var brush     = (Brush)converter.ConvertFromString("#FFD0EDED");
                    novaGrid.Background = brush;
                }
                else
                {
                    var converter = new System.Windows.Media.BrushConverter();
                    var brush     = (Brush)converter.ConvertFromString("#FFC2DCDC");
                    novaGrid.Background = brush;
                }
                flag++;
            }
        }
Beispiel #9
0
        public institutoPage(int id, Page paginaanterior)
        {
            if (id == -1)
            {
                return;
            }
            InitializeComponent();
            paginaAnterior = paginaanterior;
            Console.WriteLine(paginaAnterior);
            List<InstitutoInfo> institutos = readInstituto();
            foreach (InstitutoInfo i in institutos)
            {
                if (i.id == id)
                {
                    currentInstituto = i;
                }
            }

            nomeInstituto.Content = currentInstituto.nome;
            rating.Content = currentInstituto.rating;

            descricaoServico.Document.Blocks.Clear();
            descricaoServico.Document.Blocks.Add(new Paragraph(new Run(currentInstituto.descricao)) { FontSize = 18 });

            if (currentInstituto.foto != "null")
            {
                ImageBrush myBrush = new ImageBrush();
                Image image = new Image();
                image.Source = new BitmapImage(
                    new Uri(
                       BaseUriHelper.GetBaseUri(this), currentInstituto.foto));
                myBrush.ImageSource = image.Source;
                userfotogrid.Background = myBrush;
            }

            int flag = 0;

            LoginPage logPage = new LoginPage();
            currentUser = logPage.getCurrentUser();

            foreach (int service_id in currentInstituto.servicos_id)
            {
                servicePage ServicePage = new servicePage(service_id,paginaAnterior);
                ServiceInfo servico = ServicePage.getCurrentService();
                Grid novaGrid = new Grid();
                novaGrid.Height = 40;
                ColumnDefinition colDef0 = new ColumnDefinition();
                colDef0.Width = new GridLength(15, GridUnitType.Star);
                ColumnDefinition colDef1 = new ColumnDefinition();
                colDef1.Width = new GridLength(30, GridUnitType.Star);
                ColumnDefinition colDef2 = new ColumnDefinition();
                colDef2.Width = new GridLength(160, GridUnitType.Star);
                ColumnDefinition colDef3 = new ColumnDefinition();
                colDef3.Width = new GridLength(85, GridUnitType.Star);
                ColumnDefinition colDef4 = new ColumnDefinition();
                colDef4.Width = new GridLength(50, GridUnitType.Star);
                novaGrid.ColumnDefinitions.Add(colDef0);
                novaGrid.ColumnDefinitions.Add(colDef1);
                novaGrid.ColumnDefinitions.Add(colDef2);
                novaGrid.ColumnDefinitions.Add(colDef3);
                novaGrid.ColumnDefinitions.Add(colDef4);
                var icon = new nova { Kind = PackIconKind.StarBorder };
                foreach (int i in currentUser.favoritos)
                {
                    if (i == service_id)
                    {
                        icon = new nova { Kind = PackIconKind.Star };
                    }
                }
                icon.Width = 30;
                icon.Height = 45;
                icon.SetValue(Grid.ColumnProperty, 1);
                icon.Name = "seta" + service_id;
                icon.PreviewMouseLeftButtonDown += FavIcon_PreviewMouseLeftButtonDown;
                nova2 novo = new nova2();
                novo.SetValue(Grid.ColumnProperty, 1);
                novo.Width = 30;
                novo.Height = 45;
                novo.Opacity = 0;
                novaGrid.Children.Add(novo);
                novo.Name = "seta" + service_id;
                novo.PreviewMouseLeftButtonDown += FavIcon_PreviewMouseLeftButtonDown;
                TextBlock newTextBox = new TextBlock();
                newTextBox.Text = servico.tipo;
                newTextBox.VerticalAlignment = VerticalAlignment.Center;
                newTextBox.FontSize = 18;
                newTextBox.Margin = new Thickness(10, 10, 0, 0);
                newTextBox.SetValue(Grid.ColumnProperty, 2);
                TextBlock newTextBox2 = new TextBlock();
                newTextBox2.Text = servico.preco + "  €";
                newTextBox2.FontSize = 18;
                newTextBox2.Margin = new Thickness(10, 10, 0, 0);
                newTextBox2.VerticalAlignment = VerticalAlignment.Center;
                newTextBox2.SetValue(Grid.ColumnProperty, 3);
                var icon2 = new nova { Kind = PackIconKind.ArrowRight };
                icon2.Width = 25;
                icon2.Height = 25;
                icon2.VerticalAlignment = VerticalAlignment.Center;
                icon2.HorizontalAlignment = HorizontalAlignment.Left;
                icon2.SetValue(Grid.ColumnProperty, 4);
                icon2.Name = "seta" + service_id;
                icon2.PreviewMouseLeftButtonDown += PackIcon_PreviewMouseLeftButtonDown;
                painel.Children.Add(novaGrid);
                novaGrid.Children.Add(newTextBox);
                novaGrid.Children.Add(newTextBox2);
                novaGrid.Children.Add(icon);
                novaGrid.Children.Add(icon2);

                if (flag % 2 == 0)
                {
                    var converter = new System.Windows.Media.BrushConverter();
                    var brush = (Brush)converter.ConvertFromString("#FFD0EDED");
                    novaGrid.Background = brush;
                }
                else
                {
                    var converter = new System.Windows.Media.BrushConverter();
                    var brush = (Brush)converter.ConvertFromString("#FFC2DCDC");
                    novaGrid.Background = brush;
                }
                flag++;
            }
            Console.WriteLine(paginaAnterior);
        }