예제 #1
0
        public async Task <ApiResult> GetContractDetails([FromBody] ContractDetails.Command command)
        {
            try
            {
                var result = await _mediator.Send(command);

                return(new ApiResult(HttpStatusCode.OK)
                {
                    Body = ContractDisplay.ContractDetails(result.Contract)
                });
            }
            catch
            {
                return(new ApiResult(HttpStatusCode.NotFound, "Unable to find the contract specified."));
            }
        }
예제 #2
0
 public void Display(Contract contract)
 {
     currentContract = contract;
     if(contract == null)
     {
         gameObject.SetActive(false);
     }
     else
     {
         gameObject.SetActive (true);
         if(display == null)
         {
             display = Instantiate(PrefabManager.ContractDisplay, Vector3.zero, Quaternion.identity) as ContractDisplay;
             display.transform.SetParent(this.transform, false);
         }
         display.Display(contract);
     }
 }