public async Task <IHttpActionResult> Posttbl_DTCTcrmrange(tbl_DTCTcrmrange tbl_DTCTcrmrange)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.tbl_DTCTcrmrange.Add(tbl_DTCTcrmrange);

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (tbl_DTCTcrmrangeExists(tbl_DTCTcrmrange.crm_id))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = tbl_DTCTcrmrange.crm_id }, tbl_DTCTcrmrange));
        }
        public async Task <IHttpActionResult> Puttbl_DTCTcrmrange(string id, tbl_DTCTcrmrange tbl_DTCTcrmrange)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != tbl_DTCTcrmrange.crm_id)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public async Task <IHttpActionResult> Gettbl_DTCTcrmrange(string id)
        {
            tbl_DTCTcrmrange tbl_DTCTcrmrange = await db.tbl_DTCTcrmrange.FindAsync(id);

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

            return(Ok(tbl_DTCTcrmrange));
        }
        public async Task <IHttpActionResult> Deletetbl_DTCTcrmrange(string id)
        {
            tbl_DTCTcrmrange tbl_DTCTcrmrange = await db.tbl_DTCTcrmrange.FindAsync(id);

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

            db.tbl_DTCTcrmrange.Remove(tbl_DTCTcrmrange);
            await db.SaveChangesAsync();

            return(Ok(tbl_DTCTcrmrange));
        }