<?xml version="1.0" encoding="utf-8"?>
<Entity 
Schema="VCLib" 
Name="DTO_MODEL_COLUMN" 
Description="Отображаемое поле модели" 
PrimaryKey="DtoModelColumnID">
  <Customs>
    <Custom Name="uniqueness" Value="(DtoModelView;ColPath)" />
  </Customs>
  <Fields>
    <Attribute Name="DtoModelColumnID" Type="guid" Description="Идентификатор" />
    <Parent Name="DtoModelView" Type="VCLib.DTO_MODEL_VIEW" Description="Отображение модели DTO" Required="1" />
    <Attribute Name="ColPath" Type="string" Description="Путь" CharacterMaximumLength="500" Required="1" />
    <Attribute Name="EditPath" Type="string" Description="Путь редактирования" CharacterMaximumLength="500" />
    <Attribute Name="ColDescr" Type="string" Description="Описание" CharacterMaximumLength="1000" />
    <Attribute Name="ColOrder" Type="int" Description="Порядковый номер" Required="1" />
    <Attribute Name="IsVisible" Type="bool" Description="Отображать поле" Required="1" />
    <Attribute Name="SortOrder" Type="int" Description="Порядок сортировки" />
    <Choice Name="SortDirection" Description="Направление сортировки">
      <Item Name="Asc" Index="0" />
      <Item Name="Desc" Index="1" />
    </Choice>
    <Choice Name="FormatType" Description="Форматирование" Required="1">
      <Item Name="По умолчанию" Index="0" />
      <Item Name="Денежное" Index="1" />
      <Item Name="Дата" Index="2" />
      <Item Name="Время" Index="3" />
      <Item Name="Дата и время" Index="4" />
      <Item Name="HTML" Index="5" />
    </Choice>
    <Choice Name="Aggregation" Description="Агрегатная функция">
      <Item Name="Минимум" Index="1" />
      <Item Name="Максимум" Index="2" />
      <Item Name="Сумма" Index="3" />
    </Choice>
  </Fields>
  <DbMapping>
    <Table name="T_DTO_MODEL_COLUMN">
      <Map Name="DtoModelColumnID" Column="DtoModelColumnID" />
      <Map Name="DtoModelView" Column="DtoModelView" />
      <Map Name="ColPath" Column="ColPath" />
      <Map Name="EditPath" Column="EditPath" />
      <Map Name="ColDescr" Column="ColDescr" />
      <Map Name="ColOrder" Column="ColOrder" />
      <Map Name="IsVisible" Column="IsVisible" />
      <Map Name="SortOrder" Column="SortOrder" />
      <Map Name="SortDirection" Column="SortDirection" />
      <Map Name="FormatType" Column="FormatType" />
      <Map Name="Aggregation" Column="Aggregation" />
    </Table>
  </DbMapping>
  <CalculatingAttributes>
    <Attribute Name="IsSorted" Type="bool" Description="Сортировка" Required="1" Cashed="1" RequiredAttributes="{SortOrder}" />
    <Attribute Name="IsEditable" Type="bool" Description="Редактируемое" Required="1" Cashed="1" RequiredAttributes="{EditPath}" />
  </CalculatingAttributes>
</Entity>