Esempio n. 1
0
        bool GetMemberData()
        {
            WebService webService = new WebService();
            var        JSONData   = webService.OkuGetir("account");

            if (JSONData != null)
            {
                var JsonSting = JSONData.ToString();
                var Icerik    = Newtonsoft.Json.JsonConvert.DeserializeObject <MEMBER_DATA>(JSONData.ToString());
                Icerik.API_TOKEN = APITOKEN.TOKEN;
                Icerik.password  = SifreText.Text;
                Icerik.townId    = IlceDTO1[IlceSpin.SelectedItemPosition].id;
                Icerik.gender    = CinsiyetSpin.SelectedItemPosition == 1 ? false : true;
                Icerik.alan      = (string)AlanSpin.GetItemAtPosition(AlanSpin.SelectedItemPosition);
                if (OkulSpin.SelectedItemPosition > 0)
                {
                    Icerik.schollId = SchoolDTO1[OkulSpin.SelectedItemPosition].id;
                }
                DataBase.MEMBER_DATA_EKLE(Icerik);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 2
0
        private void GuncelleButton_Click(object sender, EventArgs e)
        {
            if (BosVarmi())
            {
                WebService webService = new WebService();
                var        JSONData   = webService.OkuGetir("account");
                if (JSONData != null)
                {
                    var Icerik = Newtonsoft.Json.JsonConvert.DeserializeObject <MEMBER_DATA>(JSONData.ToString());
                    Icerik.firstName = AdText.Text.Trim();
                    Icerik.lastName  = SoyadText.Text.Trim();
                    Icerik.email     = EmailText.Text.Trim();
                    Icerik.password  = SifreText.Text;
                    Icerik.townId    = IlceDTO1[IlceSpin.SelectedItemPosition].id;
                    Icerik.gender    = UserInfo.gender;
                    if (AlanSpin.SelectedItemPosition > 0)//Alan
                    {
                        Icerik.alan = (string)AlanSpin.GetItemAtPosition(AlanSpin.SelectedItemPosition);
                    }
                    if (OkulSpin.SelectedItemPosition > 0)
                    {
                        Icerik.schollId = SchoolDTO1[OkulSpin.SelectedItemPosition].id;
                    }

                    string jsonString = JsonConvert.SerializeObject(Icerik);
                    var    Donus      = webService.ServisIslem("users", jsonString, Method: "PUT");
                    if (Donus != "Hata")
                    {
                        UserInfo.firstName = AdText.Text.Trim();
                        UserInfo.lastName  = SoyadText.Text.Trim();
                        UserInfo.email     = EmailText.Text.Trim();
                        UserInfo.password  = SifreText.Text;
                        UserInfo.townId    = IlceDTO1[IlceSpin.SelectedItemPosition].id;
                        if (DataBase.MEMBER_DATA_Guncelle(UserInfo))
                        {
                            AlertHelper.AlertGoster("Bilgileriniz Güncellendi.", this);
                            return;
                        }
                        else
                        {
                            AlertHelper.AlertGoster("Bir Sorun Oluştu.", this);
                            return;
                        }
                    }
                    else
                    {
                        AlertHelper.AlertGoster("Bir Sorun Oluştu.", this);
                        return;
                    }
                }
                else
                {
                    AlertHelper.AlertGoster("Bir Sorun Oluştu.", this);
                    return;
                }
            }
        }
Esempio n. 3
0
        private void KayitOlButton_Click(object sender, EventArgs e)
        {
            if (BosVarmi())
            {
                ShowLoading.Show(this, "Lütfen Bekleyin...");
                new System.Threading.Thread(new System.Threading.ThreadStart(delegate
                {
                    WebService webService       = new WebService();
                    KayitIcinRoot kayitIcinRoot = new KayitIcinRoot()
                    {
                        firstName = AdText.Text.Trim(),
                        lastName  = SoyadText.Text.Trim(),
                        password  = SifreText.Text,
                        login     = EmailText.Text,
                        email     = EmailText.Text,
                        gender    = CinsiyetSpin.SelectedItemPosition == 1 ? false:true,
                        birthday  = Convert.ToDateTime(DogumText.Text).ToString("yyyy-MM-dd'T'HH:mm:ssZ"),
                        townId    = IlceDTO1[IlceSpin.SelectedItemPosition].id,
                    };
                    if (AlanSpin.SelectedItemPosition > 0)//Alan
                    {
                        kayitIcinRoot.alan = (string)AlanSpin.GetItemAtPosition(AlanSpin.SelectedItemPosition);
                    }
                    if (OkulSpin.SelectedItemPosition > 0)//Okul
                    {
                        kayitIcinRoot.schoolId = (int)SchoolDTO1[OkulSpin.SelectedItemPosition].id;
                    }
                    string jsonString = JsonConvert.SerializeObject(kayitIcinRoot);
                    var Responsee     = webService.ServisIslem("register", jsonString, true);
                    if (Responsee != "Hata")
                    {
                        TokenAlDevamEt();
                        ShowLoading.Hide();
                    }
                    else
                    {
                        ShowLoading.Hide();
                        AlertHelper.AlertGoster("Bir sorunla karşılaşıldı!", this);
                        return;
                    }
                })).Start();
            }

            //StartActivity(typeof(HosgeldinActivity));
            //this.Finish();
        }