Created
March 2, 2011 20:16
-
-
Save mhenrixon/851652 to your computer and use it in GitHub Desktop.
the c# way of doing if statements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ((order.status != :created) and !(User.Current.IsInRole("Admin") | |
{ | |
ViewBag.Alert = "This order cannot be changed since work has begun; | |
Response.Redirect(string.Format("/Orders/", order.Id); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unless current_user.has_role?(:admin) or @order.status == :created | |
redirect_to @order, :alert => "This order cannot be changed since work has begun" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment