Link to home
Start Free TrialLog in
Avatar of JRockFL
JRockFLFlag for United States of America

asked on

Help with Enums

I am getting this error message "Cannot assign to 'GetOrderStatus' because it is a 'method group'"

//my enum
public enum OrderStatus
        {
            Approved,
            Declined,
            Error,
            Unknown
        }

// return the status of the order
     public OrderStatus GetOrderStatus()
        {
            string gatewayResponse = this.GetGatewayResponse();

            string[] response = gatewayResponse.Split('|');

            if (response[0].Trim(char.Parse("|")) == "1")
            {
                _message = response[3].Trim(char.Parse("|"));
                return OrderStatus.Approved;
            }
            else if (response[0].Trim(char.Parse("|")) == "2")
            {
                _message = response[3].Trim(char.Parse("|"));
                return OrderStatus.Declined;
            }
            else if (response[0].Trim(char.Parse("|")) == "3")
            {
                _message = response[3].Trim(char.Parse("|"));
                return OrderStatus.Error;
            }
            else
            {
                _message = "No order status available";
                return OrderStatus.Unknown;
            }
        }

This is the asp.net page
This is the part it doesnt like...any ideas?
=====================================================
if (objAuthorize.GetOrderStatus == Authorize.OrderStatus.Approved)
        {
            mvProcessPage.SetActiveView(vwApproved);
        }

        else
        {
            mvProcessPage.SetActiveView(vwDeclined);
        }
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JRockFL

ASKER

duh! thanks!!
Avatar of mrichmon
mrichmon

You cannot assign to a function.  That is the problem.  Notice that the definition of hte function is only returning a value.

Are you sure you have a double equal sign and not a single equal sign?