示例#1
0
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            Utilities.Utilities ut = new Utilities.Utilities();

            if (!(tbLoc.Text.Equals("Enter Location")) || !(tbDest.Text.Equals("Enter Destination")) || !(startLoc.getReady() == 0) || !(destLoc.getReady() == 0))
            {
                string confirm = "Are you are heading from " + tbLoc.Text + " to " + tbDest.Text + "?";
                if (Sense.SenseMessageBox.Show(confirm, "Confirm Request", Sense.SenseMessageBox.SenseMessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    //send request through sms
                    if (ut.sendRequest(tbLoc.Text, tbDest.Text))
                    {
                        string str = "Your request has been sent to the TaxiShare system.";
                        if (Sense.SenseMessageBox.Show(str, "Request Confirmed", Sense.SenseMessageBox.SenseMessageBoxButtons.OK) == DialogResult.OK)
                        {

                            this.Dispose();
                            this.Close();
                        }
                    }
                    else
                    {
                        string str = "Your request has failed. Click OK to go back to the main menu.";
                        if (Sense.SenseMessageBox.Show(str, "Request Failed", Sense.SenseMessageBox.SenseMessageBoxButtons.OK) == DialogResult.OK)
                        {
                            this.Dispose();
                            this.Close();
                        }
                    }
                }
            }
            else
            {
                string str = "Please complete the request before confirming.";
                if (Sense.SenseMessageBox.Show(str, "Request Failed", Sense.SenseMessageBox.SenseMessageBoxButtons.OK) == DialogResult.OK)
                {
                }
            }
        }