private void btnUpdateStatatus_Clicked(object sender, EventArgs e)
        {
            var btn = sender as Button;

            if (btn.StyleId == "4")
            {
                string comment = "";
                var    popup   = new EntryPopup(AppResource.alertFillMotiveCancel, "", AppResource.alertSave, AppResource.alertCancel);
                popup.PopupClosed += async(o, closedArgs) =>
                {
                    if (closedArgs.Button == AppResource.textOk || closedArgs.Button == AppResource.alertSave)
                    {
                        try
                        {
                            comment = closedArgs.Text;

                            var status = Convert.ToInt32(btn.StyleId);

                            UpdateOrder(status, comment);
                        }
                        catch (Exception ex)
                        {
                            ex.ToString();
                        }
                    }
                };

                popup.Show();
            }
            else
            {
                UpdateOrder(Convert.ToInt32(btn.StyleId));
            }
        }
        private void OnTipsTapped(object sender, EventArgs e)
        {
            var popup = new EntryPopup(AppResource.alertFillTips, "", AppResource.textOk, AppResource.alertCancel);

            popup.PopupClosed += async(o, closedArgs) =>
            {
                if (closedArgs.Button == AppResource.textOk)
                {
                    try
                    {
                        _checkin.PriceTipPaid = Convert.ToDecimal(closedArgs.Text);
                        lblTip.Text           = String.Format(App.AppCurrent.CompanyCulture, "{0:C}", _checkin.PriceTipPaid);
                        _total = _subTotal + _checkin.PriceTipPaid + _checkin.PriceTaxPaid;
                        var newtotal = _total - _checkin.PriceDiscount;


                        if (newtotal < 0)
                        {
                            newtotal = 0;
                        }

                        lblTotalBePaid.Text = String.Format(App.AppCurrent.CompanyCulture, "{0:C}", newtotal);

                        lblTipTitle.Text = AppResource.lblTips;
                    }
                    catch (Exception ex)
                    {
                        this.DisplayAlert(MocoApp.Resources.AppResource.alertAlert, AppResource.alertOnlyNumber, AppResource.textOk);
                    }
                }
            };

            popup.Show();
        }
        private async void OnDescontoTapped(object sender, EventArgs e)
        {
            var popup = new EntryPopup(AppResource.alertFillDiscount, "", AppResource.textOk, AppResource.alertCancel);

            popup.PopupClosed += async(o, closedArgs) =>
            {
                if (closedArgs.Button == AppResource.textOk)
                {
                    try
                    {
                        _checkin.PriceDiscount = Convert.ToDecimal(closedArgs.Text);
                        lblDesconto.Text       = String.Format(App.AppCurrent.CompanyCulture, "{0:C}", _checkin.PriceDiscount);
                        var newtotal = (_total - Convert.ToDecimal(_checkin.PriceDiscount));

                        if (newtotal < 0)
                        {
                            newtotal = 0;
                        }

                        lblTotalBePaid.Text = String.Format(App.AppCurrent.CompanyCulture, "{0:C}", newtotal);
                    }
                    catch (Exception ex)
                    {
                        this.DisplayAlert(MocoApp.Resources.AppResource.alertAlert, AppResource.alertOnlyNumber, AppResource.textOk);
                    }
                }
            };

            popup.Show();
        }
Exemple #4
0
        public void ShowPopup(EntryPopup popup)
        {
            var alert = new AlertDialog.Builder(Forms.Context);

            var edit = new EditText(Forms.Context)
            {
                Text = popup.Text
            };

            alert.SetView(edit);

            alert.SetTitle(popup.Title);

            alert.SetPositiveButton("OK", (senderAlert, args) =>
            {
                popup.OnPopupClosed(new EntryPopupClosedArgs
                {
                    Button = "OK",
                    Text   = edit.Text
                });
            });

            alert.SetNegativeButton("Cancel", (senderAlert, args) =>
            {
                popup.OnPopupClosed(new EntryPopupClosedArgs
                {
                    Button = "Cancel",
                    Text   = edit.Text
                });
            });
            alert.Show();
        }
        public void ShowPopup(EntryPopup popup)
        {
            var alert = new UIAlertView
            {
                Title          = popup.Title,
                Message        = popup.Text,
                AlertViewStyle = UIAlertViewStyle.PlainTextInput,
            };

            popup.Text = "0";
            foreach (var b in popup.Buttons)
            {
                alert.AddButton(b);
            }

            alert.Clicked += (s, args) =>
            {
                popup.OnPopupClosed(new EntryPopupClosedArgs
                {
                    Button = popup.Buttons.ElementAt(Convert.ToInt32(args.ButtonIndex)),
                    Text   = alert.GetTextField(0).Text
                });
            };
            alert.Show();
        }
        public void Comment()
        {
            EntryPopup popup = new EntryPopup("Your Comment", string.Empty, "OK", "Cancel");

            popup.PopupClosed += (o, closedArgs) => PostComment(o, closedArgs);
            popup.Show();
        }
        /*private bool IsCharValid (char c)
         * {
         *  return Char.IsLetterOrDigit (c) ||
         *      Char.IsPunctuation (c) ||
         *      Char.IsSymbol (c);
         * }*/

        protected override bool OnKeyPressEvent(Gdk.EventKey press)
        {
            // TODO this pops it up whenever any key is pressed, like a normal TreeView.
            // But, Banshee has single-char keybindings, so for now at least, require
            // ? (== shift / on US keyboards, at least) to be pressed.

            /*char input = Convert.ToChar (Gdk.Keyval.ToUnicode (press.KeyValue));
             * if (!IsCharValid (input) || Model as ISelectable == null) {
             *  return base.OnKeyPressEvent (press);
             * }*/

            if (press.Key != Gdk.Key.question)
            {
                return(base.OnKeyPressEvent(press));
            }

            if (search_popup == null)
            {
                search_popup          = new EntryPopup();
                search_popup.Changed += (o, a) => {
                    search_offset = 0;
                    PerformSearch(search_popup.Text);
                };

                search_popup.KeyPressed += OnPopupKeyPressed;
            }

            search_popup.Position(EventWindow);
            search_popup.HasFocus = true;
            search_popup.Show();
            search_popup.Text           = String.Format("{0}{1}", search_popup.Text, "");//input);
            search_popup.Entry.Position = search_popup.Text.Length;
            return(true);
        }
Exemple #8
0
    IEnumerator ShowEntryPopup()
    {
        yield return(new WaitForSeconds(15));

        var popup = EntryPopup.Instance();

        popup.OpenWithEntry(entryManager.GetRandomEntry());
    }
Exemple #9
0
        public void ShowPopup(EntryPopup popup, string type)
        {
            var alert = new AlertDialog.Builder(CrossCurrentActivity.Current.Activity);

            EditText edit = null;

            switch (type)
            {
            case "Number":
                edit = new EditText(CrossCurrentActivity.Current.Activity)
                {
                    Text = popup.Text, InputType = (InputTypes.ClassNumber)
                };
                break;

            case "Decimal":
                edit = new EditText(CrossCurrentActivity.Current.Activity)
                {
                    Text = popup.Text, InputType = (InputTypes.ClassNumber | InputTypes.NumberFlagDecimal)
                };
                break;

            default:
                edit = new EditText(CrossCurrentActivity.Current.Activity)
                {
                    Text = popup.Text
                };
                break;
            }

            alert.SetView(edit);
            alert.SetTitle(popup.Title);

            alert.SetPositiveButton(popup.Buttons[0], (senderAlert, args) =>
            {
                popup.OnPopupClosed(new EntryPopupClosedArgs
                {
                    Button = popup.Buttons[0],
                    Text   = edit.Text
                });
            });

            alert.SetNegativeButton(popup.Buttons[1], (senderAlert, args) =>
            {
                popup.OnPopupClosed(new EntryPopupClosedArgs
                {
                    Button = popup.Buttons[1],
                    Text   = edit.Text
                });
            });
            alert.Show();
        }
Exemple #10
0
        private void btnDecline_Clicked(object sender, EventArgs e)
        {
            string comment = "";
            var    popup   = new EntryPopup(AppResource.alertFillMotiveCancel, "", AppResource.alertSave, AppResource.alertCancel);

            popup.PopupClosed += async(o, closedArgs) =>
            {
                if (closedArgs.Button == AppResource.textOk || closedArgs.Button == AppResource.alertSave)
                {
                    comment = closedArgs.Text;

                    UpdateCheckin(comment);
                }
            };

            popup.Show();
        }
Exemple #11
0
        private FloatingActionButtonView InitializeFloatingButton()
        {
            FloatingActionButtonView floatingButton = new FloatingActionButtonView();
            EntryPopup entryPopup = new EntryPopup();

            entryPopup.SetOnBackButtonPressed(floatingButton);
            entryPopup.SetOnAppearing(floatingButton);

            floatingButton.ColorNormal  = Color.FromRgb(33, 150, 243);
            floatingButton.ColorPressed = floatingButton.ColorNormal.AddLuminosity(0.1);
            floatingButton.ColorRipple  = floatingButton.ColorNormal.AddLuminosity(0.2);
            floatingButton.ImageName    = "ic_add.png";
            AbsoluteLayout.SetLayoutFlags(floatingButton, AbsoluteLayoutFlags.PositionProportional);
            AbsoluteLayout.SetLayoutBounds(floatingButton, new Rectangle(1f, 1f, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));

            return(floatingButton);
        }
Exemple #12
0
        private void OnTipsTapped(object sender, EventArgs e)
        {
            if (_checkin.CheckinStatus != Enums.CheckinStatus.Checkin)
            {
                return;
            }

            var popup = new EntryPopup(AppResource.alertFillTips, "", AppResource.textOk, AppResource.alertCancel);

            popup.PopupClosed += async(o, closedArgs) =>
            {
                if (closedArgs.Button == AppResource.textOk)
                {
                    try
                    {
                        _checkin.PriceTipPaid = Convert.ToDecimal(closedArgs.Text);
                        lblTip.Text           = String.Format(App.AppCurrent.CompanyCulture, "{0:C}", _checkin.PriceTipPaid);
                        //var newtotal = _checkin.SubTotal + Convert.ToDecimal(_checkin.PriceTipPaid) - _checkin.PriceDiscount;


                        var newtotal = _checkin.CalcTotalToBePaidByTip(_checkin.TotalToBePaid, _checkin.Company.RecommendedTipPercentage, _checkin.Company.TaxPercentage, _checkin.PriceTipPaid, _sub);

                        if (newtotal < 0)
                        {
                            newtotal = 0;
                        }

                        lblTotalBePaid.Text = String.Format(App.AppCurrent.CompanyCulture, "{0:C}", newtotal);
                        //lblTotalBePaid.Text = String.Format(new System.Globalization.CultureInfo("en-US"), "{0:C}", newtotal);

                        lblTipTitle.Text = AppResource.lblTips;
                    }
                    catch (Exception ex)
                    {
                        this.DisplayAlert(MocoApp.Resources.AppResource.alertAlert, AppResource.alertOnlyNumber, AppResource.textOk);
                    }
                }
            };

            popup.Show();
        }
        async void sendPerforma(object sender, EventArgs e)
        {
            sendPerformaButton.IsEnabled = false;
            if (emailAddress == Constants._notAvailable)
            {
                var popup = new EntryPopup("Please Enter Email Address Below", string.Empty, Constants._buttonOkay, Constants._buttonClose);
                popup.PopupClosed += async(o, closedArgs) =>
                {
                    if (closedArgs.Button == "Ok")
                    {
                        emailAddress = closedArgs.Text;
                        await emailAddressENtered();
                    }
                    else
                    {
                        sendPerformaButton.IsEnabled = true;
                    }
                };
                popup.Show();
            }
            else
            {
                string result = await checkinManager.SendPerformaEmailAvailable(Constants._reservation_id);

                var output = JObject.Parse(result);
                if (Enumerable.Count(output["d"]["results"]) == 0)
                {
                    await DisplayAlert(Constants._headerMessage, Constants._emailSent, Constants._buttonOkay);

                    sendPerformaButton.IsEnabled = true;
                }
                else
                {
                    await DisplayAlert(Constants._headerMessage, Constants._emailNotSent, Constants._buttonOkay);

                    sendPerformaButton.IsEnabled = true;
                }
            }
        }
Exemple #14
0
        private void OnAddWallet(object sender, EventArgs args)
        {
            var popup = new EntryPopup(ApplicationText.NameOfWallet, string.Empty, ApplicationText.Ok, ApplicationText.Cancel);

            popup.PopupClosed += (o, closedArgs) => {
                if (closedArgs.Button == ApplicationText.Ok)
                {
                    if (string.IsNullOrWhiteSpace(closedArgs.Text))
                    {
                        return;
                    }

                    Wallet wallet = new Wallet {
                        Name = closedArgs.Text
                    };
                    _wallets.Add(wallet);

                    UpdateSummary();
                }
            };

            popup.Show("Text");
        }
Exemple #15
0
        public void ShowPopup(EntryPopup popup)
        {
            AlertDialog.Builder alert = new AlertDialog.Builder(MainActivity.Instance);

            EditText edit = new EditText(MainActivity.Instance)
            {
                Text = popup.Text
            };

            edit.SetSingleLine(false);
            edit.InputType |= Android.Text.InputTypes.TextFlagMultiLine;
            edit.SetLines(2);
            edit.SetMaxLines(5);
            edit.Gravity = GravityFlags.Left | GravityFlags.Top;
            edit.VerticalScrollBarEnabled = false;

            alert.SetView(edit);
            alert.SetTitle(popup.Title);
            alert.SetPositiveButton("OK", (senderAlert, args) =>
            {
                popup.OnPopupClosed(new EntryPopupClosedArgs
                {
                    Button = "OK",
                    Text   = edit.Text
                });
            });

            alert.SetNegativeButton("Cancel", (senderAlert, args) =>
            {
                popup.OnPopupClosed(new EntryPopupClosedArgs
                {
                    Button = "Cancel",
                    Text   = edit.Text
                });
            });
            alert.Show();
        }
Exemple #16
0
        private async void OnTipsTapped(object sender, EventArgs e)
        {
            if (isClosed)
            {
                return;
            }

            var popup = new EntryPopup(AppResource.alertFillTips, "", AppResource.textOk, AppResource.alertCancel);

            popup.PopupClosed += async(o, closedArgs) =>
            {
                if (closedArgs.Button == AppResource.textOk)
                {
                    try
                    {
                        _checkin.PriceTipPaid = Convert.ToDecimal(closedArgs.Text);
                        lblTip.Text           = String.Format(new System.Globalization.CultureInfo("en-US"), "{0:C}", _checkin.PriceTipPaid);
                        var newtotal = total + Convert.ToDecimal(_checkin.PriceTipPaid);


                        if (newtotal < 0)
                        {
                            newtotal = 0;
                        }

                        lblTotals.Text   = String.Format(new System.Globalization.CultureInfo("en-US"), "{0:C}", newtotal);
                        lblTipTitle.Text = AppResource.lblTips;
                    }
                    catch (Exception ex)
                    {
                        this.DisplayAlert(MocoApp.Resources.AppResource.alertAlert, AppResource.alertOnlyNumber, AppResource.textOk);
                    }
                }
            };

            popup.Show();
        }
Exemple #17
0
        // Crea el floatingButton y le añade las características básicas
        private FloatingActionButtonView InitializeFloatingButton()
        {
            FloatingActionButtonView floatingButton = new FloatingActionButtonView();
            EntryPopup entryPopup = new EntryPopup();

            entryPopup.SetOnBackButtonPressed(floatingButton);
            entryPopup.SetOnAppearing(floatingButton);

            floatingButton.ColorNormal  = Color.FromRgb(33, 150, 243);
            floatingButton.ColorPressed = floatingButton.ColorNormal.AddLuminosity(0.1);
            floatingButton.ColorRipple  = floatingButton.ColorNormal.AddLuminosity(0.2);
            floatingButton.Clicked      = async(sender, args) =>
            {
                //var animate = await this.DisplayAlert("Fab", "Hide and show the Fab?", "Sure", "Not now");
                //if (!animate) return;

                entryPopup.Display(chartService, _master.GetNavigationPage);
            };
            floatingButton.ImageName = "ic_add.png";
            AbsoluteLayout.SetLayoutFlags(floatingButton, AbsoluteLayoutFlags.PositionProportional);
            AbsoluteLayout.SetLayoutBounds(floatingButton, new Rectangle(1f, 1f, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));

            return(floatingButton);
        }
Exemple #18
0
 private void Start()
 {
     entryPopup = FindObjectOfType(typeof(EntryPopup)) as EntryPopup;
     entryPopupObject.SetActive(false);
 }