tags:

views:

231

answers:

1

I built a Parts Request form, and part of the form is the Approval process. This form sends an email message to the Requester indicating the decision. on My Supervisor form there are two radio buttons, one for approved and one for rejected.

Now my problem is, when reviewing the requests in the application, the decision is not always displayed. I have figured out that this is due to the form leaving the unchecked value null.
I have tried implicitly setting the opposing value to false. But this has not changed the form saving the value as null.

Here is the code that I am using.

private void sUP_APVRadioButton_CheckedChanged(object sender, EventArgs e)
    {
        sUP_REJRadioButton.Checked = false;
        SupDec = "Supervisor Approved Request #" + requestRecordNumberLabel1.Text;
        RouteAddress = PurchAuthUserName + Emaildomain;
        CcAddress = user_NameLabel1.Text.Substring(6) + Emaildomain + DevEmail;

    }


private void sUP_REJRadioButton_CheckedChanged(object sender, EventArgs e)
    {
        sUP_APVRadioButton.Checked = false;
        SupDec = "Supervisor Rejected Request#" + requestRecordNumberLabel1.Text;
        RouteAddress = user_NameLabel1.Text.Substring(6) + Emaildomain;

    }

Am I missing something?

Thanks

A: 

That's only setting the value of the radio button if someone changes it from one value to another. Do you explicitly state in the form which buttons should be checked by default?

Jon Skeet
No i do not, they both start out as null. I don't want one checked by default as the supervisor needs to make the decision. There are rules that are based on which item is checked, so I cannot default one, or the application would run itself. Is their a better way to assign the value than the way I have done in the code above? If an item is selected it is change from null to true, or am I misunderstanding the way that this function works?Thanks.
Well it sounds like you're trying to fix it in the wrong place. This code will only run when someone makes a decision to click on one of the buttons - and it sounds like they're not always doing so. If you require the decision to be made, you should put some validation in before proceeding.
Jon Skeet
They do click on the buttons.the problem I am having is that they will select Approved, approved gets a 1 in the database but Rejected is still null in the database.