コード例 #1
0
        public async Task <IActionResult> RevisionsData(Guid id)
        {
            var languageUid = id;

            if (languageUid.IsEmptyGuid())
            {
                return(NotFound());
            }

            var request = new LanguageRevisionReadListRequest(CurrentUser.Id, languageUid);

            var response = await _languageService.GetLanguageRevisions(request);

            if (response.Status.IsNotSuccess)
            {
                return(NotFound());
            }

            var result = new DataResult();

            result.AddHeaders("revision", "revisioned_by", "revisioned_at", "language_name", "2_char_code", "3_char_code", "icon", "created_at", "");

            for (var i = 0; i < response.Items.Count; i++)
            {
                var revisionItem  = response.Items[i];
                var item          = revisionItem.Item;
                var stringBuilder = new StringBuilder();
                stringBuilder.Append($"{item.Uid}{DataResult.SEPARATOR}");
                stringBuilder.Append($"{revisionItem.Revision}{DataResult.SEPARATOR}");
                stringBuilder.Append($"{revisionItem.RevisionedByName}{DataResult.SEPARATOR}");
                stringBuilder.Append($"{GetDateTimeAsString(revisionItem.RevisionedAt)}{DataResult.SEPARATOR}");
                stringBuilder.Append($"{item.Name}{DataResult.SEPARATOR}");
                stringBuilder.Append($"{item.IsoCode2}{DataResult.SEPARATOR}");
                stringBuilder.Append($"{item.IsoCode3}{DataResult.SEPARATOR}");
                stringBuilder.Append($"{result.PrepareImage($"{item.IconPath}", item.OriginalName)}{DataResult.SEPARATOR}");
                stringBuilder.Append($"{GetDateTimeAsString(item.CreatedAt)}{DataResult.SEPARATOR}");
                stringBuilder.Append($"{result.PrepareRestoreButton("restore", "/Language/Restore/", "/Language/Detail")}{DataResult.SEPARATOR}");

                result.Data.Add(stringBuilder.ToString());
            }

            return(Json(result));
        }
コード例 #2
0
        public async Task <IActionResult> RevisionsData(Guid id)
        {
            var userUid = id;

            if (userUid.IsEmptyGuid())
            {
                return(NotFound());
            }

            var request = new UserRevisionReadListRequest(CurrentUser.Id, userUid);

            var response = await _organizationService.GetUserRevisions(request);

            if (response.Status.IsNotSuccess)
            {
                return(NotFound());
            }

            var result = new DataResult();

            result.AddHeaders("revision", "revisioned_by", "revisioned_at", "user_name", "email", "is_active", "created_at", "");

            for (var i = 0; i < response.Items.Count; i++)
            {
                var revisionItem  = response.Items[i];
                var item          = revisionItem.Item;
                var stringBuilder = new StringBuilder();
                stringBuilder.Append($"{item.Uid}{DataResult.SEPARATOR}");
                stringBuilder.Append($"{revisionItem.Revision}{DataResult.SEPARATOR}");
                stringBuilder.Append($"{revisionItem.RevisionedByName}{DataResult.SEPARATOR}");
                stringBuilder.Append($"{GetDateTimeAsString(revisionItem.RevisionedAt)}{DataResult.SEPARATOR}");
                stringBuilder.Append($"{result.PrepareLink($"/User/Detail/{item.Uid}", item.Name)}{DataResult.SEPARATOR}");
                stringBuilder.Append($"{item.Email}{DataResult.SEPARATOR}");
                stringBuilder.Append($"{item.IsActive}{DataResult.SEPARATOR}");
                stringBuilder.Append($"{GetDateTimeAsString(item.CreatedAt)}{DataResult.SEPARATOR}");
                stringBuilder.Append($"{result.PrepareRestoreButton("restore", "/User/Restore/", "/User/Detail")}{DataResult.SEPARATOR}");

                result.Data.Add(stringBuilder.ToString());
            }

            return(Json(result));
        }