<?xml version="1.0" encoding="utf-8"?>
<Entity 
Schema="VCLib" 
Name="ReportFileFormat" 
Description="Форматы отчетов" 
version="2" 
UnrestrictedAccess="1" 
PrimaryKey="RepFmtID" 
DNAttributes="{Name}" 
DisplayName="{0}">
  <Customs>
    <Custom Name="uniqueness" Value="(Name)" />
  </Customs>
  <Fields>
    <Attribute Name="RepFmtID" Index="120001" Type="guid" Description="Идентификатор" />
    <Attribute Name="Name" Index="120002" Type="string" Description="Наименование" />
    <Attribute Name="HandlerName" Index="120003" Type="string" Description="Обработчик" />
    <Child Name="Files" Index="120004" Type="VCLib.ReportFile" Description="Шаблоны выходных документов" ChildAttribute="RepFmtID" />    
  </Fields>
  <DbMapping>
    <Table name="T_ReportFileFormat">
      <Map Name="RepFmtID" Column="RepFmtID" />
      <Map Name="Name" Column="Name" />
      <Map Name="HandlerName" Column="HandlerName" />
    </Table>
    <Lexem>
      <Map Name="Verb">
        <lx:Case xmlns:lx="lexem">
          <When>
            <lx:Criterion type="=">
              <lx:Path OwnerQueryLevel="0">
                <lx:StepString name="Name" />
              </lx:Path>
              <lx:ConstOperand type="String"><![CDATA[HTML]]></lx:ConstOperand>
            </lx:Criterion>
          </When>
          <Then>
            <lx:ConstOperand type="String"><![CDATA[edit]]></lx:ConstOperand>
          </Then>
          <Else>
            <lx:ConstOperand type="String"><![CDATA[open]]></lx:ConstOperand>
          </Else>
        </lx:Case>
      </Map>
    </Lexem>
  </DbMapping>
  <CalculatingAttributes>
    <Attribute Name="Verb" Type="string" Description="Verb используемый для шаблона" CharacterMaximumLength="40" />
  </CalculatingAttributes>
</Entity>