Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,528 changes: 762 additions & 766 deletions _data/sidebars/flexberry-orm_sidebar.yml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ protected override void PreApplyToControls()
{
var заказ = ctrlЗаказ.SelectedMasterPK;
ctrlЗаказ.MasterViewName = Заказ.Views.ЗаказL.Name;

var lcs = LoadingCustomizationStruct.GetSimpleStruct(typeof(СтрокаЗаказа), СтрокаЗаказа.Views.СтрокаЗаказаE);
lcs.LimitFunction = FunctionBuilder.BuildEquals<СтрокаЗаказа>(x => x.Заказ, заказ);
var строкиЗаказа = DataServiceProvider.DataService.LoadObjects(lcs);
var строкиЗаказа = DataServiceProvider.DataService.LoadObjects(lcs); // DataServiceProvider is deprecated; inject IDataService instead

foreach (var s in строкиЗаказа)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ protected override void PreApplyToControls()
{
var заказ = ctrlЗаказ.SelectedMasterPK;
ctrlЗаказ.MasterViewName = Заказ.Views.ЗаказL.Name;

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.

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


foreach (var s in строкиЗаказа)
{
Expand All @@ -47,7 +47,7 @@ protected override void PreApplyToControls()
}
```

В данном методе выполняется проверка, произошел ли `PostBack`, после чего с помощью сервиса данных подгружаются детейлы для класса `Заказ` (в подгружаемом представлении есть детейлы), так как по умолчанию они не загружаются.
В данном методе выполняется проверка, произошел ли `PostBack`, после чего с помощью сервиса данных подгружаются детейлы для класса `Заказ` (в подгружаемом представлении есть детейлы), так как по умолчанию они не загружаются.
После загрузки в цикле формируются и заполняются детейлы.
Не забываем изменить значение параметра `flexberryautogenerated` на `false`, чтобы форма не потерять изменения при перегенерации.

Expand All @@ -67,4 +67,4 @@ protected override void PreApplyToControls()
## Перейти

* <i class="fa fa-arrow-left" aria-hidden="true"></i> [Обработка исключений](gpg_set-exception.html)
* [Работа с бизнес-сервером](gpg_business-server.html) <i class="fa fa-arrow-right" aria-hidden="true"></i>
* [Работа с бизнес-сервером](gpg_business-server.html) <i class="fa fa-arrow-right" aria-hidden="true"></i>
Copy link
Contributor

Choose a reason for hiding this comment

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

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

Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,32 @@ Such as, in order to check the availability of goods in stock at the time the or
5.Then register in parentheses programmer the following lines (to select the options use a combination of `Ctrl` Space):

```csharp
// *** Start programmer edit section *** (Using statements)
// *** Start programmer edit section *** (Using statements)
using System.Collections;

using ICSSoft.STORMNET;
using ICSSoft.STORMNET.FunctionalLanguage;
using ICSSoft.STORMNET.FunctionalLanguage.SQLWhere;

// *** End programmer edit section *** (Using statements)
// *** End programmer edit section *** (Using statements)
```

6.Later in the code business servers to handle all of the following:

```csharp
public virtual ICSSoft.STORMNET.DataObject[] OnUpdateЗаказ(АСУ_Склад.Заказ UpdatedObject)
{
// *** Start programmer edit section *** (OnUpdateЗаказ)
// *** Start programmer edit section *** (OnUpdateЗаказ)

// Define the array that will return for updates.
// Define the array that will return for updates.
DataObject[] ret = new DataObject[0];

// Check that the received object is exactly what we need (created or modified and the status is set to Paid).
if ((UpdatedObject.GetStatus() == ICSSoft.STORMNET.ObjectStatus.Created || UpdatedObject.GetStatus() == ICSSoft.STORMNET.ObjectStatus.Altered) && Array.IndexOf(UpdatedObject.GetAlteredPropertyNames(), Status) >= 0 && UpdatedObject.Статус == СостояниеЗаказа.Оплаченный)
{
// Build the restriction and subtract all the objects in Tavarnelle that suit us.
Заказ заказ = UpdatedObject;
ICSSoft.STORMNET.FunctionalLanguage.Function lf = null;
// Check that the received object is exactly what we need (created or modified and the status is set to Paid).
if ((UpdatedObject.GetStatus() == ICSSoft.STORMNET.ObjectStatus.Created || UpdatedObject.GetStatus() == ICSSoft.STORMNET.ObjectStatus.Altered) && Array.IndexOf(UpdatedObject.GetAlteredPropertyNames(), Status) >= 0 && UpdatedObject.Статус == СостояниеЗаказа.Оплаченный)
{
// Build the restriction and subtract all the objects in Tavarnelle that suit us.
Заказ заказ = UpdatedObject;
ICSSoft.STORMNET.FunctionalLanguage.Function lf = null;

for (int i = 0; i < заказ.СтрокаЗаказа.Count; i++)
{
Expand All @@ -78,9 +78,9 @@ public virtual ICSSoft.STORMNET.DataObject[] OnUpdateЗаказ(АСУ_Скла

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.


// Place the read objects in a sorted list for easy access later on.
// Place the read objects in a sorted list for easy access later on.
System.Collections.SortedList sl = new System.Collections.SortedList();

for (int i = 0; i < objs.Length; i++)
Expand All @@ -97,11 +97,11 @@ public virtual ICSSoft.STORMNET.DataObject[] OnUpdateЗаказ(АСУ_Скла
}
}

// Define the string for the error message.
// Define the string for the error message.
string errStr = string.Empty;
ArrayList retObjs = new ArrayList();

// Check the availability of goods in warehouses, if not enough, then give error message if missing, then subtract the number.
// Check the availability of goods in warehouses, if not enough, then give error message if missing, then subtract the number.
for (int i = 0; i < заказ.СтрокаЗаказа.Count; i++)
{
if (sl.ContainsKey(заказ.СтрокаЗаказа[i].Товар.__PrimaryKey))
Expand Down Expand Up @@ -149,18 +149,18 @@ public virtual ICSSoft.STORMNET.DataObject[] OnUpdateЗаказ(АСУ_Скла
}
}

// In case something is not enough, we inform the user.
// In case something is not enough, we inform the user.
if (errStr != string.Empty)
{
throw new Exception(errStr);
}

// If everything is fine, then return an array of objects that need to be updated.
// If everything is fine, then return an array of objects that need to be updated.
ret = new DataObject[retObjs.Count]; retObjs.CopyTo(ret, 0);
}
return ret;

// *** End programmer edit section *** (OnUpdateЗаказ)
// *** End programmer edit section *** (OnUpdateЗаказ)
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,15 @@ public virtual DataObject[] OnUpdateOrder(IIS.Shop.Order UpdatedObject)

## Реализация основной части логики

Теперь, когда для логики перевода Заказа в статус "Оплаченный" создан отдельный метод, можно реализовывать основной функционал. Аналогичная логика реализована в разделе "[Работа с бизнес-сервером](gpg_business-server.html)" (Практическое руководство по веб-разработке на Flexberry ASP.NET).
Теперь, когда для логики перевода Заказа в статус "Оплаченный" создан отдельный метод, можно реализовывать основной функционал. Аналогичная логика реализована в разделе "[Работа с бизнес-сервером](gpg_business-server.html)" (Практическое руководство по веб-разработке на Flexberry ASP.NET).

{% include important.html content="Всю дальнейшую логику мы будем проверять на примере Заказа 2." %}

В числе вносимых в код **изменений** (по сравнению с кодом, который представлен по ссылке выше) мы добавим возможность сортировки вычитываемых товарных позиций со складов по номеру склада. Для этого нужно обновить класс StoreProduct во **Flexberry Designer**: необходимо добавить невидимый атрибут **Storehouse.Number** в представление **StoreProductE**.
В числе вносимых в код **изменений** (по сравнению с кодом, который представлен по ссылке выше) мы добавим возможность сортировки вычитываемых товарных позиций со складов по номеру склада. Для этого нужно обновить класс StoreProduct во **Flexberry Designer**: необходимо добавить невидимый атрибут **Storehouse.Number** в представление **StoreProductE**.

![Добавление свойства Storehouse.Number в представление StoreProductE](/images/pages/guides/flexberry-ember/7-2-server-logic-implementation/7-2-7.png)

После этого следует **обновить проект с объектами данных на бэкенде** (выполнить перегенерацию соответствующего проекта). Теперь мы легко получим доступ из объекта конкретной позиции товара на складе к характеристике самого склада, в частности к его номеру. Условимся, что товары будут списываться всегда со складов в порядке увеличения порядкового номера склада.
После этого следует **обновить проект с объектами данных на бэкенде** (выполнить перегенерацию соответствующего проекта). Теперь мы легко получим доступ из объекта конкретной позиции товара на складе к характеристике самого склада, в частности к его номеру. Условимся, что товары будут списываться всегда со складов в порядке увеличения порядкового номера склада.

Реализуем теперь основную логику. Прежде всего, нужно **вычитать список всех требуемых товарных позиций со всех складов**:

Expand Down Expand Up @@ -189,7 +189,7 @@ private static DataObject[] changeOrderStatusPaid(IIS.Shop.Order UpdatedObject)
sortColumns.Add(new ColumnsSortDef("Storehouse.Number", SortOrder.Asc));
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.

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


return ret; // БРЕЙКПОИНТ
}
Expand All @@ -210,7 +210,7 @@ private static DataObject[] changeOrderStatusPaid(IIS.Shop.Order UpdatedObject)
{
...

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.

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


// Разместим вычитанные объекты в отсортированном списке для удобного доступа в дальнейшем.
SortedList sl = new SortedList();
Expand Down Expand Up @@ -295,7 +295,7 @@ private static DataObject[] changeOrderStatusPaid(IIS.Shop.Order UpdatedObject)
}
}

// Определим строчку для сообщения об ошибке.
// Определим строчку для сообщения об ошибке.
string errStr = string.Empty;
ArrayList retObjs = new ArrayList();

Expand Down Expand Up @@ -390,7 +390,7 @@ private static DataObject[] changeOrderStatusPaid(IIS.Shop.Order UpdatedObject)

## Самостоятельная работа
Вы можете выполнить следующие доработки в приложении самостоятельно для более полной реализации функционала приложения:
1. при изменении статуса Заказа на "Оплаченный" создавать на стороне сервера Накладную, к которой был бы уже прикреплен заказ, установлены статус "Новый" и выставлена текущая дата создания.
1. при изменении статуса Заказа на "Оплаченный" создавать на стороне сервера Накладную, к которой был бы уже прикреплен заказ, установлены статус "Новый" и выставлена текущая дата создания.

## Перейти

Expand Down
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
---
title: Detaylari in the advanced editor limitations
sidebar: flexberry-aspnet_sidebar
keywords: Flexberry ASP-NET
toc: true
permalink: en/fa_details-limit-editor.html
lang: en
autotranslated: true
hash: 77276ff64e83be9dd9c455c5831ca8c1b04f80dbc2032d9dc01002f85401b041
---
---
title: Detaylari in the advanced editor limitations
sidebar: flexberry-aspnet_sidebar
keywords: Flexberry ASP-NET
toc: true
permalink: en/fa_details-limit-editor.html
lang: en
autotranslated: true
hash: 77276ff64e83be9dd9c455c5831ca8c1b04f80dbc2032d9dc01002f85401b041
---

## Work with detaylari in the advanced editor, limitations in the web
## Work with detaylari in the advanced editor, limitations in the web

You should pay attention (especially associated with the [conversion functions restrictions in linq-expression](fo_lcs-to-linq.html)):
You should pay attention (especially associated with the [conversion functions restrictions in linq-expression](fo_lcs-to-linq.html)):

* When you set the constraint of universality on detaily (in lcs is [ExistExact](fo_exist-details.html)) in the view of detail should be included a reference to the aggregator.
* When setting limits on detaily using the advanced editor restrictions to the view of the aggregator may want to include a link to detali.
* When you set the constraint of universality on detaily (in lcs is [ExistExact](fo_exist-details.html)) in the view of detail should be included a reference to the aggregator.
* When setting limits on detaily using the advanced editor restrictions to the view of the aggregator may want to include a link to detali.

## Work with pseudocatalase in the advanced editor, limitations in the web
## Work with pseudocatalase in the advanced editor, limitations in the web

For pseudocatalase in the expanded constraint editor](fa_advanced-limit-editor.html) you must do the following:
* When [specify display order of the properties in the advanced editor, limitations](fa_prop-order-limit-editor.html) add interest pseudometal (problem of specifying limits on pseudometal described [here](fo_linq-provider.html))
* In the constraint editor, you can open stored in the lcs limits, or designing a new one.
For pseudocatalase in the expanded constraint editor](fa_advanced-limit-editor.html) you must do the following:
* When [specify display order of the properties in the advanced editor, limitations](fa_prop-order-limit-editor.html) add interest pseudometal (problem of specifying limits on pseudometal described [here](fo_linq-provider.html))
* In the constraint editor, you can open stored in the lcs limits, or designing a new one.

![](/images/pages/products/flexberry-aspnet/ogranicheniye/le-pseudo-detail.png)
![](/images/pages/products/flexberry-aspnet/ogranicheniye/le-pseudo-detail.png)

## Dynamic view of datalow
## Dynamic view of datalow

For the work of datalow in the expanded constraint editor in the web](fa_advanced-limit-editor.html) in the application of restrictions on [WOLV](fa_web-object-list-view.html), you may need:
* [Ask detaily to view](fa_prop-order-limit-editor.html) if they are not already there.
* Ask [property AutoAddUsedInLimitationProperties](fa_prop-order-limit-editor.html) that the view formed dynamically.
* To determine the mechanism of formation of dynamic representations for detailov through the interface ICSSoft.STORMNET.Windows.Forms.IViewGenerator (located in the Assembly ExternalLangDef). For example, in the version after 14.01.2015 in config add the following line:
For the work of datalow in the expanded constraint editor in the web](fa_advanced-limit-editor.html) in the application of restrictions on [WOLV](fa_web-object-list-view.html), you may need:
* [Ask detaily to view](fa_prop-order-limit-editor.html) if they are not already there.
* Ask [property AutoAddUsedInLimitationProperties](fa_prop-order-limit-editor.html) that the view formed dynamically.
* To determine the mechanism of formation of dynamic representations for detailov through the interface ICSSoft.STORMNET.Windows.Forms.IViewGenerator (located in the Assembly ICSSoft.STORMNET.Business.ExternalLangDef). For example, in the version after 14.01.2015 in config add the following line:

```xml
<unity xmlns="http://schemas.microsoft.com/practices/2010/unity">
...
...
<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" />
</container>
</unity>
```
```



Loading