예제 #1
0
        private void CreateWorkOrder()
        {
            AlertDialog.Builder alert = new AlertDialog.Builder(this);

            string    address   = customerAddress.Text;
            DataTable dataTable = DA.GetCustomerDataByAddress(address);

            if (dataTable.Rows.Count > 0)
            {
                alert.SetTitle("ALERT");
                alert.SetMessage("Are you sure you want to remove this cart from this customer?");

                alert.SetPositiveButton("YES", (senderAlert, args) => {
                    Toast.MakeText(this, "Removing cart from customer...", ToastLength.Short).Show();

                    DataAccess();
                });

                alert.SetNegativeButton("NO", (senderAlert, args) => {
                    Toast.MakeText(this, "Removal cancelled", ToastLength.Short).Show();
                });

                Dialog dialog = alert.Create();
                dialog.Show();
            }
        }
예제 #2
0
        private void CreateWorkOrder()
        {
            AlertDialog.Builder alert = new AlertDialog.Builder(this);

            dataLayer DA = new dataLayer();

            string    address   = editTxt2.Text;
            DataTable dataTable = DA.GetCustomerDataByAddress(address);

            if (dataTable.Rows.Count > 0)
            {
                alert.SetTitle("ALERT");
                alert.SetMessage("This customer already has a bin assigned to them\n\nWould you like to deliver this cart to them anyway?");

                alert.SetPositiveButton("YES", (senderAlert, args) => {
                    Toast.MakeText(this, "Delivering to existing customer...", ToastLength.Short).Show();

                    DataAccess();
                });

                alert.SetNegativeButton("NO", (senderAlert, args) => {
                    Toast.MakeText(this, "Delivery cancelled", ToastLength.Short).Show();
                });

                Dialog dialog = alert.Create();
                dialog.Show();
            }
        }