Exemple #1
0
        public IActionResult Update(Guid id, SysCompanyAddModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var hs = sysCompanyService.Update(id, model);

            var message = HandleError.GetMessage(hs, Crud.Update);

            ResultHandle result = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value
            };

            if (!hs.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }