public ActionResult <Organization> PutOrganization([FromBody] Organization organization)
        {
            try
            {
                _log4net.Info("HttpPost Request Initiated for Id " + organization.Id);

                if (ModelState.IsValid)
                {
                    _log4net.Info("Model state is  valid for Id " + organization.Id);


                    var updateorganization = _repository.Update(organization);

                    if (updateorganization != null)
                    {
                        return(Ok(updateorganization));
                    }


                    return(BadRequest());
                }
            }
            catch (Exception e)
            {
                _log4net.Error("Model state is not valid for id " + organization.Id + e.Message);
                return(NotFound());
            }
            return(BadRequest());
        }
        public void SoldAccount(int accountId)
        {
            var acc = _repoAccount.ReadOne(a => a.Id == accountId);

            acc.IsAvailable = false;
            _repoAccount.Update(acc);
        }
示例#3
0
 public Books Update(Books entity)
 {
     if (entity.Id <= 0)
     {
         throw new ArgumentException("ID requires to be greater than 0.");
     }
     return(repos.Update(entity));
 }
示例#4
0
        public async Task <ActionResult <int> > Update(TEntity entity)
        {
            var data = await _repo.Update(entity);

            if (data.Equals(null))
            {
                return(BadRequest("Something Wrong Please check again"));
            }
            return(data);
        }
示例#5
0
        public void UpdateBalanceUser(string generalUserId, float?balance)
        {
            var user = _userRepositories.ReadOne(a => a.GeneralUserId == generalUserId);

            if (user != null && balance != null)
            {
                user.Balance = balance ?? 0;
                _userRepositories.Update(user);
            }
        }
示例#6
0
        public void Update(Movie movie, Guid[] locations)
        {
            movie.Locations = new HashSet <LocationMovies>();

            foreach (Guid id in locations)
            {
                movie.Locations.Add(new LocationMovies {
                    LocationId = id
                });
            }
            _repo.Update(movie);
        }
        public void Update(Location location, Guid[] movies)
        {
            location.Movies = new HashSet <LocationMovies>();

            foreach (Guid id in movies)
            {
                location.Movies.Add(new LocationMovies {
                    MovieId = id
                });
            }
            _repo.Update(location);
        }
示例#8
0
 public Users Update(Users user)
 {
     return(repos.Update(user));
 }