示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                DataSet ds = new DataSet();
                transaction        = new BIZ.Transaction();
                transaction.ClubID = ClubID;
                transaction.UserID = UserID;

                if (txtMobileNumber.Text.Length != 11)
                {
                    MessageBox.Show("Invalid Mobile Number");
                }
                else if (txtPinNumber.Text.Length != 11)
                {
                    MessageBox.Show("Invalid Pin Number");
                }
                else
                {
                    transaction.MobileNumber = txtMobileNumber.Text;
                    transaction.PinNumber    = txtPinNumber.Text;
                    ds = transaction.LoadAccessNumber();

                    if (ds.Tables.Count > 0)
                    {
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            MessageBox.Show(ds.Tables[0].Rows[0]["ReplyMessage"].ToString(), "Message");

                            if (ds.Tables[0].Rows[0]["IsValid"].ToString() == "1")
                            {
                                txtMobileNumber.Text = "";
                                txtPinNumber.Text    = "";
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
            }
        }