Beispiel #1
0
        public IHttpActionResult LogPharmacyVisit(Gln gln)
        {
            if (Equals(gln, null))
            {
                return(BadRequest());
            }

            var glnToUpdate     = _unitOfWork.Glns.FindSingle(g => g.Id == gln.Id);
            var glnBeforeUpdate = DtoHelper.CreateGlnIncludeChildrenDto(glnToUpdate);

            if (Equals(glnToUpdate, null))
            {
                return(BadRequest());
            }

            try
            {
                _logger.SiteVisitedLog(HttpContext.Current.User, glnBeforeUpdate);

                return(Ok());
            }
            catch (Exception ex)
            {
                _logger.FailedUpdateServerLog(HttpContext.Current.User, ex.Message, ex.InnerException, DtoHelper.CreateGlnIncludeChildrenDto(glnToUpdate), DtoHelper.CreateGlnIncludeChildrenDto(glnToUpdate));
                return(InternalServerError());
            }
        }