bool HesabiSilApi() { WebService webService = new WebService(); var Mee = DataBase.MEMBER_DATA_GETIR()[0]; UpdateUserDto UpdateUserDto1 = new UpdateUserDto() { activated = false, birthDay = Convert.ToDateTime(Mee.birthDayDate).ToString("yyyy-MM-dd'T'HH:mm:ssZ"), gender = Mee.gender, userJob = Mee.userJob }; string jsonString = JsonConvert.SerializeObject(UpdateUserDto1); var Donus = webService.ServisIslem("users/update", jsonString); if (Donus != "Hata") { return(true); } else { AlertHelper.AlertGoster("Bir sorun oluştu", this); return(false); } }
public void PaketSatinAlmaUzakDBAyarla() { BuyLicenceDTO buyCreditDTO = new BuyLicenceDTO() { count = sBoostGoal, credit = 0, licenceType = "SUPER_BOOST" }; WebService webService = new WebService(); string jsonString = JsonConvert.SerializeObject(buyCreditDTO); var Donus = webService.ServisIslem("licences/buy", jsonString); if (Donus != "Hata") { AlertHelper.AlertGoster(sBoostGoal + " Süper Boost satın alındı.", this.Activity); PrivateProfileBaseActivity1.GetUserLicence(); this.Dismiss(); } else { AlertHelper.AlertGoster("Bir sorun oluştu. Lütfen tekrar deneyin.", this.Activity); this.Dismiss(); } }
void SosyalKullaniciKaydet(string AdText, string SoyadText, string Sifre, string email) { WebService webService = new WebService(); KayitIcinRoot kayitIcinRoot = new KayitIcinRoot() { firstName = AdText.Trim(), lastName = SoyadText.Trim(), password = Sifre, login = email, email = email }; string jsonString = JsonConvert.SerializeObject(kayitIcinRoot); var Responsee = webService.ServisIslem("register", jsonString, true); if (Responsee != "Hata") { GirisYapMetod(email, Sifre); } else { AlertHelper.AlertGoster("Bir sorun oluştu lütfen internet bağlantınızı kontrol edin.", this); return; } }
void FavoriIslemleri(string Message) { new System.Threading.Thread(new System.Threading.ThreadStart(delegate { var MeID = DataBase.MEMBER_DATA_GETIR()[0].id; WebService webService = new WebService(); FavoriDTO favoriDTO = new FavoriDTO() { userId = MeID, favUserId = SecilenKisi.SecilenKisiDTO.id }; string jsonString = JsonConvert.SerializeObject(favoriDTO); var Donus = webService.ServisIslem("users/fav", jsonString); if (Donus != "Hata") { RunOnUiThread(delegate { AlertHelper.AlertGoster(Message, this); }); GetFavorite(); return; } })).Start(); }
void PopulerLokasyonlariGetir() { WebService webService = new WebService(); var Donus = webService.OkuGetir("locations"); if (Donus != null) { var aa = Donus.ToString(); favorilerRecyclerViewDataModels = Newtonsoft.Json.JsonConvert.DeserializeObject <List <PopulerRecyclerViewDataModel> >(Donus.ToString()); if (favorilerRecyclerViewDataModels.Count > 0) { favorilerRecyclerViewDataModels = favorilerRecyclerViewDataModels.OrderBy(o => o.allUserCheckIn).ToList();//Checkin sayısına göre sıralıyor. favorilerRecyclerViewDataModels.Reverse(); this.Activity.RunOnUiThread(() => { boldd = Typeface.CreateFromAsset(this.Activity.Assets, "Fonts/muliBold.ttf"); normall = Typeface.CreateFromAsset(this.Activity.Assets, "Fonts/muliRegular.ttf"); mViewAdapter = new PopulerRecyclerViewAdapter(favorilerRecyclerViewDataModels, (Android.Support.V7.App.AppCompatActivity) this.Activity, this.normall, this.boldd); mRecyclerView.HasFixedSize = true; mLayoutManager = new LinearLayoutManager(this.Activity); mRecyclerView.SetLayoutManager(mLayoutManager); mRecyclerView.SetAdapter(mViewAdapter); mViewAdapter.ItemClick += MViewAdapter_ItemClick; ShowLoading.Hide(); }); } else { AlertHelper.AlertGoster("Popüler lokasyon bulunamadı...", this.Activity); ShowLoading.Hide(); } } else { ShowLoading.Hide(); } }
void LokasyonRate(string Ratee) { if (Ratee != "0") { WebService webService = new WebService(); var Donus = webService.ServisIslem("locations/rating/" + SecilenLokasyonn.LokID, Ratee); if (Donus != "Hata") { AlertHelper.AlertGoster("Değerlendirme için teşekkürler!", this.Activity); LokayonDetayBaseActivity1.RatingDurumYenile(); return; } else { AlertHelper.AlertGoster("Bir sorun oluştu!", this.Activity); return; } } else { AlertHelper.AlertGoster("Lütfen bir puan belirtin", this.Activity); return; } }
void GetUserInfo(string UserID, string keyy) { WebService webService = new WebService(); var Donus2 = webService.OkuGetir("blocked-user/block-list"); if (Donus2 != null) { var EngelliKul = Newtonsoft.Json.JsonConvert.DeserializeObject <List <EngelliKullanicilarDTO> >(Donus2.ToString()); if (EngelliKul.Count > 0) { this.Activity.RunOnUiThread(() => { var boldd = Typeface.CreateFromAsset(this.Activity.Assets, "Fonts/muliBold.ttf"); Engelliler = EngelliKul[0].blockUserId; ShowLoading.Hide(); }); } } var Donus = webService.OkuGetir("users/" + UserID); if (Donus != null) { var Userrr = Newtonsoft.Json.JsonConvert.DeserializeObject <MEMBER_DATA>(Donus.ToString()); MesajlarIcinSecilenKullanici.Kullanici = Userrr; MesajlarIcinSecilenKullanici.key = keyy; if (Engelliler == Userrr.id) { AlertHelper.AlertGoster("Bu kullanıcıyı engellediğiniz için mesaj atamazsınız!", this.Activity); } else { this.Activity.StartActivity(typeof(ChatBaseActivity)); } } }
void SonMesajlariGetir() { WebService webService = new WebService(); var Donus = webService.OkuGetir("chats/user"); if (Donus != null) { var MeID = DataBase.MEMBER_DATA_GETIR()[0].id; var aa = Donus.ToString(); mFriends = Newtonsoft.Json.JsonConvert.DeserializeObject <List <IsteklerListViewDataModel> >(Donus.ToString()); mFriends = mFriends.FindAll(item => item.request == true); //Bana Gelen İstekler; if (mFriends.Count > 0) { mFriends.Where(item => item.receiverId == MeID).ToList().ForEach(item2 => item2.unreadMessageCount = 0); SonMesajKiminKontrolunuYap(); SaveKeys(); this.Activity.RunOnUiThread(() => { mFriends.Sort((x, y) => DateTime.Compare(x.lastModifiedDate, y.lastModifiedDate)); mFriends.Reverse(); mAdapter = new IsteklerListViewAdapter(this.Activity, Resource.Layout.MesajlarCustomContent, mFriends, FavorileriCagir()); Liste.Adapter = mAdapter; ShowLoading.Hide(); BoostUygula(); }); } else { AlertHelper.AlertGoster("Hiç Mesaj Bulunamadı...", this.Activity); ShowLoading.Hide(); } } else { ShowLoading.Hide(); } }
private void Downloader_OnFileDownloaded(object sender, DownloadEventArgs e) { this.RunOnUiThread(delegate() { ShowLoading.Hide(); }); if (e.FileSaved)//Başarılı { ClipboardManager clipboard = (ClipboardManager)GetSystemService(Context.ClipboardService); ClipData clip = ClipData.NewPlainText(SecilenSablonDTO.SecilenSablon.id, SecilenSablonDTO.SecilenSablon.postText); clipboard.PrimaryClip = (clip); var dir = Android.OS.Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryDcim).AbsolutePath; var pathh = Path.Combine(dir, "SharedMedias"); string pathh2 = Path.Combine(pathh, Path.GetFileName("https://contentoapp.co/app/" + SecilenSablonDTO.SecilenSablon.afterMediaPath)); Java.IO.File media = new Java.IO.File(pathh2); Android.Net.Uri uri = Android.Net.Uri.FromFile(media); //Android.Net.Uri.Builder Builderr = new Android.Net.Uri.Builder(); //Android.Net.Uri newUri; ////if (DahaOnceEklenenVarmi[i].isVideo) ////{ //// newUri = Builderr.Scheme("content").Path(DahaOnceEklenenVarmi[i].MediaUri).Authority("media").EncodedAuthority("media").Build(); ////} ////else ////{ //// newUri = Builderr.Scheme("content").Path(DahaOnceEklenenVarmi[i].MediaUri).Authority("com.android.providers.media.documents").EncodedAuthority("com.android.providers.media.documents").Build(); ////} //newUri = Android.Net.Uri.Parse(pathh2); byte[] ImageData = File.ReadAllBytes(uri.Path); string base64String = Convert.ToBase64String(ImageData); Intent shareIntent = new Intent(Intent.ActionSend); shareIntent.SetType(SecilenSablonDTO.SecilenSablon.video ? "video/*" : "image/*"); shareIntent.AddFlags(ActivityFlags.NewTask);//FLAG_ACTIVITY_NEW_TASK shareIntent.PutExtra(Intent.ExtraStream, uri); this.GrantUriPermission("com.instagram.android", uri, ActivityFlags.GrantReadUriPermission); //shareIntent.PutExtra(Intent.ExtraText, SecilenSablonDTO.SecilenSablon.postText); try { shareIntent.SetPackage("com.instagram.android"); this.StartActivity(shareIntent); this.RunOnUiThread(delegate() { Toast.MakeText(this, "Paylaşım metni panayo kopyalandı! Paylaşım esnasında yapıştırmayı unutmayın.", ToastLength.Long).Show(); }); } catch { this.RunOnUiThread(delegate() { Toast.MakeText(this, "Instagram uygulaması cihazınızda yüklü değil!", ToastLength.Long).Show(); }); } } else { this.RunOnUiThread(delegate() { AlertHelper.AlertGoster("Bir sorunla karşılaşıldı!", this); }); return; } }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View Vieww = inflater.Inflate(Resource.Layout.TestSoruParcaFragment, container, false); CurrentSoruNumber = Vieww.FindViewById <TextView>(Resource.Id.curentsorunumber); DersAdiText = Vieww.FindViewById <TextView>(Resource.Id.derstext); SoruText = Vieww.FindViewById <TextView>(Resource.Id.sorutext); Answer_A_Text = Vieww.FindViewById <TextView>(Resource.Id.answer_a); Answer_B_Text = Vieww.FindViewById <TextView>(Resource.Id.answer_b); Answer_C_Text = Vieww.FindViewById <TextView>(Resource.Id.answer_c); Answer_D_Text = Vieww.FindViewById <TextView>(Resource.Id.answer_d); Answer_E_Text = Vieww.FindViewById <TextView>(Resource.Id.answer_e); Answer_A_Button = Vieww.FindViewById <Button>(Resource.Id.button_a); Answer_B_Button = Vieww.FindViewById <Button>(Resource.Id.button_b); Answer_C_Button = Vieww.FindViewById <Button>(Resource.Id.button_c); Answer_D_Button = Vieww.FindViewById <Button>(Resource.Id.button_d); Answer_E_Button = Vieww.FindViewById <Button>(Resource.Id.button_e); SoruImage = Vieww.FindViewById <ImageView>(Resource.Id.soruimage); Answer_A_Image = Vieww.FindViewById <ImageView>(Resource.Id.answer_image_a); Answer_B_Image = Vieww.FindViewById <ImageView>(Resource.Id.answer_image_b); Answer_C_Image = Vieww.FindViewById <ImageView>(Resource.Id.answer_image_c); Answer_D_Image = Vieww.FindViewById <ImageView>(Resource.Id.answer_image_d); Answer_E_Image = Vieww.FindViewById <ImageView>(Resource.Id.answer_image_e); Relative_A = Vieww.FindViewById <RelativeLayout>(Resource.Id.relative_a); Relative_B = Vieww.FindViewById <RelativeLayout>(Resource.Id.relative_b); Relative_C = Vieww.FindViewById <RelativeLayout>(Resource.Id.relative_c); Relative_D = Vieww.FindViewById <RelativeLayout>(Resource.Id.relative_d); Relative_E = Vieww.FindViewById <RelativeLayout>(Resource.Id.relative_e); if (SecilenTest.OlusanTest.userTestQuestions.Count <= 0) { AlertHelper.AlertGoster("Bu konuda soru bulunamadı!", this.Activity); this.Activity.Finish(); } else { DersAdiText.Text = SecilenTest.OlusanTest.userTestQuestions[QestionPosition].question.lessonName; CurrentSoruNumber.Text = "SORU " + (QestionPosition + 1).ToString() + "/" + SecilenTest.OlusanTest.questionCount.ToString(); SoruText.Text = SecilenTest.OlusanTest.userTestQuestions[QestionPosition].question.text; Answer_A_Text.Text = SecilenTest.OlusanTest.userTestQuestions[QestionPosition].question.answers[0].text; Answer_B_Text.Text = SecilenTest.OlusanTest.userTestQuestions[QestionPosition].question.answers[1].text; Answer_C_Text.Text = SecilenTest.OlusanTest.userTestQuestions[QestionPosition].question.answers[2].text; Answer_D_Text.Text = SecilenTest.OlusanTest.userTestQuestions[QestionPosition].question.answers[3].text; Answer_E_Text.Text = SecilenTest.OlusanTest.userTestQuestions[QestionPosition].question.answers[4].text; SoruCevapImageKontrol(); Answer_A_Button.Click += Answer_A_Button_Click; Answer_A_Text.Click += Answer_A_Button_Click; Answer_A_Image.Click += Answer_A_Button_Click; Relative_A.Click += Answer_A_Button_Click; Answer_B_Button.Click += Answer_B_Button_Click; Answer_B_Text.Click += Answer_B_Button_Click; Answer_B_Image.Click += Answer_B_Button_Click; Relative_B.Click += Answer_B_Button_Click; Answer_C_Button.Click += Answer_C_Button_Click1; Answer_C_Text.Click += Answer_C_Button_Click1; Answer_C_Image.Click += Answer_C_Button_Click1; Relative_C.Click += Answer_C_Button_Click1; Answer_D_Button.Click += Answer_D_Button_Click; Answer_D_Text.Click += Answer_D_Button_Click; Answer_D_Image.Click += Answer_D_Button_Click; Relative_D.Click += Answer_D_Button_Click; Answer_E_Button.Click += Answer_E_Button_Click; Answer_E_Text.Click += Answer_E_Button_Click; Answer_E_Image.Click += Answer_E_Button_Click; Relative_E.Click += Answer_E_Button_Click; } return(Vieww); }
void ws_OnMessage(object sender, MessageEventArgs e) { System.Console.WriteLine("-----------------------------"); System.Console.WriteLine(" ws_OnMessage says: " + e.Data); StompMessage msg = serializer.Deserialize(e.Data); if (msg.Command == StompFrame.CONNECTED) { // UpdateListBox(e.Data); OyunSocketHelper_Helper.WebSocket1 = ws; OyunSocketHelper_Helper.OyunSocketHelper1 = this; SubscribeStomp(); if (GelenDialog != null) { SendRegister(); } else { if (!RegisterFriend1) { SendRegisterWithFriend(); } } } else if (msg.Command == StompFrame.MESSAGE) { //RoomQuestionsDTO var MesajKanali = msg["destination"]; if (MesajKanali == "/user/" + MeId.login + "/start")//Soruları aldığımız yer { OyunSocketHelper_Helper.RoomQuestionsDTO1 = Newtonsoft.Json.JsonConvert.DeserializeObject <RoomQuestionsDTO>(msg.Body.ToString()); if (OyunSocketHelper_Helper.RoomQuestionsDTO1 != null) { //Oyunu Aç GelenBase.StartActivity(typeof(OyunSinavAlaniBaseActivity)); //Rasgele Oyunu İse if (GelenDialog != null) { GelenDialog.Dismiss(); } //Arkadaş Oyunu İse if (GelenBase is ArkadasOyunSec_Gonderen || GelenBase is ArkadasOyunSec_Gelen) { try { ShowLoading.Hide(); } catch { } GelenBase.Finish(); } } } else if (MesajKanali == "/user/" + MeId.login + "/index")//Kullanıcı çözülen soru son durum { var Icerik = Newtonsoft.Json.JsonConvert.DeserializeObject <SoketSendRegisterDTO>(msg.Body.ToString()); TestSinavAlaniHelperClass.OyunSinavAlaniBaseActivity1.OGuncelle(Convert.ToInt32(Icerik.userQuestionIndex)); } else if (MesajKanali == "/user/" + MeId.login + "/left")//Karsi kullanici oyunu terk etti { TestSinavAlaniHelperClass.OyunSinavAlaniBaseActivity1.KarsiKullaniciOyunuTerkEtti(); } else if (MesajKanali == "/user/" + MeId.login + "/ended")//Kari kullanici oyunu bitirdi { var Icerik = Newtonsoft.Json.JsonConvert.DeserializeObject <ChatRoom>(msg.Body.ToString()); if (Icerik != null) { if (Icerik.gameResult != null) { TestSinavAlaniHelperClass.OyunSinavAlaniBaseActivity1.KarsiKullaniciOyuınuBitirdi(Icerik); } } } else if (MesajKanali == "/user/" + MeId.login + "/denieded") // Arkadaş oyununda karı taraf isteği reddettiyse { if (GelenBase is ArkadasOyunSec_Gonderen || GelenBase is ArkadasOyunSec_Gelen) { AlertHelper.AlertGoster("Meydan Okuma Reddedildi!", GelenBase); GelenBase.Finish(); } } //Start => ChatRoom //Level => ChatUser Send yapılır //Index => ChatUser } }
void TestiKaydet() { ShowLoading.Show(this, "Sonuçlar Alınıyor..."); new System.Threading.Thread(new System.Threading.ThreadStart(delegate { WebService webService = new WebService(); SecilenTest.OlusanTest.finish = true; SecilenTest.OlusanTest.finishDate = DateTime.Now.ToString("yyyy-MM-dd'T'HH:mm:ssZ"); SecilenTest.OlusanTest.testTime = ((int)((TestSinavAlaniHelperClass.ToplamTestCozumSuresi - new DateTime(0)).TotalMinutes)).ToString(); string jsonString = JsonConvert.SerializeObject(SecilenTest.OlusanTest); var Donus = webService.ServisIslem("user-tests", jsonString, Method: "PUT", UsePoll: true); if (Donus != "Hata") { var sonuc = Donus.ToString(); var Icerik = Newtonsoft.Json.JsonConvert.DeserializeObject <OLUSTURULAN_TESTLER>(Donus.ToString()); if (Icerik != null) { var TestinLokalKaydi = DataBase.OLUSTURULAN_TESTLER_GETIR_TestID(SecilenTest.OlusanTest.id); if (TestinLokalKaydi.Count > 0) { Icerik.SorularJsonPath = TestinLokalKaydi[0].SorularJsonPath; Icerik.localid = TestinLokalKaydi[0].localid; Icerik.questionCount = TestinLokalKaydi[0].questionCount; if (DataBase.OLUSTURULAN_TESTLER_Guncelle(Icerik)) { this.RunOnUiThread(delegate { DogruSayi.Text = Icerik.correctCount.ToString(); YanlisSayi.Text = Icerik.wrongCount.ToString(); BosSayi.Text = Icerik.emptyCount.ToString(); DogruYuzde.Text = "%" + Math.Round(Convert.ToDouble(((100 * Icerik.correctCount) / Icerik.questionCount)), 0); YanlisYuzde.Text = "%" + Math.Round(Convert.ToDouble(((100 * Icerik.wrongCount) / Icerik.questionCount)), 0); BosYuzde.Text = "%" + Math.Round(Convert.ToDouble(((100 * Icerik.emptyCount) / Icerik.questionCount)), 0); DogruProgres.Progress = Convert.ToInt32(DogruYuzde.Text.Replace("%", "")); YanlisProgres.Progress = Convert.ToInt32(YanlisYuzde.Text.Replace("%", "")); BosProgres.Progress = Convert.ToInt32(BosYuzde.Text.Replace("%", "")); ShowLoading.Hide(); }); } else { ShowLoading.Hide(); AlertHelper.AlertGoster("Bir Sorun Oluştu.", this); this.Finish(); } } else { ShowLoading.Hide(); AlertHelper.AlertGoster("Bir Sorun Oluştu.", this); this.Finish(); } } else { ShowLoading.Hide(); AlertHelper.AlertGoster("Bir Sorun Oluştu.", this); this.Finish(); } } else { ShowLoading.Hide(); AlertHelper.AlertGoster("Bir Sorun Oluştu.", this); this.Finish(); } })).Start(); }