Last active
September 18, 2022 14:50
-
-
Save fnbk/0ee794e1dcf82e394e7abfae31ebe4e2 to your computer and use it in GitHub Desktop.
branching: if-else
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
private Job CreateJob(order order) | |
{ | |
var errorMessage = ValidateComputer(order.ComputerName); | |
if (errorMessage != "") | |
{ | |
return new Job() | |
{ | |
ActivationTime = order.ClientLocalStartTime, | |
ComputerName = order.ComputerName, | |
orderId = order.Id, | |
Status = errorMessage, | |
}; | |
} | |
var computer = GetComputer(order.ComputerName, order.CustomerId); | |
computer.CustomerId = GetCustomerId(order.CustomerId, computer.CustomerId); | |
var serverAddress = GetServerAddress(order.ComputerName, computer.CustomerId); | |
var deploymentType = GetDeploymentType(order.MaterialNumber, computer.CustomerId); | |
return new Job() | |
{ | |
ActivationTime = order.ClientLocalStartTime, | |
ComputerName = order.ComputerName, | |
OrderId = order.Id, | |
JobActions = CreateJobActions(deploymentType, order, serverAddress, computer), | |
Status = "created", | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment