Beispiel #1
0
        public async Task <IHttpActionResult> PuttUserCarePlanType(int id, tUserCarePlanType tUserCarePlanType)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Beispiel #2
0
        public async Task <IHttpActionResult> GettUserCarePlanType(int id)
        {
            tUserCarePlanType tUserCarePlanType = await db.tUserCarePlanTypes.FindAsync(id);

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

            return(Ok(tUserCarePlanType));
        }
Beispiel #3
0
        public async Task <IHttpActionResult> PosttUserCarePlanType(tUserCarePlanType tUserCarePlanType)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.tUserCarePlanTypes.Add(tUserCarePlanType);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = tUserCarePlanType.ID }, tUserCarePlanType));
        }
Beispiel #4
0
        public async Task <IHttpActionResult> DeletetUserCarePlanType(int id)
        {
            tUserCarePlanType tUserCarePlanType = await db.tUserCarePlanTypes.FindAsync(id);

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

            db.tUserCarePlanTypes.Remove(tUserCarePlanType);
            await db.SaveChangesAsync();

            return(Ok(tUserCarePlanType));
        }