void ReleaseDesignerOutlets()
 {
     if (BirthdayOccupation != null)
     {
         BirthdayOccupation.Dispose();
         BirthdayOccupation = null;
     }
     if (Email != null)
     {
         Email.Dispose();
         Email = null;
     }
     if (Frequency != null)
     {
         Frequency.Dispose();
         Frequency = null;
     }
     if (FromWhere != null)
     {
         FromWhere.Dispose();
         FromWhere = null;
     }
     if (NameLabel != null)
     {
         NameLabel.Dispose();
         NameLabel = null;
     }
     if (PartiaOkreg != null)
     {
         PartiaOkreg.Dispose();
         PartiaOkreg = null;
     }
     if (PoselImage != null)
     {
         PoselImage.Dispose();
         PoselImage = null;
     }
     if (Telephone != null)
     {
         Telephone.Dispose();
         Telephone = null;
     }
     if (UstawyUchwaly != null)
     {
         UstawyUchwaly.Dispose();
         UstawyUchwaly = null;
     }
 }
Ejemplo n.º 2
0
        private async void GetPoselData()
        {
            IPeopleRepository repository = PeopleRepository.Instance;

            try {
                posel = await repository.GetPosel((ParentViewController as PoselController).PoselID);



                BiuroPoselskie biuroGlowne = posel.Biura.Where(item => item.Podstawowe.Equals("1")).FirstOrDefault();

                if (biuroGlowne != null)
                {
                    String phone = "";
                    try {
                        String[] phones    = biuroGlowne.Telefon.Split('f');
                        String[] phone1    = phones[0].Split(' ');
                        String   firstpart = phones[1].Split('(')[1].Split(')')[0];
                        phone = String.Concat(firstpart, " ", phone1[2].Replace('-', ' '));
                    }catch (Exception e) {
                        System.Diagnostics.Debug.WriteLine(e.Message);
                        phone = biuroGlowne.Telefon;
                    }
                    Telephone.Text = phone;

                    /*
                     * Telephone.Click += delegate {
                     *      var uri = Android.Net.Uri.Parse ("tel:" + phone.Replace(" ", string.Empty));
                     *      var intent = new Intent (Intent.ActionView, uri);
                     *      StartActivity (intent);
                     * };
                     */// TODO : Telephone click

                    Email.Text = biuroGlowne.Email;
                }


                NameLabel.Text          = posel.Imie + " " + posel.Nazwisko;
                BirthdayOccupation.Text = String.Concat(posel.DataUrodzenia, ". ", posel.Zawod);
                PartiaOkreg.Text        = String.Concat(posel.SejmKlubyNazwa, ". Okręg nr: ", posel.OkregWyborczyNumer);
                UstawyUchwaly.Text      = String.Concat(
                    "Ustawy: ", posel.LiczbaProjektowUstaw.ToString(),
                    "   Uchwały: ", posel.LiczbaProjektowUchwal.ToString()
                    );
                Frequency.Text = String.Concat("Frekwencja: ", posel.Frekwencja.ToString(), "%");
                FromWhere.Text = posel.MiejsceZamieszkania;

                ParentViewController.Title = NameLabel.Text;
                var imgUrl = posel.GetWebURL();
                PoselImage.SetImage(
                    url: new NSUrl(imgUrl),
                    placeholder: UIImage.FromBundle("ImageLoad")
                    );

                loadingOverlay.Hide();
            } catch (ApiRequestException ex) {
                DisplayError(ex.Message);
                System.Diagnostics.Debug.WriteLine(ex.Message);
            } catch (Exception exc) {
                System.Diagnostics.Debug.WriteLine(exc.Message);
            } finally {
                loadingOverlay.Hide();
            }
        }