示例#1
0
        private void EditIcon_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            int id = Convert.ToInt32(sender.ToString().Split("Edit")[1]);
            registarInstituto pagina = new registarInstituto(id);

            this.NavigationService.Navigate(pagina);
        }
示例#2
0
 public adicionarServico(registarInstituto pagina, int id_instituto, string nomeServico)
 {
     InitializeComponent();
     institutoPage = pagina;
     loadInfo();
     if (id_instituto > 0)
     {
         this.id_instituto = id_instituto;
         this.nomeServico  = nomeServico;
         foreach (InstitutoInfo i in listaInstitutos)
         {
             if (i.id == id_instituto)
             {
                 foreach (ServiceInfo s in listaServicos)
                 {
                     if (s.tipo.Equals(nomeServico) && s.instituto_id == id_instituto)
                     {
                         currentServico = s;
                         nomeBox.Document.Blocks.Clear();
                         nomeBox.Document.Blocks.Add(new Paragraph(new Run(currentServico.tipo))
                         {
                             Foreground = Brushes.Gray, FontSize = 12
                         });
                         precoBox.Document.Blocks.Clear();
                         precoBox.Document.Blocks.Add(new Paragraph(new Run(currentServico.preco))
                         {
                             Foreground = Brushes.Gray, FontSize = 12
                         });
                         descricaoBox.Document.Blocks.Clear();
                         descricaoBox.Document.Blocks.Add(new Paragraph(new Run(currentServico.descricao))
                         {
                             Foreground = Brushes.Gray, FontSize = 12
                         });
                         if (currentServico.foto != "null")
                         {
                             ImageBrush myBrush = new ImageBrush();
                             Image      image   = new Image();
                             image.Source = new BitmapImage(
                                 new Uri(
                                     BaseUriHelper.GetBaseUri(this), currentServico.foto));
                             myBrush.ImageSource        = image.Source;
                             servicofotogrid.Background = myBrush;
                         }
                     }
                 }
             }
         }
     }
 }
示例#3
0
        private void addInstituto_Click(object sender, RoutedEventArgs e)
        {
            registarInstituto pagina = new registarInstituto(-1);

            this.NavigationService.Navigate(pagina);
        }