示例#1
0
        public IHttpActionResult PutKorisnici(int id, Administrator_SelectOne a)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != a.AdministratorId)
            {
                return(BadRequest());
            }

            try
            {
                db.tsp_Administrator_Update(a.AdministratorId, a.Ime, a.Prezime, a.Email, a.Telefon, a.KorisnickoIme, a.LozinkaHash, a.LozinkaSalt);
            }
            catch (EntityCommandExecutionException ex)
            {
                var          nesto  = ex.GetType().ToString();
                SqlException greska = ex.InnerException as SqlException;
                if (greska != null)
                {
                    return(BadRequest(Util.ExceptionHandler.DbUpdateExceptionHandler(greska)));
                }
            }



            return(StatusCode(HttpStatusCode.NoContent));
        }