Пример #1
0
        public string GetChangeFromSourceControl(int changeId, int codeId)
        {
            if (!AuthorizeManager.IsAuthorizeToViewSourceCodeOfService(codeId))
            {
                throw new UnauthorizedAccessException(LanguageManager.ToAsErrorMessage(ExceptionKey.InvalidGrant));
            }



            var change = _sourceControl.GeChangeById(changeId, Config.ServicesSourceCodePath);

            if (change == null)
            {
                throw new KhodkarInvalidException(LanguageManager.ToAsErrorMessage(ExceptionKey.ChangeNotFound));
            }

            if (change.Code == null)
            {
                throw new KhodkarInvalidException(LanguageManager.ToAsErrorMessage(ExceptionKey.ChangeHasNoCode));
            }
            return(change.Code);
        }