Example #1
0
        void GirisYapMetod(string email, string sifre)
        {
            CustomLoading.Show(this, "Lütfen Bekleyin...");
            new System.Threading.Thread(new System.Threading.ThreadStart(delegate
            {
                WebService webService = new WebService();
                LoginRoot loginRoot   = null;
                InvokeOnMainThread(delegate() {
                    loginRoot = new LoginRoot()
                    {
                        password   = sifre,
                        rememberMe = true,
                        username   = email
                    };
                });

                string jsonString = JsonConvert.SerializeObject(loginRoot);
                var Donus         = webService.ServisIslem("authenticate", jsonString, true);
                if (Donus == "Hata")
                {
                    CustomLoading.Hide();
                    CustomAlert.GetCustomAlert(this, "Giriş Yapılamadı!");
                    return;
                }
                else
                {
                    JObject obj  = JObject.Parse(Donus);
                    string Token = (string)obj["id_token"];
                    if (Token != null && Token != "")
                    {
                        APITOKEN.TOKEN = Token;
                        if (GetMemberData())
                        {
                            CustomLoading.Hide();
                            InvokeOnMainThread(delegate() {
                                var appDelegate = UIApplication.SharedApplication.Delegate as AppDelegate;
                                appDelegate.SetRootLokasyonlarViewController();
                            });
                        }
                    }
                }
            })).Start();
        }
Example #2
0
        void CheckInYap(string statuss, string startprogresstext, string alert)
        {
            CustomLoading.Show(this, startprogresstext);
            new System.Threading.Thread(new System.Threading.ThreadStart(delegate
            {
                WebService webService = new WebService();

                CheckInIslemiIcinDataModel checkInIslemiIcinDataModel = new CheckInIslemiIcinDataModel()
                {
                    locationId = Convert.ToInt32(GelenMekan.id),
                    status     = statuss
                };
                var jsonstring = JsonConvert.SerializeObject(checkInIslemiIcinDataModel);
                var Donus      = webService.ServisIslem("locations/check-in", jsonstring);
                if (Donus != "Hata")
                {
                    InvokeOnMainThread(delegate()
                    {
                        CustomAlert.GetCustomAlert(this, alert);
                        CustomLoading.Hide();
                        var LokasyonKisilerStory             = UIStoryboard.FromName("LokasyondakiKisilerBaseVC", NSBundle.MainBundle);
                        LokasyondakiKisilerBaseVC controller = LokasyonKisilerStory.InstantiateViewController("LokasyondakiKisilerBaseVC") as LokasyondakiKisilerBaseVC;
                        controller.gelenMekan = GelenMekan;
                        this.PresentViewController(controller, true, null);
                    });
                }
                else
                {
                    InvokeOnMainThread(delegate()
                    {
                        CustomAlert.GetCustomAlert(this, "Bir sorun oluştu...");
                        CustomLoading.Hide();
                    });
                }
            })).Start();
        }