public async Task <IHttpActionResult> PuttMedicationForm(int id, tMedicationForm MedicationForm)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != MedicationForm.ID)
            {
                return(BadRequest());
            }

            db.Entry(MedicationForm).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!tMedicationFormExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public async Task <IHttpActionResult> GettMedicationForm(int id)
        {
            tMedicationForm tMedicationForm = await db.tMedicationForms.FindAsync(id);

            if (tMedicationForm == null)
            {
                return(NotFound());
            }

            return(Ok(tMedicationForm));
        }
        public async Task <IHttpActionResult> PosttMedicationForm(tMedicationForm MedicationForm)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.tMedicationForms.Add(MedicationForm);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = MedicationForm.ID }, MedicationForm));
        }
        public async Task <IHttpActionResult> DeletetMedicationForm(int id)
        {
            tMedicationForm tMedicationForm = await db.tMedicationForms.FindAsync(id);

            if (tMedicationForm == null)
            {
                return(NotFound());
            }

            db.tMedicationForms.Remove(tMedicationForm);
            await db.SaveChangesAsync();

            return(Ok(tMedicationForm));
        }