private async void SoruDetay_Activated(CoreApplicationView sender, Windows.ApplicationModel.Activation.IActivatedEventArgs args)
        {
#if WINDOWS_PHONE_APP
            FileOpenPickerContinuationEventArgs param = args as FileOpenPickerContinuationEventArgs;

            if (param != null)
            {
                if (param.Files.Count == 0)
                {
                    return;
                }
                view.Activated -= SoruDetay_Activated;
                file            = param.Files[0];
                if (file != null)
                {
                    var data = await FileHelper.ReadFile(file);

                    var result = await App.APIService.ResimGuncelle(data, file.Name);

                    if (result != null)
                    {
                        await Mesaj.MesajGoster(result.Mesaj);
                    }
                }
            }
#endif
        }
        async Task Guncelle()
        {
            try
            {
                progressBar.IsActive = true;
                var guncellemesonucu = await App.APIService.ProfilGuncelle(adsoyad.Text, email.Text, txtpassword.Password);

                if (guncellemesonucu.Sonuc == true)
                {
                    await Mesaj.MesajGoster(guncellemesonucu.Mesaj);

                    await GirisPage.CikisYap();
                }
                else
                {
                    await Mesaj.MesajGoster(guncellemesonucu.Mesaj);
                }
            }
            catch (Exception ex)
            {
                await App.APIService.Log("Profil Güncelleme Hatası. Detaylar: " + ex.Message);
            }
            finally
            {
                progressBar.IsActive = false;
            }
        }
示例#3
0
        async Task Giris()
        {
            try
            {
                if (string.IsNullOrEmpty(txtKullaniciAdi.Text) | string.IsNullOrEmpty(txtSifre.Password))
                {
                    await Mesaj.MesajGoster("Lütfen Kullanıcı Adınızı ve Şifrenizi Yazınız!");
                }
                progressBar.IsActive = true;
                Uye            = null;
                App.APIService = new DataClient();
                var giris = await App.APIService.Giris(txtKullaniciAdi.Text, txtSifre.Password);

                if (giris != null && giris.Sonuc)
                {
                    SettingsHelper.SaveSetting("KullaniciAdi", txtKullaniciAdi.Text);
                    SettingsHelper.SaveSetting("Sifre", txtSifre.Password);
                    SettingsHelper.SaveSetting("BeniHatirla", true.ToString());
                    Uye = JsonConvert.DeserializeObject <User>(JsonConvert.SerializeObject(giris.Data));
                    Navigator.CurrentFrame.Navigate(typeof(HosgeldinPage), Uye);
                }
                else
                {
                    await Mesaj.MesajGoster(giris.Mesaj); //geldim
                }
            }
            catch (Exception ex)
            {
                await App.APIService.Log("Giriş Sayfası Login Hatası Detaylar: " + ex.Message);
            }
            finally
            {
                progressBar.IsActive = false;
            }
        }
示例#4
0
        async Task Gonder()
        {
            try {
                progressBar.IsActive = true;
                if (!string.IsNullOrEmpty(GirisPage.Uye.UyeID) && !string.IsNullOrEmpty(soru.SoruID) && txtYorum.Text != null)
                {
                    ResultContext result;
                    if (resimfile1 == null)
                    {
                        result = await App.APIService.YorumEkle(soru.SoruID, txtYorum.Text, null, null);
                    }
                    else
                    {
                        var YorumResim = await FileHelper.ReadFile(resimfile1);

                        result = await App.APIService.YorumEkle(soru.SoruID, txtYorum.Text, YorumResim, resimfile1.Name);
                    }
                    await Mesaj.MesajGoster(result.Mesaj);

                    if (result.Sonuc)
                    {
                        await YorumList();
                    }
                }
                else
                {
                    await Mesaj.MesajGoster("Dosya seçilirken hata oluştu");
                }
                progressBar.IsActive = false;
            }
            catch (Exception ex)
            {
                await App.APIService.Log("Gönderme Hatası. Detaylar: " + ex.Message);
            }
        }
示例#5
0
        async void Gonder()
        {
            try
            {
                if (!string.IsNullOrEmpty(this.Baslik.Text) && !string.IsNullOrEmpty(this.Aciklama.Text) && resimfile1 != null && resimfile2 != null)
                {
                    progressBar.IsActive = true;
                    var resim1data = await FileHelper.ReadFile(resimfile1);

                    var resim2data = await FileHelper.ReadFile(resimfile2);

                    var result = await App.APIService.SoruEkle(resim1data, resimfile1.Name, resim2data, resimfile2.Name, Baslik.Text, Aciklama.Text, comboBox.SelectedValue.ToString());

                    await Mesaj.MesajGoster(result.Mesaj);

                    Frame.Navigate(typeof(HosgeldinPage));
                    progressBar.IsActive = true;
                }
                else
                {
                    await Mesaj.MesajGoster("Dosya seçilirken hata oluştu");
                }
            }
            catch (Exception ex)
            {
                await App.APIService.Log("Soru Ekle Hatası. Detaylar: " + ex.Message);
            }
        }
示例#6
0
        private async void Gonder_Click(object sender, RoutedEventArgs e)
        {
            try {
                var sonuc = await App.APIService.SifremiUnuttum(txtEmail.Text);

                if (sonuc != null)
                {
                    await Mesaj.MesajGoster(sonuc.Mesaj);
                }
                if (Navigator.CurrentFrame.CanGoBack)
                {
                    Navigator.CurrentFrame.GoBack();
                }
            }
            catch (Exception ex)
            {
                await App.APIService.Log("Şifremi Unuttum Hatası. Detaylar: " + ex.Message);
            }
        }
        private async void ProfileResimGuncelle_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                await Mesaj.Soru("Profil Resminizi Güncellemek İstiyor Musunuz?", async (sndr) =>
                {
                    view = CoreApplication.GetCurrentView();
                    FileOpenPicker openPicker         = new FileOpenPicker();
                    openPicker.ViewMode               = PickerViewMode.Thumbnail;
                    openPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
                    openPicker.FileTypeFilter.Add(".jpg");
                    openPicker.FileTypeFilter.Add(".jpeg");
                    openPicker.FileTypeFilter.Add(".png");
#if WINDOWS_PHONE_APP
                    view.Activated += SoruDetay_Activated;
                    DeviceType      = 1;
                    openPicker.PickSingleFileAndContinue();
#else
                    DeviceType = 2;
                    file       = await openPicker.PickSingleFileAsync();
#endif
                    if (DeviceType == 2 && file != null)
                    {
                        var data   = await FileHelper.ReadFile(file);
                        var result = await App.APIService.ResimGuncelle(data, file.Name);
                        if (result != null)
                        {
                            await Mesaj.MesajGoster("Dosya seçilirken hata oluştu");
                        }
                    }
                    else if (DeviceType == 2)
                    {
                        await Mesaj.MesajGoster("Dosya seçilirken hata oluştu");
                    }
                });
            }
            catch (Exception ex)
            {
                await App.APIService.Log("Profil Resim Güncelleme Hatası. Detaylar: " + ex.Message);
            }
        }
        async Task KayitOl()
        {
            progressBar.IsActive = true;
            if (kontrol.IsChecked == false)
            {
                await Mesaj.MesajGoster("Lütfen Kullanım Koşullarını Kabul Edin");

                return;
            }
            else if (string.IsNullOrEmpty(this.txtUsername.Text))
            {
                await Mesaj.MesajGoster("Bir Kullanıcı Adı Girmelisiniz");

                return;
            }
            else if (string.IsNullOrEmpty(this.txtPassword.Password.ToString()))
            {
                await Mesaj.MesajGoster("Bir Şifre Belirlemelisiniz");

                return;
            }
            else if (string.IsNullOrEmpty(this.txtConPassword.Password.ToString()))
            {
                await Mesaj.MesajGoster("Lütfen Şifre Doğrulama Kısmını Doldurun");

                return;
            }
            else if (txtPassword.Password.ToString() != this.txtConPassword.Password.ToString())
            {
                await Mesaj.MesajGoster("Şifreleriniz Eşleşmiyor");

                return;
            }
            else if (string.IsNullOrEmpty(this.txtName.Text))
            {
                await Mesaj.MesajGoster("Lütfen Tam Adınızı Girin");

                return;
            }

            else if (string.IsNullOrEmpty(this.txtEmail.Text))
            {
                await Mesaj.MesajGoster("Lütfen Email Adresinizi Girin");

                return;
            }
            try
            {
                var uyeliksonucu = await App.APIService.Kayit(txtUsername.Text, txtPassword.Password, txtName.Text, txtEmail.Text);

                if (uyeliksonucu.Sonuc == true)
                {
                    await Mesaj.MesajGoster(uyeliksonucu.Mesaj);

                    if (Navigator.CurrentFrame.CanGoBack)
                    {
                        Navigator.CurrentFrame.GoBack();
                    }
                }
                else
                {
                    await Mesaj.MesajGoster(uyeliksonucu.Mesaj);
                }
            }
            catch (Exception ex)
            {
                await App.APIService.Log("Kayıt Hatası. Detaylar: " + ex.Message);
            }
            finally
            {
                progressBar.IsActive = false;
            }
        }
示例#9
0
        async Task ProfilDoldur(string UyeID = "")
        {
            try
            {
                ResultContext listSorular = null;
                if (!string.IsNullOrEmpty(UyeID))
                {
                    var uyeSonuc = await App.APIService.UyeProfil(UyeID);

                    if (uyeSonuc != null && uyeSonuc.Sonuc)
                    {
                        var uye = JsonConvert.DeserializeObject <User>(JsonConvert.SerializeObject(uyeSonuc.Data));
                        if (uye == null)
                        {
                            await Mesaj.MesajGoster("Hata Oluştu");

                            if (Navigator.CurrentFrame.CanGoBack)
                            {
                                Navigator.CurrentFrame.GoBack();
                            }
                        }
                        listSorular = await App.APIService.Sorular("", "", UyeID);

                        adsoyad.Text    = uye.AdiSoyadi;
                        nickname.Text   = "@" + uye.KullaniciAdi;
                        imgProfile.Fill = new ImageBrush()
                        {
                            ImageSource = await FileHelper.ByteToImage(await FileHelper.GetDataFromUri(new Uri(uye.ProfileImage, UriKind.Absolute)))
                        };
                    }
                    else if (uyeSonuc != null)
                    {
                        await Mesaj.MesajGoster(uyeSonuc.Mesaj);

                        if (Navigator.CurrentFrame.CanGoBack)
                        {
                            Navigator.CurrentFrame.GoBack();
                        }
                    }
                }
                else if (GirisPage.Uye.UyeID != null)
                {
                    listSorular = await App.APIService.Sorular("", "", GirisPage.Uye.UyeID);

                    adsoyad.Text    = GirisPage.Uye.AdiSoyadi;
                    nickname.Text   = "@" + GirisPage.Uye.KullaniciAdi;
                    imgProfile.Fill = new ImageBrush()
                    {
                        ImageSource = await FileHelper.ByteToImage(await FileHelper.GetDataFromUri(new Uri(GirisPage.Uye.ProfileImage, UriKind.Absolute)))
                    };
                }
                else
                {
                    await Mesaj.MesajGoster("Hata var");
                }
                if (listSorular != null && listSorular.Sonuc)
                {
                    gridView.ItemsSource = JsonConvert.DeserializeObject <List <Soru> >(JsonConvert.SerializeObject(listSorular.Data));
                }
            }
            catch (Exception ex)
            {
                await App.APIService.Log("Üye Profili Hatası. Detaylar: " + ex.Message);
            }
        }