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

            if (id != salaryinfo.idSalaryinfo)
            {
                return(BadRequest());
            }

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

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

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

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

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

            db.salaryinfoes.Add(salaryinfo);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = salaryinfo.idSalaryinfo }, salaryinfo));
        }
Beispiel #4
0
        public async Task <IHttpActionResult> Deletesalaryinfo(int id)
        {
            salaryinfo salaryinfo = await db.salaryinfoes.FindAsync(id);

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

            db.salaryinfoes.Remove(salaryinfo);
            await db.SaveChangesAsync();

            return(Ok(salaryinfo));
        }