public async Task <IActionResult> Post([FromBody] PharmMedicine pharmMed)
        {
            // adding medicine
            var addedMeds = await this._dataManager.OperateAsync <PharmMedicine, object>("AddPharmacyMedicine", pharmMed);

            // if medicine exists return 'Conflict' code
            if ((int)addedMeds == -1)
            {
                return(new StatusCodeResult(409));
            }

            // returning 200
            return(Ok());
        }
Ejemplo n.º 2
0
        public async Task <bool> CreatePharmacyMedicineAsync(PharmMedicine medicine)
        {
            var response = await this.CreateAsync <PharmMedicine>("api/pharmmeds", medicine);

            return(response.IsSuccessStatusCode);
        }