Beispiel #1
0
        private void onSelected(object sender, SelectedItemChangedEventArgs e)
        {
            if (e.SelectedItem == null)
            {
                return;
            }


            selectedStudent = (Soru)e.SelectedItem;
            sorui           = selectedStudent.soruid;

            if (selectedStudent.isAnswered == true)
            {
                okbut.Text = "Cevabı göster";
            }
            if (selectedStudent.isAnswered == false)
            {
                okbut.Text = "Cevapla";
            }

            if (selectedStudent.text != null)
            {
                lab11.Text            = selectedStudent.text;
                lstStudents.IsVisible = false;
                grid.IsVisible        = true;
                lab11.IsVisible       = true;
                okbut.IsVisible       = true;
                okbut1.IsVisible      = true;
            }


            but.Source            = selectedStudent.textorurl;
            lstStudents.IsVisible = false;
            but.IsVisible         = true;
            grid.IsVisible        = true;

            okbut.IsVisible  = true;
            okbut1.IsVisible = true;

            ListView lst = (ListView)sender;

            lst.SelectedItem = null;
        }
Beispiel #2
0
        /* string Upload(System.IO.Stream stream)
         * {
         *   CloudStorageAccount account = new CloudStorageAccount(new Microsoft.WindowsAzure.Storage.Auth.StorageCredentials("bisoru", "i/20lNkE0b7bFpe1RCbwRH5ycJ9LUSJ49UMVok2Pc19WqgPtYGE81fgpYoCUVLkpLDMISu0e42cd7i/Rx2KO7w=="), true);
         *
         *   CloudBlobClient blobClient = account.CreateCloudBlobClient();
         *   CloudBlobContainer container = blobClient.GetContainerReference("fotograflar");
         *
         *   container.CreateIfNotExists();
         *   container.SetPermissions(new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Blob });
         *   CloudBlockBlob blockBlob = container.GetBlockBlobReference(Guid.NewGuid().ToString() + ".png");
         *   blockBlob.UploadFromStream(stream);
         *   return blockBlob.Uri.ToString();
         * }*/

        private async void yukle(object sender, EventArgs e)
        {
            if (sorumu1 == true)
            {
                //Userlar[Userf.whichUser].SorduguPhotoURL = pet;
                Soru temp = new Soru();
                temp.textorurl     = pet;
                temp.ekleyenid     = Userf.whichUser;
                temp.ekleyen       = Userlar[Userf.whichUser].Name;
                temp.isAnswered    = false;
                temp.koyulmatarihi = DateTime.Now;
                if (entri.Text != "")
                {
                    temp.isPhoto = false;
                    temp.text    = entri.Text;
                }

                int k = Sorular.Count;
                temp.soruid = k + 1;

                temp.IsShow = false;
                temp.icon   = "qmm.png";
                await SoruTable.InsertAsync(temp);


                await DisplayAlert("Sorunuz yüklendi", " ", "Tamam");

                await Navigation.PushModalAsync(new QuestionPage());
            }


            if (sorumu1 == false)
            {
                //Userlar[whichUser].cevapladigiSoruPhotoURL = pet;
                Cevap temp = new Cevap();
                temp.textorurl     = pet;
                temp.ekleyenid     = Userf.whichUser;
                temp.ekleyen       = Userlar[Userf.whichUser].Name;
                temp.koyulmatarihi = DateTime.Now;
                if (entri.Text != null)
                {
                    temp.isPhoto = false;
                    temp.text    = entri.Text;
                }

                int k = Sorular.Count;
                temp.cevapid = k + 1;
                temp.sorunid = soruid;
                await CevapTable.InsertAsync(temp);

                int s = Sorular.Count;
                for (int i = 0; i < s; i++)
                {
                    if (Sorular[i].soruid == soruid)
                    {
                        Sorular[i].isAnswered = true;
                        Sorular[i].icon       = "tick.png";
                        await SoruTable.UpdateAsync(Sorular[i]);

                        break;
                    }
                }

                await DisplayAlert("Cevabınız yüklendi", " ", "Tamam");

                await Navigation.PushModalAsync(new QuestionPage());
            }
        }