Skip to content

Conversation

@turbcool
Copy link
Contributor

No description provided.

* [Задать детейлы в представление](fa_prop-order-limit-editor.html), если их ещё там нет.
* Задать [свойство AutoAddUsedInLimitationProperties](fa_prop-order-limit-editor.html), чтобы представление формировалось динамически.
* Определить механизм формирования динамического представления для детейлов через интерфейс ICSSoft.STORMNET.Windows.Forms.IViewGenerator (расположен в сборке ExternalLangDef). Например, в версии после 14.01.2015 можно в конфиг добавить следующую строчку:
* Определить механизм формирования динамического представления для детейлов через интерфейс ICSSoft.STORMNET.Windows.Forms.IViewGenerator (расположен в сборке ICSSoft.STORMNET.Business.ExternalLangDef). Например, в версии после 14.01.2015 можно в конфиг добавить следующую строчку:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вероятно фразу "в версии после 14.01.2015" уже можно удалить.
И также написать альтернативный вариант, как такое сделать с помощью кода.

<container>
...
<register type="ICSSoft.STORMNET.Windows.Forms.IViewGenerator, ExternalLangDef" mapTo="NewPlatform.Flexberry.Web.Page.LimitEditorViewGenerator, NewPlatform.Flexberry.Web.LimitEditor" />
<register type="ICSSoft.STORMNET.Windows.Forms.IViewGenerator, ICSSoft.STORMNET.Business.ExternalLangDef" mapTo="NewPlatform.Flexberry.Web.Page.LimitEditorViewGenerator, NewPlatform.Flexberry.Web.LimitEditor" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Надо перепроверить, актуален ли вариант, указанный в "mapTo".


* **ChangesToSqlBTMonitor.dll** - библиотека, содержащая классы для работы [сервиса записи SQL-скриптов изменения данных](fo_changes-sql-bt-monitor.html).
* **ExternalLangDef.dll** - библиотека, содержащая [расширение языка ограничений](fo_external-lang-def.html) для [задания ограничений](fo_limit-function.html) на зависимые объекты.
* **ChangesToSqlBTMonitor.dll** - библиотека, содержащая
Copy link
Contributor

@Anisimova2020 Anisimova2020 Jul 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Что-то не до конца поправлено? Эта библиотека ещё есть?

### Сервис данных

По умолчанию для выгрузки в Excel используется сервис данных `DataServiceProvider.DataService`. Если требуется задать другой, отдельный сервис данных для выгрузки в Excel, то это может быть сделано в `Web.config` путем регистрации сервиса под именем `ExcelExportDataService` в `Unity`. Пример конфигурации, чтобы для выгрузки в Excel использовался сервис данных `IcsharpSoft.STORMNET.Business.DRDataService`:
По умолчанию для выгрузки в Excel используется сервис данных `DataServiceProvider.DataService`. Если требуется задать другой, отдельный сервис данных для выгрузки в Excel, то это может быть сделано в `Web.config` путем регистрации сервиса под именем `ExcelExportDataService` в `Unity`. Пример конфигурации, чтобы для выгрузки в Excel использовался сервис данных `ICSSoft.STORMNET.Business.DRDataService`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно перепроверить, что "По умолчанию для выгрузки в Excel используется сервис данных DataServiceProvider.DataService." Вообще нужно отметить, что DataServiceProvider.DataService ныне obsolete.
Также сейчас для сервисов данных регистрация в Юнити выглядит иначе.

…xberry.github.io into feature-232917-update-docs

```csharp
IUnityContainer container = UnityFactory.CreateContainer();
IUnityContainer container = UnityFactory.CreateContainer(); //UnityFactory is deprecated. Inject IUnityContainer (or IServiceProvider) instead.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Мне кажется, что само упоминание UnityFactory в этом месте нужно вырезать в коде. То есть в коде показать, как правильно, без factory, а в комментарии указать, что ранее использовалось UnityFactory, но ныне этот класс устарел.

IDataService dataService = container.Resolve<IDataService>("DRDataService");
dataService.CustomizationString = DataServiceProvider.DataService.CustomizationString;
```
dataService.CustomizationString = DataServiceProvider.DataService.CustomizationString; // DataServiceProvider is deprecated; inject IDataService instead
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Аналогично: код меняем на то, что ныне правильно.

<unity xmlns="http://schemas.microsoft.com/practices/2010/unity">
<container>
<register name="DRDataService" type="ICSSoft.STORMNET.Business.IDataService, ICSSoft.STORMNET.Business" mapTo="ICSSoft.STORMNET.Business.DRDataService, ICSSoft.STORMNET.Business.DRDataService">
<register name="DRDataService" type="ICSSoft.STORMNET.Business.IDataService, ICSSoft.STORMNET.Business" mapTo="ICSSoft.STORMNET.Business.DRDataService, ICSSoft.STORMNET.Business.MSSQLDataService">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Сейчас сервисы данных иначе регистрируются


```csharp
IUnityContainer container = UnityFactory.CreateContainer();
IUnityContainer container = UnityFactory.CreateContainer(); // UnityFactory устарел. Вместо него используйте внедрение зависимостей (инжектите IUnityContainer/IServiceProvider или напрямую нужные зависимости).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Код нужно написать по-новому.

IUnityContainer container = UnityFactory.CreateContainer(); // UnityFactory устарел. Вместо него используйте внедрение зависимостей (инжектите IUnityContainer/IServiceProvider или напрямую нужные зависимости).
IDataService dataService = container.Resolve<IDataService>("DRDataService");
dataService.CustomizationString = DataServiceProvider.DataService.CustomizationString;
dataService.CustomizationString = DataServiceProvider.DataService.CustomizationString; // DataServiceProvider устарел; вместо него используйте внедрение зависимостей.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Код нужно написать по-новому.

var lcs = LoadingCustomizationStruct.GetSimpleStruct(typeof(СтрокаЗаказа), СтрокаЗаказа.Views.СтрокаЗаказаE);
lcs.LimitFunction = FunctionBuilder.BuildEquals<СтрокаЗаказа>(x => x.Заказ, заказ);
var строкиЗаказа = DataServiceProvider.DataService.LoadObjects(lcs);
var строкиЗаказа = DataServiceProvider.DataService.LoadObjects(lcs); // DataServiceProvider устарел; вместо него используйте внедрение зависимостей
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Код нужно новый. Потому что прикладные проекты часто просто копируют.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Непонятно, почему у данного файла изменена только английская версия.

ICSSoft.STORMNET.Business.LoadingCustomizationStruct lcs = ICSSoft.STORMNET.Business.LoadingCustomizationStruct.GetSimpleStruct(typeof(ТоварНаСкладе),"Tavernacle");
lcs.LimitFunction = lf;
ICSSoft.STORMNET.DataObject[] objs = ICSSoft.STORMNET.Business.DataServiceProvider.DataService.LoadObjects(lcs);
ICSSoft.STORMNET.DataObject[] objs = ICSSoft.STORMNET.Business.DataServiceProvider.DataService.LoadObjects(lcs); // DataServiceProvider is deprecated; inject IDataService instead
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно переписать без использования DataServiceProvider.DataService.

lcs.ColumnsSort = sortColumns.ToArray();

DataObject[] objs = DataServiceProvider.DataService.LoadObjects(lcs);
DataObject[] objs = DataServiceProvider.DataService.LoadObjects(lcs); // DataServiceProvider устарел; вместо него используйте внедрение зависимостей
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно переписать код на правильный вариант.

...

DataObject[] objs = DataServiceProvider.DataService.LoadObjects(lcs);
DataObject[] objs = DataServiceProvider.DataService.LoadObjects(lcs); // DataServiceProvider устарел; вместо него используйте внедрение зависимостей
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переписать код нужно

```csharp
ExternalLangDef externalLangDef = ExternalLangDef.LanguageDef;
ExternalLangDef externalLangDef = ExternalLangDef.LanguageDef; // Использование ExternalLangDef.LanguageDef является устаревшим. Вместо него используйте конструктор (new ExternalLangDef(dataService)).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Код нужно переписать.


``` csharp
var ds = (SQLDataService)DataServiceProvider.DataService;
var ds = (SQLDataService)DataServiceProvider.DataService; // DataServiceProvider is deprecated; inject IDataService instead
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

код нужно переписать.


``` csharp
var ds = (SQLDataService)DataServiceProvider.DataService;
var ds = (SQLDataService)DataServiceProvider.DataService; // DataServiceProvider устарел; вместо него используйте внедрение зависимостей
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переписать.

Дополнительно, необходимо отображать только работающих `КредитныхИнспекторов`.

1.Построить ограничения, испльзуя LINQ-провайдер:
1.Построить ограничения, испльзуя LINQ-провайдер:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно сразу опечатку поправить. "испОльзуя "


```csharp
var ds = (SQLDataService) DataServiceProvider.DataService;
var ds = (SQLDataService) DataServiceProvider.DataService; // DataServiceProvider устарел; вместо него используйте внедрение зависимостей
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переписать.

var objects = eventArgs.PrimaryKeys.Select(x => new Город { __PrimaryKey = Guid.Parse(x) })
.Cast<DataObject>().ToArray();
DataServiceProvider.DataService.LoadObjects(objects, Город.Views.ГородL, true);
DataServiceProvider.DataService.LoadObjects(objects, Город.Views.ГородL, true); // DataServiceProvider устарел; вместо него используйте внедрение зависимостей
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переписать.

// Если во время удаления произойдет ошибка, мы сможем ее обработать в блоке catch.
// Если АдресБС.cs найдет учреждения, ссылающиеся на удаляемый адрес, он кинет ConfirmAdresDeletingException.
ICSSoft.STORMNET.Business.DataServiceProvider.DataService.UpdateObject(args.DataObj);
ICSSoft.STORMNET.Business.DataServiceProvider.DataService.UpdateObject(args.DataObj); // DataServiceProvider устарел; вместо него используйте внедрение зависимостей
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переписать.

{
//Получим список учреждений ссылающихся на удаляемый адрес
var ds = (SQLDataService)DataServiceProvider.DataService;
var ds = (SQLDataService)DataServiceProvider.DataService; // DataServiceProvider устарел; вместо него используйте внедрение зависимостей
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переписать.

}).ToArray<Адрес>();
//Удаляем. (Дальнейшая обработка происходит в АдресБС)
DataServiceProvider.DataService.UpdateObjects(ref deletingAdreses);
DataServiceProvider.DataService.UpdateObjects(ref deletingAdreses); // DataServiceProvider устарел; вместо него используйте внедрение зависимостей
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переписать.

{
// Инициализация сервиса аудита
AuditSetter.InitAuditService(BridgeToDS.GetDataService());
IServiceProvider serviceProvider; // Используйте внедрение зависимостей чтобы получить IServiceProvider; вместо IServiceProvider можно использовать IUnityContainer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно написать так, чтобы было понятно, откуда IServiceProvider serviceProvider;, а то такой фрагмент кода нерабочий.

// Инициализация сервиса аудита
AuditSetter.InitAuditService(BridgeToDS.GetDataService());
IServiceProvider serviceProvider; // Используйте внедрение зависимостей чтобы получить IServiceProvider; вместо IServiceProvider можно использовать IUnityContainer
var IAuditService = serviceProvider.GetService<IAuditService>(BridgeToDS.GetDataService());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно перепроверить, а существует ли вообще класс BridgeToDS. Тут вероятно нужно тоже через Unity резолвить.


```csharp
AuditService.Current.ShowPrimaryKey = true;
AuditService.Current.ShowPrimaryKey = true; // AuditService.Current удалён в ORM версии 8.0. Используйте внедрение зависимостей для инжекта IAuditService.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переписать на корректный вариант.


```csharp
AuditService.Current.ShowPrimaryKey = false;
AuditService.Current.ShowPrimaryKey = false; // AuditService.Current удалён в ORM версии 8.0. Используйте внедрение зависимостей для инжекта IAuditService.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Аналогично.

```
##### В запросе с использованием LCS
```c#
var ldef = ExternalLangDef.LanguageDef; // Использование ExternalLangDef.LanguageDef является устаревшим. Вместо него используйте конструктор (new ExternalLangDef(dataService)).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переписать

``` csharp
dobj.DisableInitDataCopy(); // запрещаем инициализацию копии данных
ICSSoft.STORMNET.Business.DataServiceProvider.DataService.LoadObject(view, dobj, false, false); // дочитка объекта данных
// DataServiceProvider устарел; вместо него используйте внедрение зависимостей
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переписать.

dobj_forLoading.SetExistingPrimaryKey(dobj.__PrimaryKey);
// view - требуемое представление. Его состав зависит от задачи.
ICSSoft.STORMNET.Business.DataServiceProvider.DataService.LoadObject(view, dobj_forLoading);
ICSSoft.STORMNET.Business.DataServiceProvider.DataService.LoadObject(view, dobj_forLoading); // DataServiceProvider устарел; вместо него используйте внедрение зависимостей
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переписать.


```csharp
ICSSoft.STORMNET.Business.DataServiceProvider.DataService.LoadObject(dobj_forLoading);
ICSSoft.STORMNET.Business.DataServiceProvider.DataService.LoadObject(dobj_forLoading); // DataServiceProvider устарел; вместо него используйте внедрение зависимостей
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переписать.


```csharp
using ICSSoft.STORMNET.Business;
var DS = DataServiceProvider.DataService as SQLDataService; // DataServiceProvider устарел; вместо него используйте внедрение зависимостей
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переписать.

cdbo.CustomOwnAttribute = new RandomStringGenerator().Generate(200);

IDataService dataService = DataServiceProvider.DataService;
IDataService dataService = DataServiceProvider.DataService; // DataServiceProvider устарел; вместо него используйте внедрение зависимостей
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переписать.

---

# AuditSetter
> AuditSetter отсутствует в ORM v8.0. Необходимо самостоятельно регистрировать IAuditService через механизм внедрения зависимостей.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно написать, как теперь правильно.

finally
{
// Update the transaction status in the database in accordance with the results of the report
AuditService.Current.RatifyAuditOperation(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно переписать

finally
{
// Обновим статус операции в базе в соответствии с результатами построения отчета
AuditService.Current.RatifyAuditOperation(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переписать

// Записываем операцию аудита в базу и запоминаем ID созданной записи
Guid? auditOperationId = AuditService.Current.WriteCustomAuditOperation(auditParams, true);
Guid? auditOperationId = AuditService.Current.WriteCustomAuditOperation(auditParams, true); // AuditService.Current удалён в ORM версии 8.0. Используйте внедрение зависимостей для инжекта IAuditService.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переписать

finally
{
// Обновим статус операции в базе в соответствии с результатами построения отчета
AuditService.Current.RatifyAuditOperation(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переписать

// Инициализация сервиса аудита
AuditSetter.InitAuditService(DataServiceProvider.DataService);
IUnityContainer container; // контейнер необходимо получить через внедрение зависимостей; вместо IUnityContainer можно использовать IServiceProvider
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужен код получения контейнера

@coderabbitai
Copy link

coderabbitai bot commented Oct 25, 2024

Important

Review skipped

More than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review.

71 files out of 153 files are above the max files limit of 75. Please upgrade to Pro plan to get higher limits.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants