Пример #1
0
        void myListViewEvent(object sender, AdapterView.ItemClickEventArgs e)
        {
            var index = e.Position;

            UserObject value = myUserList[index];

            System.Console.WriteLine("Value " + value.name);

            Android.App.AlertDialog.Builder dialog = new Android.App.AlertDialog.Builder(context);
            Android.App.AlertDialog         alert  = dialog.Create();
            alert.SetTitle("Favourite!");
            alert.SetMessage("Add To Favourites?");

            alert.SetButton("Add", (c, ev) =>
            {
                dbhelper = new DBHelper(context);

                dbhelper.insertFavouritetable(value.id, value.name, value.address, value.day, value.price, value.category);
            });

            alert.SetButton2("Cancel", (c, ev) =>

            {
                var activity = new Intent(context, typeof(homeActivity));
                //activity.PutExtra("Value", value.name);
                StartActivity(activity);
            });

            alert.Show();

            /*var activity = new Intent(context, typeof(EventActivity));
             * activity.PutExtra("Value", value.name);
             * StartActivity(activity);*/
        }
Пример #2
0
        void Mylist_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            Android.App.AlertDialog.Builder dialog = new Android.App.AlertDialog.Builder(this.Activity);
            Android.App.AlertDialog         alert  = dialog.Create();

            alert.SetTitle("Remove Party from Queue");
            alert.SetMessage("Are you sure you want to remove this party from the queue?");
            alert.SetButton("Yes", (c, ev) =>
            {
                var firebase = new FirebaseClient(FBURL);

                firebase
                .Child("queues")
                .Child(auth.CurrentUser.Uid)
                .Child(listQueue[e.Position].account_uid)
                .DeleteAsync();

                listQueue.Remove(listQueue[e.Position]);
                CustomQueueListAdapter adapter = new CustomQueueListAdapter(this, listQueue);

                mylist.Adapter = adapter;

                Toast.MakeText(this.Activity, "Party has been removed from the Queue", ToastLength.Short).Show();
            });
            alert.SetButton2("No", (c, ev) =>
            {
            });
            alert.Show();
        }
Пример #3
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            // Si selecciona icon exit
            if (item.ItemId == Resource.Id.exit)
            {
                AlertDialog.Builder dialog = new AlertDialog.Builder(this);
                AlertDialog         alert  = dialog.Create();
                alert.SetTitle("Salir");
                alert.SetMessage("¿Estás seguro?");
                alert.SetIcon(Resource.Drawable.logo);
                alert.SetButton("Si", (c, ev) =>
                {
                    this.FinishAffinity();
                    Finish();
                    Android.OS.Process.KillProcess(Android.OS.Process.MyPid());

                    GC.Collect();
                });

                alert.SetButton2("no", (c, ev) => { });
                alert.Show();
            }

            return(base.OnOptionsItemSelected(item));
        }
Пример #4
0
 public void OnComplete(Task task)
 {
     if (task.IsSuccessful == false)
     {
         Android.App.AlertDialog.Builder dialog = new AlertDialog.Builder(this);
         AlertDialog alert = dialog.Create();
         alert.SetTitle("Failed");
         alert.SetMessage("Request failed, something went wrong");
         alert.SetButton("OK", (c, ev) =>
         {
             // Ok button click task
         });
         alert.SetButton2("CANCEL", (c, ev) => { });
         alert.Show();
     }
     else
     {
         Android.App.AlertDialog.Builder dialog = new AlertDialog.Builder(this);
         AlertDialog alert = dialog.Create();
         alert.SetTitle("Success");
         alert.SetMessage("Request success, please check your email");
         alert.SetButton("OK", (c, ev) =>
         {
             // Ok button click task
         });
         alert.Show();
     }
 }
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
            case Android.Resource.Id.Home:
                Android.App.AlertDialog.Builder builder = new Android.App.AlertDialog.Builder(this);
                Android.App.AlertDialog         alert   = builder.Create();
                alert.SetTitle("Cancel warning");
                alert.SetMessage("Are you sure you want to cancel?");

                alert.SetButton2("NO", (c, ev) =>
                {
                    //cancel button
                });

                alert.SetButton("YES", (c, ev) =>
                {
                    Finish();
                });

                alert.Show();
                return(true);

            default:
                return(base.OnOptionsItemSelected(item));
            }
        }
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            if (item.ItemId == Resource.Id.filter)
            {
                Android.App.AlertDialog.Builder dialog = new Android.App.AlertDialog.Builder(this);
                Android.App.AlertDialog         alert  = dialog.Create();
                alert.SetTitle("Aviso");
                alert.SetMessage("¿Seguro que desea eliminar los filtros aplicados?");
                alert.SetButton("Si", (c, ev) =>
                {
                    Intent data = new Intent();

                    data.PutExtra(FILTER_RESULT, JsonConvert.SerializeObject(null));

                    SetResult(Result.Ok, data);
                    Finish();
                });

                alert.SetButton2("Cancelar", (c, ev) => { });

                alert.Show();
                return(true);
            }
            return(base.OnOptionsItemSelected(item));
        }
 public void ShowConfirmDelete(string alerTitle, string alertMessage, string id)
 {
     Android.App.AlertDialog.Builder showDialog = new Android.App.AlertDialog.Builder(this);
     Android.App.AlertDialog         Alert      = showDialog.Create();
     Alert.SetTitle(alerTitle);
     Alert.SetMessage(alertMessage);
     Alert.SetButton("YES", delegate
     {
         try
         {
             string URL = "https://download-tracker.herokuapp.com/movies/" + id;
             DeleteMovie(URL);
         }
         catch (Exception e)
         {
             Console.WriteLine(e.Message);
         }
     });
     Alert.SetButton2("NO", delegate
     {
         Alert.Dismiss();
         Alert.Dispose();
         return;
     });
     Alert.Show();
 }
Пример #8
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
            case Resource.Id.close_session:

                // Close session

                Android.App.AlertDialog.Builder dialog = new Android.App.AlertDialog.Builder(this);
                Android.App.AlertDialog         alert  = dialog.Create();
                alert.SetTitle("Aviso");
                alert.SetMessage("¿Seguro que desea cerrar la sesión?");
                alert.SetButton("Si", (c, ev) =>
                {
                    Intent shortDialDetails = new Intent(Application.Context, typeof(LoginActivity));
                    StartActivity(shortDialDetails);
                    Finish();
                });

                alert.SetButton2("Cancelar", (c, ev) => { });

                alert.Show();

                return(true);

            case Resource.Id.filter:
                return(false);
            }

            return(base.OnOptionsItemSelected(item));
        }
Пример #9
0
        private void btnPost_Click(object sender, EventArgs e)
        {
            Android.App.AlertDialog.Builder dialog = new Android.App.AlertDialog.Builder(mainContext);
            Android.App.AlertDialog         alert  = dialog.Create();
            alert.SetTitle("Confirmation");
            alert.SetMessage("Are you sure you want to upload the selected file?");
            alert.SetButton("OK", async(c, ev) =>
            {
                var array = Helpers.VideoHelper.GetSelectedMediaData((Activity)mainContext, intentData.Data);

                if (tabbed != null)
                {
                    await tabbed.UploadSelectedResponse(array, editDescription.Text);
                }
                else if (global != null)
                {
                    await global.UploadSelectedResponse(array, editDescription.Text);
                }

                alert.Hide();
                this.Dismiss();
            });
            alert.SetButton2("CANCEL", (c, ev) => { alert.Hide(); });
            alert.Show();
        }
Пример #10
0
        private void ShowLogoutDialog()
        {
            builder     = new Android.App.AlertDialog.Builder(mainActivity);
            alertDialog = builder.Create();
            alertDialog.SetMessage("Do you want to log out?");
            alertDialog.SetButton("Yes", (s1, e1) =>
            {
                var auth = sessionManager.GetFirebaseAuth();
                editor   = preferences.Edit();
                LoginManager.Instance.LogOut();
                auth.SignOut();
                editor.Clear();
                editor.Commit();

                var intent = new Intent(Application.Context, typeof(OnboardingActivity));
                intent.SetFlags(ActivityFlags.ClearTask | ActivityFlags.ClearTop | ActivityFlags.NewTask);
                StartActivity(intent);
                mainActivity.Finish();
            });

            alertDialog.SetButton2("No", (s2, e2) =>
            {
                alertDialog.Dismiss();
            });
            alertDialog.Show();
        }
Пример #11
0
 public override void OnBackPressed()
 {
     Android.App.AlertDialog.Builder builder    = new Android.App.AlertDialog.Builder(this);
     Android.App.AlertDialog         alerDialog = builder.Create();
     alerDialog.SetTitle("Gracias");
     //poner imagen de respuesta incorrecta
     //alerDialog.SetIcon(Resource.Drawable.Icon);
     alerDialog.SetMessage("Por favor danos tu opinión sobre tu experiencia con la aplicación");
     alerDialog.SetButton("Ir a feedback", (se, eve) =>
     {
         try
         {
             var uri    = Android.Net.Uri.Parse("https://docs.google.com/forms/d/e/1FAIpQLSe_BMvCLkessoOfpOSJsg1bcb49K3U_oj3OQH8r2yYMZX0tRA/viewform?usp=sf_link");
             var intent = new Intent(Intent.ActionView, uri);
             StartActivity(intent);
             Finish();
         }catch (Exception e)
         {
         }
     });
     alerDialog.SetButton2("Ahora no", (se, eve) =>
     {
         Finish();
     });
     alerDialog.CancelEvent += OnDialogCancel;
     alerDialog.Show();
     //base.OnBackPressed(); -> DO NOT CALL THIS LINE OR WILL NAVIGATE BACK
 }
        private void btnPost_Click(object sender, EventArgs e)
        {
            Android.App.AlertDialog.Builder dialog = new Android.App.AlertDialog.Builder(mainContext);
            Android.App.AlertDialog         alert  = dialog.Create();
            alert.SetTitle("Confirmation");
            alert.SetMessage("Are you sure you want to upload this recording?");
            alert.SetButton("OK", async(c, ev) =>
            {
                await videoRecord.UploadRecordedResponse(editDescription.Text);
                var tabbedActivity = TabbedMainActivity.GetInstance();
                if (tabbedActivity != null)
                {
                    int UnseenResponseCount = API.UserResponseAPI.GetUnseenResponseNotification();
                    if (UnseenResponseCount > 0)
                    {
                        tabbedActivity.MyChannelFragment.UnSeenReponse = UnseenResponseCount;
                        tabbedActivity.FragmentBottomNavigator.txtUnSeenCount.Visibility = ViewStates.Visible;
                        tabbedActivity.FragmentBottomNavigator.txtUnSeenCount.Text       = UnseenResponseCount.ToString();
                    }
                    else
                    {
                        tabbedActivity.FragmentBottomNavigator.txtUnSeenCount.Visibility = ViewStates.Gone;
                    }
                }

                alert.Hide();
                this.Dismiss();
            });
            alert.SetButton2("CANCEL", (c, ev) => { alert.Hide(); });
            alert.Show();
        }
        private void MToolBar_MenuItemClick(object sender, SupportToolbar.MenuItemClickEventArgs e)
        {
            if (e.Item.ItemId == Resource.Id.menuItem_copy)
            {
                //copy here
                GlobalVariables.parentProductCopyHolder.Clear();
                GlobalVariables.newProductCopyHolder.Clear();
                CopyData();
                Toast.MakeText(this, "Product copied!", ToastLength.Long).Show();
            }
            else if (e.Item.ItemId == Resource.Id.menuItem_paste)
            {
                if (GlobalVariables.parentProductCopyHolder.Count > 0)
                {
                    Android.App.AlertDialog.Builder builder = new Android.App.AlertDialog.Builder(this);
                    Android.App.AlertDialog         alert   = builder.Create();
                    alert.SetTitle("Confirm action");
                    alert.SetMessage("Paste copied product?");

                    alert.SetButton2("CANCEL", (c, ev) =>
                    {
                        //cancel button
                    });

                    alert.SetButton("YES", (c, ev) =>
                    {
                        PasteData(GlobalVariables.parentProductCopyHolder, GlobalVariables.newProductCopyHolder);
                        Toast.MakeText(this, "Successfully pasted!", ToastLength.Long).Show();
                    });

                    alert.Show();
                }
                else
                {
                    Toast.MakeText(this, "Clipboard is empty!", ToastLength.Long).Show();
                }
            }
            else if (e.Item.ItemId == Resource.Id.menuItem_delete)
            {
                Android.App.AlertDialog.Builder builder = new Android.App.AlertDialog.Builder(this);
                Android.App.AlertDialog         alert   = builder.Create();
                alert.SetTitle("Delete product");
                alert.SetMessage("Are you sure you want to delete this product? This action cannot be undone.");

                alert.SetButton2("CANCEL", (c, ev) =>
                {
                    //cancel button
                });

                alert.SetButton("YES", (c, ev) =>
                {
                    //delete code here
                    DeleteProduct(editParentProductId);
                    Finish();
                });

                alert.Show();
            }
        }
 // Initiates an alert dialogue to provide confirmation for a `delete` action by an end user.
 private void InitiateDeleteAlertDialogue()
 {
     deletionAlert = new AlertDialog.Builder(this).Create();
     deletionAlert.SetTitle("Confirm deletion");
     deletionAlert.SetMessage("Are you sure you wish to delete this question?");
     deletionAlert.SetButton("Confirm", DeletionAlertConfirmButtonClick);
     deletionAlert.SetButton2("Dismiss", (sender, args) => { deletionAlert.Dismiss(); });
 }
Пример #15
0
        private void AskForDownloadNewVersion()
        {
            var dialog = new Android.App.AlertDialog.Builder(this);

            Android.App.AlertDialog alert = dialog.Create();
            alert.SetMessage("New version available.");
            alert.SetButton("Cancel", (c, ev) => { });
            alert.SetButton2("Download", (c, ev) => { DownloadNewVersion(); });
            alert.Show();
        }
Пример #16
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.StudentInfo);
            // Create your application here

            var fname = FindViewById <EditText>(Resource.Id.fname);
            var lname = FindViewById <EditText>(Resource.Id.lname);
            var id    = FindViewById <EditText>(Resource.Id.id);
            var btn   = FindViewById <Button>(Resource.Id.button1);

            btn.Click += delegate
            {
                if (!string.IsNullOrEmpty(fname.Text) && !string.IsNullOrEmpty(lname.Text) && !string.IsNullOrEmpty(id.Text))
                {
                    foreach (Student student in Student.students)
                    {
                        if (student.id == id.Text)
                        {
                            Android.App.AlertDialog.Builder dialog2 = new Android.App.AlertDialog.Builder(this);
                            Android.App.AlertDialog         alert2  = dialog2.Create();
                            alert2.SetTitle("Duplicate Student ID");
                            alert2.SetMessage("Student ID you've entered is already registered, please enter unique ID");
                            alert2.SetButton("Ok", (c, ev) => {
                                return;
                            });
                            alert2.Show();
                        }
                    }

                    Android.App.AlertDialog.Builder dialog = new Android.App.AlertDialog.Builder(this);
                    Android.App.AlertDialog         alert  = dialog.Create();
                    alert.SetTitle("Add Student");
                    alert.SetMessage("Are you sure?");
                    alert.SetButton("Yes, I'm Sure!", (c, ev) => {
                        Student student = new Student(fname.Text, lname.Text, id.Text, "Pending");
                        Student.students.Add(student);
                        fname.Text = "";
                        lname.Text = "";
                        id.Text    = "";
                        Toast.MakeText(this, student.fname + " is now a student.", ToastLength.Short).Show();
                    });
                    alert.SetButton2("No Way!", (c, ev) => {
                        // Don't delete the content of the fields
                    });
                    alert.Show();
                }
                else
                {
                    Toast.MakeText(this, "Fields should not be empty. Please fill all the details.", ToastLength.Short).Show();
                }
            };
        }
Пример #17
0
        //private void txtHideComment_Click(object sender, EventArgs e)
        //{
        //    txtHideComment.Visibility = ViewStates.Gone;
        //    FragmentTransaction ftvideo = SupportFragmentManager.BeginTransaction();
        //    ftvideo.AddToBackStack(null);
        //    ftvideo.SetCustomAnimations(Resource.Animation.slide_up, Resource.Animation.slide_down);
        //    ftvideo.Hide(CommentsFragment).Commit();
        //}

        private void BtnDelete_Click(object sender, EventArgs e)
        {
            Android.App.AlertDialog.Builder dialog = new Android.App.AlertDialog.Builder(this);
            Android.App.AlertDialog         alert  = dialog.Create();
            alert.SetTitle("Confirmation");
            alert.SetMessage("Are you sure you want to delete the response?");
            alert.SetButton("OK", (c, ev) =>
            {
                DeleteLatestVideo().FireAndForgetSafeAsync();
            });
            alert.SetButton2("CANCEL", (c, ev) => { alert.Hide(); });
            alert.Show();
        }
Пример #18
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            Window.RequestFeature(WindowFeatures.NoTitle);
            SetContentView(Resource.Layout.Main);

            var adRequest = new AdRequest.Builder().Build();

            mInterstitialAd            = new InterstitialAd(this);
            mInterstitialAd.AdUnitId   = GetString(Resource.String.test_interstitial_ad_unit_id);;
            mInterstitialAd.AdListener = new AdListener(this);


            charade_tv     = FindViewById <TextView>(Resource.Id.charade_textView);
            qst_en_cours   = FindViewById <TextView>(Resource.Id.qst_en_cours);
            score_tv       = FindViewById <TextView>(Resource.Id.score_tv);
            aide_tv        = FindViewById <TextView>(Resource.Id.aide_tv);
            aide_tv.Click += (s, e) =>
            {
                Android.App.AlertDialog.Builder dialog = new Android.App.AlertDialog.Builder(this);
                Android.App.AlertDialog         alert  = dialog.Create();
                alert.SetTitle("Vous avez demandé de l'aide");
                alert.SetMessage("Voulez vous prendre une lettre contre 10 points?");
                //alert.SetIcon(Resource.Drawable.question);
                alert.SetButton("OUI", (c, ev) =>
                {
                    Aide();
                });
                alert.SetButton2("NON", (c, ev) =>
                {
                    //if (mInterstitialAd.IsLoaded)
                    //{
                    //    LoadInterstitialAd();
                    //}
                });
                alert.Show();
            };

            Preference_utilisateur         = GetPreferences(FileCreationMode.Private);
            Preference_utilisateure_editor = Preference_utilisateur.Edit();
            niveau = Preference_utilisateur.GetInt("niveau", 0);
            score  = Preference_utilisateur.GetInt("score", 0);
            aide   = Preference_utilisateur.GetString("aide", "");

            initIdGrid();
            CharadeSuivante();
        }
Пример #19
0
 //Metody
 //Po stisknutí tlačítka se uživateli zobrazí alert, odkud chce fotku vybrat (budoucí možnost pro výběr i z foťáku, nepodařilo se mi rozchodit), pokud je vybraná galerie,
 //spustí se intent pro výběr obrázku z galerie, ta se otevře a uživatel má možnost vybrat fotku.
 public void SelectImage()
 {
     dialog = new Android.App.AlertDialog.Builder(this.act);
     alert  = dialog.Create();
     alert.SetTitle("Select Image");
     alert.SetMessage("Select image from");
     alert.SetButton2("Gallery", (c, ev) =>
     {
         var intent = new Intent(Intent.ActionPick, MediaStore.Images.Media.ExternalContentUri);
         intent.SetType("image/*");
         this.act.StartActivityForResult(Intent.CreateChooser(intent, "Select Picture"), SELECT_FILE);
     });
     alert.SetButton3("CANCEL", (c, ev) => { });
     alert.Show();
 }
Пример #20
0
        private void Metododepagobtn_Click(object sender, EventArgs e)
        {
            AlertDialog.Builder dialog = new AlertDialog.Builder(this);
            AlertDialog         alert  = dialog.Create();

            alert.SetTitle("¿Que metodo de pago deaseas?");
            alert.SetButton("Efectivo", (c, ev) =>
            {
                metodopago.Text = "Efectivo";
            });
            alert.SetButton2("Tarjeta", (c, ev) =>
            {
                Dialog popup = new Dialog(this);
                popup.SetContentView(Resource.Layout.popuCardlayout);
                popup.Window.SetSoftInputMode(SoftInput.AdjustResize);
                popup.Show();
                popup.Window.SetBackgroundDrawableResource(Android.Resource.Color.Transparent);
                var nombreimput          = popup.FindViewById <EditText>(Resource.Id.nombreinput);
                var numtarjetainput      = popup.FindViewById <EditText>(Resource.Id.numtarjetainput);
                var mesinput             = popup.FindViewById <EditText>(Resource.Id.mesinput);
                var añoinput             = popup.FindViewById <EditText>(Resource.Id.añoinput);
                var cvvinput             = popup.FindViewById <EditText>(Resource.Id.cvvinput);
                var ingresartarjeta      = popup.FindViewById <Button>(Resource.Id.ingresartarjeta);
                var numtarejtaview       = popup.FindViewById <TextView>(Resource.Id.numtarjetaview);
                var nombreview           = popup.FindViewById <TextView>(Resource.Id.nombreview);
                var mesview              = popup.FindViewById <TextView>(Resource.Id.meview);
                var añoview              = popup.FindViewById <TextView>(Resource.Id.añoview);
                nombreimput.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) => {
                    nombreview.Text = e.Text.ToString();
                };
                numtarjetainput.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) => {
                    numtarejtaview.Text = e.Text.ToString();
                };
                mesinput.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) => {
                    mesview.Text = e.Text.ToString();
                };
                añoinput.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) => {
                    añoview.Text = e.Text.ToString();
                };


                ingresartarjeta.Click += delegate {
                    popup.Dismiss();
                };
            });
            alert.Show();
            totalapagar.Text = precios.Sum().ToString();
        }
        void myListViewEvent(object sender, AdapterView.ItemClickEventArgs e)
        {
            Android.App.AlertDialog.Builder dialog = new Android.App.AlertDialog.Builder(context);
            Android.App.AlertDialog         alert  = dialog.Create();
            var  index = e.Position;
            Jobs value = jobList[index];

            //Intent newScreen = new Intent(Activity, typeof(ApplyNowActivity));
            //newScreen.PutExtra("jobid", value.jobid);
            //StartActivity(newScreen);
            alert.SetTitle("Job for: " + value.title);
            alert.SetMessage("Do you want to apply this job or later?");
            alert.SetButton("Apply Now", (c, ev) => {
                int empid = context.Intent.GetIntExtra("recentuserid", 0);
                DbHelperClass dbhelper = new DbHelperClass(context);
                User UsrObj            = new User();
                UsrObj                       = dbhelper.getUserById(empid);
                bool jobApp                  = dbhelper.insertJobApplication(value.jobid, empid, value.title, value.description, value.jobimage, value.jobtype);
                SmtpClient client            = new SmtpClient();
                client.Port                  = 587;
                client.Host                  = "smtp.gmail.com";
                client.EnableSsl             = true;
                client.DeliveryMethod        = SmtpDeliveryMethod.Network;
                client.UseDefaultCredentials = false;
                client.Credentials           = new System.Net.NetworkCredential("*****@*****.**", "Parul@$101");
                MailMessage mail             = new MailMessage();
                mail.From                    = new MailAddress(UsrObj.email);
                mail.To.Add(new MailAddress("*****@*****.**"));
                mail.Subject    = "Job Application For " + value.title;
                mail.Body       = "From: " + UsrObj.name + "<br/>Email: " + UsrObj.email + "<br/>Job Description: " + value.description;
                mail.IsBodyHtml = true;
                mail.Priority   = MailPriority.Normal;
                client.Send(mail);
            });
            alert.SetButton2("Save this Job", (c, ev) => {
                //string id = context.Intent.GetStringExtra("recentuserid");
                //int empid = Convert.ToInt32(id);
                int empid = context.Intent.GetIntExtra("recentuserid", 0);
                DbHelperClass dbhelper = new DbHelperClass(context);
                bool saveJob           = dbhelper.insertSavedJobApplication(value.jobid, empid, value.title, value.description, value.jobimage, value.jobtype);
                alert.SetTitle("Saved Successfully");
                alert.SetMessage("Selected job saved successfully");
                alert.SetButton("OK", (cd, evv) => { });
                alert.Show();
            });
            alert.SetButton3("Cancel", (c, ev) => { });
            alert.Show();
        }
Пример #22
0
        private Task <bool> ConfirmarEliminacionArchivos()
        {
            var respuesta = new TaskCompletionSource <bool>();

            AlertDialog alert = dialog.Create();

            alert.SetTitle("Confirmación");
            alert.SetMessage("¿Desea eliminar los archivos originales después del proceso?");
            alert.SetButton("Sí", (c, ev) =>
            {
                respuesta.SetResult(true);
            });
            alert.SetButton2("No", (c, ev) => { respuesta.SetResult(false); });
            alert.Show();
            return(respuesta.Task);
        }
Пример #23
0
 public void OnClick(View v)
 {
     Android.App.AlertDialog.Builder dialog = new Android.App.AlertDialog.Builder(context);
     Android.App.AlertDialog         alert  = dialog.Create();
     alert.SetTitle("UnBlock");
     alert.SetMessage("Do you want to UnBlock this user");
     alert.SetButton("OK", (c, ev) =>
     {
         RemoveFromBlackListAsync(Convert.ToInt64(item.id));
     });
     alert.SetButton2("CANCEL", (c, ev) =>
     {
         alert.Dismiss();
     });
     alert.Show();
 }
Пример #24
0
        void Confidential_Checked_Click(object sender, System.EventArgs e)
        {
            Android.App.AlertDialog.Builder dialog = new Android.App.AlertDialog.Builder(this);
            Android.App.AlertDialog         alert  = dialog.Create();
            alert.SetTitle("Aviso");
            string message = mEvent.Confidencial ? "¿Está seguro que desea desmarcar el evento como confidencial?" : "¿Está seguro que desea marcar el evento como confidencial?";

            alert.SetMessage(message);
            alert.SetButton("Si", (c, ev) =>
            {
                ChangeEventStatusCenfidential();
            });

            alert.SetButton2("Cancelar", (c, ev) => { });

            alert.Show();
        }
Пример #25
0
        private void LoadReviews(object sender, EventArgs e)
        {
            var listview = new ListView(this);

            listview.Adapter = new ReviewsAdapter(api.Personel_Ratings(Id));
            Android.App.AlertDialog.Builder dialog = new Android.App.AlertDialog.Builder(this);
            Android.App.AlertDialog         alert  = dialog.Create();
            alert.SetTitle("Reviews for " + nameText.Text);
            alert.SetView(listview);
            //alert.SetIcon(Resource.Drawable.alert);
            alert.SetButton("OK", (c, ev) =>
            {
                alert.Cancel();
            });
            alert.SetButton2("CANCEL", (c, ev) => { });
            alert.Show();
        }
Пример #26
0
        private void ListItemClicked(int position)
        {
            Intent intent = null;

            switch (position)
            {
            case 0:
                intent = new Intent(this, typeof(Recordatorio));
                break;

            case 1:
                intent = new Intent(this, typeof(Calculadora));
                break;

            case 2:
                intent = new Intent(this, typeof(GuiaList));
                break;

            case 3:
                intent = new Intent(this, typeof(PacienteList));
                break;

            case 4:
                AlertDialog.Builder dialog = new AlertDialog.Builder(this);
                AlertDialog         alert  = dialog.Create();
                alert.SetTitle("Salir de la aplicación");
                alert.SetIcon(Resource.Drawable.logo);
                alert.SetButton("Aceptar", (c, ev) =>
                {
                    this.FinishAffinity();
                    Finish();
                    Android.OS.Process.KillProcess(Android.OS.Process.MyPid());

                    GC.Collect();
                });

                alert.SetButton2("Cancelar", (c, ev) => { });
                alert.Show();
                break;
            }

            if (intent != null)
            {
                StartActivity(intent);
            }
        }
Пример #27
0
        private void ClickRemoveFile(object sender, EventArgs e)
        {
            Android.App.AlertDialog.Builder dialog = new Android.App.AlertDialog.Builder(this);
            Android.App.AlertDialog         alert  = dialog.Create();
            alert.SetTitle("Aviso");
            alert.SetMessage("¿Está seguro que desea quitar el Archivo?");
            alert.SetButton("Si", (c, ev) =>
            {
                ViewGroup fileRow = (ViewGroup)((View)sender).Parent;
                int filePosition  = filesContainer.IndexOfChild(fileRow);

                DeleteFile(attachedFiles[filePosition], filePosition);
            });

            alert.SetButton2("Cancelar", (c, ev) => { });

            alert.Show();
        }
Пример #28
0
        private void DeleteSize()
        {
            Android.App.AlertDialog.Builder builder = new Android.App.AlertDialog.Builder(this);
            Android.App.AlertDialog         alert   = builder.Create();
            alert.SetTitle("Delete Size");
            alert.SetMessage("When you delete this size, the products with this size will also be deleted. Continue?"); //indicate here if the size has fo

            alert.SetButton2("CANCEL", (c, ev) =>
            {
                //cancel button
            });
            alert.SetButton("YES", (c, ev) =>
            {
                mSizesDataAccess.DeleteFromTable(selectedRecordId);
                Finish();
            });
            alert.Show();
        }
        private void DeleteRunner()
        {
            Android.App.AlertDialog.Builder builder = new Android.App.AlertDialog.Builder(this);
            Android.App.AlertDialog         alert   = builder.Create();
            alert.SetTitle("Delete Runner?");
            alert.SetMessage("Do you want to delete this runner?"); //indicate here if the Runner has existing transactions

            alert.SetButton2("CANCEL", (c, ev) =>
            {
                //cancel button
            });
            alert.SetButton("YES", (c, ev) =>
            {
                mRunnerDataAccess.DeleteFromTable(selectedRunnerId);
                Finish();
            });
            alert.Show();
        }
        public override void OnBackPressed()
        {
            Android.App.AlertDialog.Builder builder = new Android.App.AlertDialog.Builder(this);
            Android.App.AlertDialog         alert   = builder.Create();
            alert.SetTitle("Cancel warning");
            alert.SetMessage("Are you sure you want to cancel?");

            alert.SetButton2("NO", (c, ev) =>
            {
                //cancel button
            });

            alert.SetButton("YES", (c, ev) =>
            {
                base.OnBackPressed();
            });

            alert.Show();
        }
Пример #31
0
 void DelegatDlaItemClick(AdapterView.ItemClickEventArgs e)
 {
     Tuple<string, string> item = lv.GetItemAtPosition(e.Position).Cast<Tuple<string, string>>();
     if (item.Item1 == nickname)
         return;
     ad = new AlertDialog.Builder(this).Create();
     ad.SetCancelable(false); // This blocks the 'BACK' button
     ad.SetMessage(string.Format("Czy chcesz zaprosiæ u¿ytkownika {0} do gry?", item.Item1));
     ad.SetButton("Nie", delegate
     {
     });
     ad.SetButton2("Tak", delegate
     {
         byte[] buff = new byte[MainActivity.MAX_LENGTH];
         buff = System.Text.Encoding.ASCII.GetBytes(string.Format("{0};{1}", Convert.ToInt32(MessageTypes.Invite), item.Item1));
         Sockets.client.GetStream().Write(buff, 0, buff.Length);
     });
     ad.Show();
 }
Пример #32
0
        void MessageExecuteThread()
        {
            byte[] buffer;
            NetworkStream stream = Sockets.client.GetStream();

            while (Sockets.client.Connected)
            {
                if (thLock)
                    continue;

                if (isPlaying)
                {
                    buffer = System.Text.Encoding.ASCII.GetBytes(string.Format("{0};{1}", Convert.ToInt32(MessageTypes.ListRequestClient), nickname));
                    stream.Write(buffer, 0, buffer.Length);
                    isPlaying = false;
                }

                try
                {
                    buffer = new byte[MainActivity.MAX_LENGTH];
                    stream.Read(buffer, 0, buffer.Length);
                    string[] data = MessageParser.Split(buffer);
                    if (data.Length == 1)
                    {
                        Sockets.client.Close();
                        RunOnUiThread(delegate {
                            ad = new AlertDialog.Builder(this).Create();
                            ad.SetCancelable(false); // This blocks the 'BACK' button
                            ad.SetMessage("Nie mo¿na po³¹czyæ siê z serwerem. SprawdŸ po³¹czenie z internetem.");
                            ad.SetButton("OK", delegate
                            {
                                Android.OS.Process.KillProcess(Android.OS.Process.MyPid());
                            });
                            ad.Show();
                        });
                    }
                    switch (MessageParser.ToMessageType(data[0]))
                    {
                        case MessageTypes.SendPlayers:
                            ParsePlayerList(data[1]);
                            lv.Post(delegate { lv.Adapter = new PlayerListAdapter(this, this.data); });
                            break;
                        case MessageTypes.InviteClient:
                            if (data[1] == nickname)
                                break;
                            RunOnUiThread(delegate
                            {                                
                                ad = new AlertDialog.Builder(this).Create();
                                ad.SetCancelable(false); // This blocks the 'BACK' button
                                ad.SetMessage(string.Format("Masz zaproszenie do gry od {0}.", data[1]));                                
                                ad.SetButton("Odrzuæ", delegate 
                                {
                                    buffer = System.Text.Encoding.ASCII.GetBytes(string.Format("{0};{1}", Convert.ToInt32(MessageTypes.Decline), data[1]));
                                    stream.Write(buffer, 0, buffer.Length);
                                    czyOtwartyAlert = false;
                                });
                                ad.SetButton2("Akceptuj", delegate
                                {
                                    buffer = System.Text.Encoding.ASCII.GetBytes(string.Format("{0};{1}", Convert.ToInt32(MessageTypes.Accept), data[1]));
                                    stream.Write(buffer, 0, buffer.Length);
                                    czyOtwartyAlert = false;
                                });
                                ad.Show();
                            });
                            czyOtwartyAlert = true;
                            while (czyOtwartyAlert)
                                continue;
                            Thread.Sleep(100);
                            break;
                        case MessageTypes.StartClient:
                            RunOnUiThread(delegate
                            {
                                Intent intent = new Intent(this, typeof(GameActivity));
                                intent.PutExtra("Nickname", nickname);
                                intent.PutExtra("Data", data[1]);
                                StartActivity(intent);
                            });
                            thLock = true;
                            isPlaying = true;
                            break;
						case MessageTypes.PlayerIsBusy:
							RunOnUiThread(delegate {
								ad = new AlertDialog.Builder(this).Create();
								ad.SetCancelable(false); // This blocks the 'BACK' button
								ad.SetMessage(string.Format("Gracz {0} jest zajêty.", data[1]));
								ad.SetButton("Zamknij", delegate {});
								ad.Show();
							});
							break;
                    }
                }
                catch (System.Threading.ThreadAbortException e)
                {
                    return;
                }
                catch (Exception e)
                {
                    Sockets.client.Close();
                    RunOnUiThread(delegate {
                        ad = new AlertDialog.Builder(this).Create();
                        ad.SetCancelable(false); // This blocks the 'BACK' button
                        ad.SetMessage("Nie mo¿na po³¹czyæ siê z serwerem. SprawdŸ po³¹czenie z internetem.");
                        ad.SetButton("OK", delegate
                        {
                            Android.OS.Process.KillProcess(Android.OS.Process.MyPid());
                        });
                        ad.Show();
                    });
                }
            }
        }