public IHttpActionResult Put([FromBody] RecordView vaccine, HttpRequestMessage request)
        {
            try
            {
                VaccineManager.SaveRecord(vaccine);
            }
            catch (System.Exception ex)
            {
                return(BadRequest(ex.Message));
            }

            return(Ok());
        }
        public HttpResponseMessage Get()
        {
            List <RecordView> records = new List <RecordView>();

            records = VaccineManager.GetRecords("Tina");
            if (records != null)
            {
                return(new HttpResponseMessage(HttpStatusCode.OK)
                {
                    Content = new StringContent(JsonConvert.SerializeObject(records), System.Text.Encoding.UTF8, "application/json")
                });
            }
            else
            {
                return(new HttpResponseMessage(HttpStatusCode.NotFound)
                {
                    Content = new StringContent(JsonConvert.SerializeObject("Not found vaccines"), System.Text.Encoding.UTF8, "application/json")
                });
            }
        }
示例#3
0
    void Start()
    {
        vaccineManager = vaccineManagerObject.GetComponent <VaccineManager>();

        gameManager = GameObject.Find("GameManager");

        money = gameManager.GetComponent <Money>();

        if (ApplicationModel.wentToResearch)
        {
            day  = PersistInformation.days;
            week = PersistInformation.weeks;

            if (PersistInformation.currVaccine != null)
            {
                vaccineManager.currVaccine = PersistInformation.currVaccine;
                progressPanel.SetActive(true);
            }
        }
    }
示例#4
0
 public VaccineController(ILogger <VaccineController> logger, VaccineManager vaccineManager, DogManager dogManager)
 {
     _logger         = logger;
     _vaccineManager = vaccineManager;
     _dogManager     = dogManager;
 }