-
Notifications
You must be signed in to change notification settings - Fork 69
Обновление документации по изменениям ORM 6.0.0 - 7.* #169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
6d5c18d
a9add6e
2216c98
2389826
557221c
5b77af9
161cc20
012916b
760283f
eaf76d5
ea23235
20f1742
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Непонятно, почему у данного файла изменена только английская версия. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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++) | ||
| { | ||
|
|
@@ -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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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++) | ||
|
|
@@ -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)) | ||
|
|
@@ -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Заказ) | ||
| } | ||
| ``` | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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**. | ||
|
|
||
|  | ||
|
|
||
| После этого следует **обновить проект с объектами данных на бэкенде** (выполнить перегенерацию соответствующего проекта). Теперь мы легко получим доступ из объекта конкретной позиции товара на складе к характеристике самого склада, в частности к его номеру. Условимся, что товары будут списываться всегда со складов в порядке увеличения порядкового номера склада. | ||
| После этого следует **обновить проект с объектами данных на бэкенде** (выполнить перегенерацию соответствующего проекта). Теперь мы легко получим доступ из объекта конкретной позиции товара на складе к характеристике самого склада, в частности к его номеру. Условимся, что товары будут списываться всегда со складов в порядке увеличения порядкового номера склада. | ||
|
|
||
| Реализуем теперь основную логику. Прежде всего, нужно **вычитать список всех требуемых товарных позиций со всех складов**: | ||
|
|
||
|
|
@@ -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 устарел; вместо него используйте внедрение зависимостей | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Нужно переписать код на правильный вариант. |
||
|
|
||
| return ret; // БРЕЙКПОИНТ | ||
| } | ||
|
|
@@ -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 устарел; вместо него используйте внедрение зависимостей | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Переписать код нужно |
||
|
|
||
| // Разместим вычитанные объекты в отсортированном списке для удобного доступа в дальнейшем. | ||
| SortedList sl = new SortedList(); | ||
|
|
@@ -295,7 +295,7 @@ private static DataObject[] changeOrderStatusPaid(IIS.Shop.Order UpdatedObject) | |
| } | ||
| } | ||
|
|
||
| // Определим строчку для сообщения об ошибке. | ||
| // Определим строчку для сообщения об ошибке. | ||
| string errStr = string.Empty; | ||
| ArrayList retObjs = new ArrayList(); | ||
|
|
||
|
|
@@ -390,7 +390,7 @@ private static DataObject[] changeOrderStatusPaid(IIS.Shop.Order UpdatedObject) | |
|
|
||
| ## Самостоятельная работа | ||
| Вы можете выполнить следующие доработки в приложении самостоятельно для более полной реализации функционала приложения: | ||
| 1. при изменении статуса Заказа на "Оплаченный" создавать на стороне сервера Накладную, к которой был бы уже прикреплен заказ, установлены статус "Новый" и выставлена текущая дата создания. | ||
| 1. при изменении статуса Заказа на "Оплаченный" создавать на стороне сервера Накладную, к которой был бы уже прикреплен заказ, установлены статус "Новый" и выставлена текущая дата создания. | ||
|
|
||
| ## Перейти | ||
|
|
||
|
|
||
| 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. | ||
|
|
||
|  | ||
|  | ||
|
|
||
| ## 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> | ||
| ``` | ||
| ``` | ||
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Код нужно новый. Потому что прикладные проекты часто просто копируют.