Esempio n. 1
0
        public CRUDResult <bool> Update(ConfigUpdateReq obj)
        {
            var getData =
                _readOnlyRepository.Value.GetById <Config>(
                    new Config()
            {
                Id = obj.Id
            });

            if (getData == null)
            {
                return(new CRUDResult <bool>()
                {
                    StatusCode = CRUDStatusCodeRes.ResourceNotFound
                });
            }
            var objConfig = Mapper.Map <ConfigUpdateReq, Config>(obj);

            objConfig.Currency     = obj.Currency;
            objConfig.Percent      = obj.Percent;
            objConfig.ReferalBonus = obj.ReferalBonus;
            objConfig.SystemEnable = obj.SystemEnable;
            _repository.Value.Update <Config>(objConfig);
            return(new CRUDResult <bool>()
            {
                Data = true, StatusCode = CRUDStatusCodeRes.Success
            });
        }
Esempio n. 2
0
        public IHttpActionResult Put([FromBody] ConfigUpdateReq model)
        {
            var result = _configServices.Update(model);

            return(ApiHelper.ReturnHttpAction(result, this));
        }