Click here to Skip to main content
15,885,914 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="Orders" conflictDetection="overwriteChanges" label="Orders" xmlns="urn:schemas-codeontime-com:data-aquarium">
  <commands>
    <command id="command1" type="Text">
      <text>
        <![CDATA[
select
	"Orders"."OrderID" "OrderID"
	,"Orders"."CustomerID" "CustomerID"
	,"Customer"."CompanyName" "CustomerCompanyName"
	,"Orders"."EmployeeID" "EmployeeID"
	,"Employee"."LastName" "EmployeeLastName"
	,"Orders"."OrderDate" "OrderDate"
	,"Orders"."RequiredDate" "RequiredDate"
	,"Orders"."ShippedDate" "ShippedDate"
	,"Orders"."ShipVia" "ShipVia"
	,"ShipVia"."CompanyName" "ShipViaCompanyName"
	,"Orders"."Freight" "Freight"
	,"Orders"."ShipName" "ShipName"
	,"Orders"."ShipAddress" "ShipAddress"
	,"Orders"."ShipCity" "ShipCity"
	,"Orders"."ShipRegion" "ShipRegion"
	,"Orders"."ShipPostalCode" "ShipPostalCode"
	,"Orders"."ShipCountry" "ShipCountry"
	,(cast("OrderTotals"."ItemsTotal" as money)) "ItemsTotal"
	,(cast("OrderTotals"."ItemsTotal" + "Orders"."Freight" as money)) "OrderTotal"
from "dbo"."Orders" "Orders"
	left join "dbo"."Customers" "Customer" on "Orders"."CustomerID" = "Customer"."CustomerID"
	left join "dbo"."Employees" "Employee" on "Orders"."EmployeeID" = "Employee"."EmployeeID"
	left join "dbo"."Shippers" "ShipVia" on "Orders"."ShipVia" = "ShipVia"."ShipperID"
	left join "OrderTotals" on "Orders"."OrderID" = "OrderTotals"."OrderID"
]]>
      </text>
    </command>
    <command id="OrderIDIdentityCommand" type="Text" event="Inserted">
      <text>select @@identity</text>
      <output>
        <fieldOutput fieldName="OrderID" />
      </output>
    </command>
  </commands>
  <fields>
    <field name="OrderID" type="Int32" allowNulls="false" isPrimaryKey="true" label="Order#" readOnly="true" />
    <field name="CustomerID" type="String" label="Customer#">
      <items style="Lookup" dataController="Customers" newDataView="createForm1" />
    </field>
    <field name="CustomerCompanyName" type="String" readOnly="true" label="Customer" />
    <field name="EmployeeID" type="Int32" label="Employee#">
      <items style="Lookup" dataController="Employees" newDataView="createForm1" />
    </field>
    <field name="EmployeeLastName" type="String" readOnly="true" label="Employee" />
    <field name="OrderDate" type="DateTime" label="Order Date" />
    <field name="RequiredDate" type="DateTime" label="Required Date" />
    <field name="ShippedDate" type="DateTime" label="Shipped Date" />
    <field name="ShipVia" type="Int32" label="Ship Via">
      <items style="DropDownList" dataController="Shippers" newDataView="createForm1" />
    </field>
    <field name="ShipViaCompanyName" type="String" readOnly="true" label="Ship Via" />
    <field name="Freight" type="Decimal" default="(0)" label="Freight" />
    <field name="ShipName" type="String" label="Ship Name" />
    <field name="ShipAddress" type="String" label="Ship Address" />
    <field name="ShipCity" type="String" label="Ship City" />
    <field name="ShipRegion" type="String" label="Ship Region" />
    <field name="ShipPostalCode" type="String" label="Ship Postal Code" />
    <field name="ShipCountry" type="String" label="Ship Country" />
    <field name="ItemsTotal" type="Decimal" readOnly="true" label="Items Total" dataFormatString="c"/>
    <field name="OrderTotal" type="Decimal" readOnly="true" label="Total" dataFormatString="c"/>
  </fields>
  <views>
    <view id="editForm1" type="Form" commandId="command1" label="Order">
      <headerText>Please review orders 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="Orders">
          <description>These are the fields of the orders record that can be edited.</description>
          <dataFields>
            <dataField fieldName="CustomerID" aliasFieldName="CustomerCompanyName" />
            <dataField fieldName="EmployeeID" aliasFieldName="EmployeeLastName" />
            <dataField fieldName="OrderDate" columns="10" />
            <dataField fieldName="RequiredDate" columns="10" />
            <dataField fieldName="ShippedDate" columns="10" />
            <dataField fieldName="ShipVia" aliasFieldName="ShipViaCompanyName" />
            <dataField fieldName="Freight" dataFormatString="c" columns="15" />
            <dataField fieldName="ShipName" columns="40" />
            <dataField fieldName="ShipAddress" />
            <dataField fieldName="ShipCity" columns="15" />
            <dataField fieldName="ShipRegion" columns="15" />
            <dataField fieldName="ShipPostalCode" columns="10" />
            <dataField fieldName="ShipCountry" columns="15" />
            <dataField fieldName="ItemsTotal"/>
            <dataField fieldName="OrderTotal"/>
          </dataFields>
        </category>
      </categories>
    </view>
    <view id="grid1" type="Grid" commandId="command1" label="Orders">
      <headerText><![CDATA[This is a list of orders. <span style="color:green;font-weight:bold">Click on the order number to view order details.</span>]]></headerText>
      <dataFields>
        <dataField fieldName="OrderID" />
        <dataField fieldName="CustomerID" aliasFieldName="CustomerCompanyName" />
        <dataField fieldName="EmployeeID" aliasFieldName="EmployeeLastName" />
        <dataField fieldName="OrderDate" columns="10" />
        <dataField fieldName="RequiredDate" columns="10" />
        <dataField fieldName="ShippedDate" columns="10" />
        <dataField fieldName="ShipVia" aliasFieldName="ShipViaCompanyName" />
        <dataField fieldName="Freight" dataFormatString="c" columns="15" />
        <dataField fieldName="ItemsTotal"/>
        <dataField fieldName="OrderTotal"/>
      </dataFields>
    </view>
    <view id="createForm1" type="Form" commandId="command1" label="New Orders">
      <headerText>Please fill this form and click OK button to create a new orders record. Click Cancel to return to the previous screen.</headerText>
      <categories>
        <category headerText="New Orders">
          <description>Complete the form. Make sure to enter all required fields.</description>
          <dataFields>
            <dataField fieldName="CustomerID" aliasFieldName="CustomerCompanyName" />
            <dataField fieldName="EmployeeID" aliasFieldName="EmployeeLastName" />
            <dataField fieldName="OrderDate" columns="10" />
            <dataField fieldName="RequiredDate" columns="10" />
            <dataField fieldName="ShippedDate" columns="10" />
            <dataField fieldName="ShipVia" aliasFieldName="ShipViaCompanyName" />
            <dataField fieldName="Freight" dataFormatString="c" columns="15" />
            <dataField fieldName="ShipName" columns="40" />
            <dataField fieldName="ShipAddress" />
            <dataField fieldName="ShipCity" columns="15" />
            <dataField fieldName="ShipRegion" columns="15" />
            <dataField fieldName="ShipPostalCode" columns="10" />
            <dataField fieldName="ShipCountry" columns="15" />
          </dataFields>
        </category>
      </categories>
    </view>
  </views>
  <actions>
    <actionGroup scope="Grid">
      <action commandName="Navigate" commandArgument="~/Forms/Details.aspx?OrderID={OrderID}" headerText="Order Details"/>
    </actionGroup>

    <actionGroup scope="Form">
      <action commandName="Edit" />
      <action commandName="Delete" confirmation="Delete?" />
      <action commandName="Back" headerText="Close"/>
      <action whenLastCommandName="Edit" commandName="Update" headerText="OK" />
      <action whenLastCommandName="Edit" commandName="Delete" confirmation="Delete?" />
      <action whenLastCommandName="Edit" commandName="Select" commandArgument="editForm1" headerText="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 Orders" description="Create a new Orders record." />
    </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