Click here to Skip to main content
15,886,518 members
Articles / Web Development / ASP.NET

ASP.NET/AJAX 3.5 With Aquarium Express

Rate me:
Please Sign up or sign in to vote.
3.60/5 (7 votes)
18 Sep 2008Ms-PL12 min read 35.7K   954   29  
Learn to build modern AJAX and ASP.NET 3.5 applications with free Aquarium Express Framework
<dataController name="Products" conflictDetection="overwriteChanges" label="Products" xmlns="urn:schemas-codeontime-com:data-aquarium">
  <commands>
    <command id="command1" type="Text">
      <text>
        <![CDATA[
select
	"Products"."ProductID" "ProductID"
	,"Products"."ProductName" "ProductName"
	,"Products"."SupplierID" "SupplierID"
	,"Supplier"."CompanyName" "SupplierCompanyName"
	,"Products"."CategoryID" "CategoryID"
	,"Category"."CategoryName" "CategoryCategoryName"
	,"Products"."QuantityPerUnit" "QuantityPerUnit"
	,"Products"."UnitPrice" "UnitPrice"
	,"Products"."UnitsInStock" "UnitsInStock"
	,"Products"."UnitsOnOrder" "UnitsOnOrder"
	,"Products"."ReorderLevel" "ReorderLevel"
	,"Products"."Discontinued" "Discontinued"
from "dbo"."Products" "Products"
	left join "dbo"."Suppliers" "Supplier" on "Products"."SupplierID" = "Supplier"."SupplierID"
	left join "dbo"."Categories" "Category" on "Products"."CategoryID" = "Category"."CategoryID"
]]>
      </text>
    </command>
    <command id="command2" type="Text">
      <text>
        <![CDATA[
select
	"Products"."ProductID" "ProductID"
	,"Products"."ProductName" "ProductName"
	,"Products"."SupplierID" "SupplierID"
	,"Supplier"."CompanyName" "SupplierCompanyName"
	,"Products"."CategoryID" "CategoryID"
	,"Category"."CategoryName" "CategoryCategoryName"
	,"Products"."QuantityPerUnit" "QuantityPerUnit"
	,"Products"."UnitPrice" "UnitPrice"
	,"Products"."UnitsInStock" "UnitsInStock"
	,"Products"."UnitsOnOrder" "UnitsOnOrder"
	,"Products"."ReorderLevel" "ReorderLevel"
	,"Products"."Discontinued" "Discontinued"
from "dbo"."Products" "Products"
	left join "dbo"."Suppliers" "Supplier" on "Products"."SupplierID" = "Supplier"."SupplierID"
	left join "dbo"."Categories" "Category" on "Products"."CategoryID" = "Category"."CategoryID"
where
  "Products"."Discontinued" = 0
]]>
      </text>
    </command>
    <command id="command3" type="Text">
      <text>
        <![CDATA[
select
	"Products"."ProductID" "ProductID"
	,"Products"."ProductName" "ProductName"
	,"Products"."SupplierID" "SupplierID"
	,"Supplier"."CompanyName" "SupplierCompanyName"
	,"Products"."CategoryID" "CategoryID"
	,"Category"."CategoryName" "CategoryCategoryName"
	,"Products"."QuantityPerUnit" "QuantityPerUnit"
	,"Products"."UnitPrice" "UnitPrice"
	,"Products"."UnitsInStock" "UnitsInStock"
	,"Products"."UnitsOnOrder" "UnitsOnOrder"
	,"Products"."ReorderLevel" "ReorderLevel"
	,"Products"."Discontinued" "Discontinued"
from "dbo"."Products" "Products"
	left join "dbo"."Suppliers" "Supplier" on "Products"."SupplierID" = "Supplier"."SupplierID"
	left join "dbo"."Categories" "Category" on "Products"."CategoryID" = "Category"."CategoryID"
where
  "Products"."Discontinued" = 0 and
  "Products"."UnitsInStock" <= "Products"."ReorderLevel"
]]>
      </text>
    </command>
    <command id="ProductIDIdentityCommand" type="Text" event="Inserted">
      <text>select @@identity</text>
      <output>
        <fieldOutput fieldName="ProductID" />
      </output>
    </command>
  </commands>
  <fields>
    <field name="ProductID" type="Int32" allowNulls="false" isPrimaryKey="true" label="Product#" readOnly="true" />
    <field name="ProductName" type="String" allowNulls="false" label="Product Name" />
    <field name="SupplierID" type="Int32" label="Supplier#">
      <items style="Lookup" dataController="Suppliers" newDataView="createForm1" />
    </field>
    <field name="SupplierCompanyName" type="String" readOnly="true" label="Supplier Company Name" />
    <field name="CategoryID" type="Int32" label="Category#">
      <items style="Lookup" dataController="Categories" newDataView="createForm1" />
    </field>
    <field name="CategoryCategoryName" type="String" readOnly="true" label="Category Name" />
    <field name="QuantityPerUnit" type="String" label="Quantity Per Unit" />
    <field name="UnitPrice" type="Decimal" default="(0)" label="Unit Price" />
    <field name="UnitsInStock" type="Int16" default="(0)" label="Units In Stock" />
    <field name="UnitsOnOrder" type="Int16" default="(0)" label="Units On Order" />
    <field name="ReorderLevel" type="Int16" default="(0)" label="Reorder Level" />
    <field name="Discontinued" type="Boolean" allowNulls="false" default="(0)" label="Discontinued" />
  </fields>
  <views>
    <view id="grid2" type="Grid" commandId="command2" label="Current Products">
      <headerText>This is a list of current products. </headerText>
      <dataFields>
        <dataField fieldName="ProductName" columns="40" />
        <dataField fieldName="SupplierID" aliasFieldName="SupplierCompanyName" />
        <dataField fieldName="CategoryID" aliasFieldName="CategoryCategoryName" />
        <dataField fieldName="QuantityPerUnit" columns="20" />
        <dataField fieldName="UnitPrice" dataFormatString="c" columns="15" />
        <dataField fieldName="UnitsInStock" columns="15" />
        <dataField fieldName="UnitsOnOrder" columns="15" />
        <dataField fieldName="ReorderLevel" columns="15" />
      </dataFields>
    </view>
    <view id="grid3" type="Grid" commandId="command3" label="Products To Order">
      <headerText>This is a list of products with low stock. </headerText>
      <dataFields>
        <dataField fieldName="ProductName" columns="40" />
        <dataField fieldName="SupplierID" aliasFieldName="SupplierCompanyName" />
        <dataField fieldName="CategoryID" aliasFieldName="CategoryCategoryName" />
        <dataField fieldName="QuantityPerUnit" columns="20" />
        <dataField fieldName="UnitPrice" dataFormatString="c" columns="15" />
        <dataField fieldName="UnitsInStock" columns="15" />
        <dataField fieldName="UnitsOnOrder" columns="15" />
        <dataField fieldName="ReorderLevel" columns="15" />
      </dataFields>
    </view>
    <view id="grid1" type="Grid" commandId="command1" label="All Products">
      <headerText>This is a list of all products. </headerText>
      <dataFields>
        <dataField fieldName="ProductName" columns="40" />
        <dataField fieldName="SupplierID" aliasFieldName="SupplierCompanyName" />
        <dataField fieldName="CategoryID" aliasFieldName="CategoryCategoryName" />
        <dataField fieldName="QuantityPerUnit" columns="20" />
        <dataField fieldName="UnitPrice" dataFormatString="c" columns="15" />
        <dataField fieldName="UnitsInStock" columns="15" />
        <dataField fieldName="UnitsOnOrder" columns="15" />
        <dataField fieldName="ReorderLevel" columns="15" />
        <dataField fieldName="Discontinued" />
      </dataFields>
    </view>
    <view id="editForm1" type="Form" commandId="command1" label="Review Products">
      <headerText>Please review products information below. Click Edit to change this record, click Delete to delete the record, or click Cancel/Close to return back.</headerText>
      <categories>
        <category headerText="Products">
          <description>These are the fields of the products record that can be edited.</description>
          <dataFields>
            <dataField fieldName="ProductName" columns="40" />
            <dataField fieldName="SupplierID" aliasFieldName="SupplierCompanyName" />
            <dataField fieldName="CategoryID" aliasFieldName="CategoryCategoryName" />
            <dataField fieldName="QuantityPerUnit" columns="20" />
            <dataField fieldName="UnitPrice" dataFormatString="c" columns="15" />
            <dataField fieldName="UnitsInStock" columns="15" />
            <dataField fieldName="UnitsOnOrder" columns="15" />
            <dataField fieldName="ReorderLevel" columns="15" />
            <dataField fieldName="Discontinued" />
          </dataFields>
        </category>
      </categories>
    </view>
    <view id="createForm1" type="Form" commandId="command1" label="New Products">
      <headerText>Please fill this form and click OK button to create a new products record. Click Cancel to return to the previous screen.</headerText>
      <categories>
        <category headerText="New Products">
          <description>Complete the form. Make sure to enter all required fields.</description>
          <dataFields>
            <dataField fieldName="ProductName" columns="40" />
            <dataField fieldName="SupplierID" aliasFieldName="SupplierCompanyName" />
            <dataField fieldName="CategoryID" aliasFieldName="CategoryCategoryName" />
            <dataField fieldName="QuantityPerUnit" columns="20" />
            <dataField fieldName="UnitPrice" dataFormatString="c" columns="15" />
            <dataField fieldName="UnitsInStock" columns="15" />
            <dataField fieldName="UnitsOnOrder" columns="15" />
            <dataField fieldName="ReorderLevel" columns="15" />
            <dataField fieldName="Discontinued" />
          </dataFields>
        </category>
      </categories>
    </view>
  </views>
  <actions>
    <actionGroup scope="Grid">
      <action commandName="Select" commandArgument="editForm1" />
      <action commandName="Edit" />
      <action commandName="Delete" confirmation="Delete?" />
      <action whenLastCommandName="Edit" commandName="Update" headerText="Save" />
      <action whenLastCommandName="Edit" commandName="Cancel" />
    </actionGroup>
    <actionGroup scope="Form">
      <action commandName="Edit" />
      <action commandName="Delete" confirmation="Delete?" />
      <action commandName="Cancel" headerText="Close" />
      <action whenLastCommandName="Edit" commandName="Update" headerText="OK" />
      <action whenLastCommandName="Edit" commandName="Delete" confirmation="Delete?" />
      <action whenLastCommandName="Edit" commandName="Cancel" />
      <action whenLastCommandName="New" commandName="Insert" headerText="OK" />
      <action whenLastCommandName="New" commandName="Cancel" />
    </actionGroup>
    <actionGroup scope="ActionBar" headerText="New">
      <action commandName="New" commandArgument="createForm1" headerText="New Products" description="Create a new Products record." />
    </actionGroup>
    <actionGroup scope="ActionBar" headerText="Actions">
      <action commandName="Custom" commandArgument="ExportCsv" headerText="Export to Spreadsheet" description="Analyze items with spreadsheet&lt;br/&gt; application." cssClass="ExportCsv" />
      <action commandName="Custom" commandArgument="ExportRss" headerText="View RSS Feed" description="Syndicate items with an RSS reader." cssClass="ExportRss" />
      <action />
      <action commandName="Custom" commandArgument="MyCommand" headerText="My Command" description="Execute my custom command" />
    </actionGroup>
    <actionGroup scope="ActionBar" headerText="Record">
      <action whenLastCommandName="Edit" commandName="Update" headerText="Save" description="Save changes to the database." />
      <action whenLastCommandName="Edit" commandName="Cancel" description="Cancel all record changes." />
    </actionGroup>
  </actions>
</dataController>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
This is a Organisation

1 members

Comments and Discussions