home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Introducing the New Way to Shop from Home
/
Iceland.iso
/
pc
/
unipower
/
Data1.cab
/
IcelandGroceryOffline.xml1
< prev
next >
Wrap
Text File
|
2003-03-05
|
207KB
|
4,910 lines
<models>
<model name="IcelandOffline">
<dataconnections>
<dataconnection name="Grocery" type="dcserver" connectionstring="IcelandOffline"/>
<dataconnection name="WWWRoot" type="file" connectionstring="%SMRuntime\Applications\IcelandOffline\HTTPServer_Virtual_Directory%" />
<dataconnection name="StoreContent" type="file" connectionstring="%SMRuntime\Applications\IcelandOfflineStoreContent\HTTPServer_Virtual_Directory%" />
</dataconnections>
<objects>
<object name="Address">
<datasource>
<query id="CustomerAddress" default="true">
<select name="SELECT
AddressID,
CustomerID,
AddressTypeID,
Street,
Area,
Town,
County,
Postcode,
DeliveryNote,
ShowTerms,
StoreID,
ZoneID,
HouseName
FROM Address
WHERE CustomerID = @CustomerID AND AddressTypeID = @AddressTypeID" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="AddressTypeID" datatype="integer" direction="in"/>
</select>
<insert name="INSERT INTO Address(
CustomerID,
AddressTypeID,
Street,
Area,
Town,
County,
PostCode,
DeliveryNote,
ShowTerms,
StoreID,
HouseName )
VALUES(
@CustomerID,
@AddressTypeID,
@Street,
@Area,
@Town,
@County,
@PostCode,
@DeliveryNote,
@ShowTerms,
@StoreID,
@HouseName )
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="AddressTypeID" datatype="integer" direction="in"/>
<parameter name="HouseName" datatype="string" direction="in"/>
<parameter name="Street" datatype="string" direction="in"/>
<parameter name="Area" datatype="string" direction="in"/>
<parameter name="Town" datatype="string" direction="in"/>
<parameter name="County" datatype="string" direction="in"/>
<parameter name="Postcode" datatype="string" direction="in"/>
<parameter name="DeliveryNote" datatype="string" direction="in"/>
<parameter name="ShowTerms" datatype="boolean" direction="in"/>
<parameter name="StoreID" datatype="integer" direction="in"/>
</insert>
<update name="UPDATE Address
SET Street = @Street,
AddressTypeID =@AddressTypeID,
Area = @Area,
Town = @Town,
County = @County,
Postcode = @Postcode,
DeliveryNote = @DeliveryNote,
ShowTerms = @ShowTerms,
StoreID = @StoreID,
HouseName = @HouseName
WHERE CustomerID = @CustomerID AND AddressID = @AddressID" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="AddressID" datatype="integer" direction="in"/>
<parameter name="AddressTypeID" datatype="integer" direction="in"/>
<parameter name="HouseName" datatype="string" direction="in"/>
<parameter name="Street" datatype="string" direction="in"/>
<parameter name="Area" datatype="string" direction="in"/>
<parameter name="Town" datatype="string" direction="in"/>
<parameter name="County" datatype="string" direction="in"/>
<parameter name="Postcode" datatype="string" direction="in"/>
<parameter name="DeliveryNote" datatype="string" direction="in"/>
<parameter name="ShowTerms" datatype="boolean" direction="in"/>
<parameter name="StoreID" datatype="integer" direction="in"/>
</update>
<delete name="DELETE FROM Address
WHERE AddressTypeID = @AddressTypeID AND CustomerID = @CustomerID
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="AddressTypeID" datatype="integer" direction="in"/>
</delete>
</query>
<query id="AddressByID" default="false">
<select name="SELECT
AddressID,
CustomerID,
AddressTypeID,
Street,
Area,
Town,
County,
Postcode,
DeliveryNote,
ShowTerms,
StoreID,
ZoneID,
HouseName
FROM Address
WHERE AddressID = @AddressID
" connection="Grocery" type="replace" use="raw">
<parameter name="AddressID" datatype="integer" direction="in"/>
</select>
<update name="UPDATE Address
SET HouseName = @HouseName,
Street = @Street,
Area = @Area,
Town = @Town,
County = @County,
Postcode = @Postcode,
DeliveryNote = @DeliveryNote,
ShowTerms = @ShowTerms,
StoreID = @StoreID
WHERE AddressID = @AddressID
" connection="Grocery" type="replace" use="raw">
<parameter name="AddressID" datatype="integer" direction="in"/>
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="AddressTypeID" datatype="integer" direction="in"/>
<parameter name="HouseName" datatype="string" direction="in"/>
<parameter name="Street" datatype="string" direction="in"/>
<parameter name="Area" datatype="string" direction="in"/>
<parameter name="Town" datatype="string" direction="in"/>
<parameter name="County" datatype="string" direction="in"/>
<parameter name="Postcode" datatype="string" direction="in"/>
<parameter name="DeliveryNote" datatype="string" direction="in"/>
<parameter name="ShowTerms" datatype="boolean" direction="in"/>
<parameter name="StoreID" datatype="integer" direction="in"/>
</update>
<delete name="DELETE FROM Address
WHERE AddressID = @AddressID
" connection="Grocery" type="replace" use="raw">
<parameter name="AddressID" datatype="integer" direction="in"/>
</delete>
</query>
<query id="CustomerAddresses" default="false">
<select name="SELECT
Address.AddressID,
Address.CustomerID,
AddressType.AddressTypeID,
Address.Street,
Address.Area,
Address.Town,
Address.County,
Address.Postcode,
Address.DeliveryNote,
Address.ShowTerms,
Address.StoreID,
Address.ZoneID,
Address.HouseName
FROM AddressType
INNER JOIN Address
ON AddressType.AddressTypeID = Address.AddressTypeID
WHERE Address.AddressTypeID < 6
AND Address.CustomerID = @CustomerID
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
</select>
<insert name="INSERT INTO Address(
CustomerID,
AddressTypeID,
Street,
Area,
Town,
County,
PostCode,
DeliveryNote,
ShowTerms,
StoreID,
HouseName )
VALUES(
@CustomerID,
@AddressTypeID,
@Street,
@Area,
@Town,
@County,
@PostCode,
@DeliveryNote,
@ShowTerms,
@StoreID,
@HouseName )
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="AddressTypeID" datatype="integer" direction="in"/>
<parameter name="HouseName" datatype="string" direction="in"/>
<parameter name="Street" datatype="string" direction="in"/>
<parameter name="Area" datatype="string" direction="in"/>
<parameter name="Town" datatype="string" direction="in"/>
<parameter name="County" datatype="string" direction="in"/>
<parameter name="Postcode" datatype="string" direction="in"/>
<parameter name="DeliveryNote" datatype="string" direction="in"/>
<parameter name="ShowTerms" datatype="boolean" direction="in"/>
<parameter name="StoreID" datatype="integer" direction="in"/>
</insert>
<update name="UPDATE Address
SET AddressTypeID =@AddressTypeID,
HouseName = @HouseName,
Street = @Street,
Area = @Area,
Town = @Town,
County = @County,
Postcode = @Postcode,
DeliveryNote = @DeliveryNote,
ShowTerms = @ShowTerms,
StoreID = @StoreID
WHERE CustomerID = @CustomerID AND AddressID = @AddressID
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="AddressID" datatype="integer" direction="in"/>
<parameter name="AddressTypeID" datatype="integer" direction="in"/>
<parameter name="HouseName" datatype="string" direction="in"/>
<parameter name="Street" datatype="string" direction="in"/>
<parameter name="Area" datatype="string" direction="in"/>
<parameter name="Town" datatype="string" direction="in"/>
<parameter name="County" datatype="string" direction="in"/>
<parameter name="Postcode" datatype="string" direction="in"/>
<parameter name="DeliveryNote" datatype="string" direction="in"/>
<parameter name="ShowTerms" datatype="boolean" direction="in"/>
<parameter name="StoreID" datatype="integer" direction="in"/>
</update>
<delete name="DELETE FROM Address
WHERE AddressTypeID = @AddressTypeID AND CustomerID = @CustomerID
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="AddressTypeID" datatype="integer" direction="in"/>
</delete>
</query>
<query id="AddressesByStoreGroup" default="false">
<select name="SELECT
Address.AddressID,
Address.CustomerID,
Address.AddressTypeID,
Address.Street,
Address.Area,
Address.Town,
Address.County,
Address.Postcode,
Address.DeliveryNote,
Address.ShowTerms,
Address.StoreID,
Address.ZoneID,
Address.HouseName
FROM Address
INNER JOIN StoreInStoreGroup
ON Address.StoreID = StoreInStoreGroup.StoreID
WHERE StoreInStoreGroup.StoreGroupID = @StoreGroupID
" connection="Grocery" type="replace" use="raw">
<parameter name="StoreGroupID" datatype="integer" direction="in"/>
</select>
<update name="UPDATE Address
SET AddressTypeID =@AddressTypeID,
HouseName = @HouseName,
Street = @Street,
Area = @Area,
Town = @Town,
County = @County,
Postcode = @Postcode,
DeliveryNote = @DeliveryNote,
ShowTerms = @ShowTerms,
StoreID = @StoreID
WHERE CustomerID = @CustomerID AND AddressID = @AddressID
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="AddressID" datatype="integer" direction="in"/>
<parameter name="AddressTypeID" datatype="integer" direction="in"/>
<parameter name="HouseName" datatype="string" direction="in"/>
<parameter name="Street" datatype="string" direction="in"/>
<parameter name="Area" datatype="string" direction="in"/>
<parameter name="Town" datatype="string" direction="in"/>
<parameter name="County" datatype="string" direction="in"/>
<parameter name="Postcode" datatype="string" direction="in"/>
<parameter name="DeliveryNote" datatype="string" direction="in"/>
<parameter name="ShowTerms" datatype="boolean" direction="in"/>
<parameter name="StoreID" datatype="integer" direction="in"/>
</update>
</query>
<query id="CustomerAddressesByStoreGroup" default="false">
<select name="SELECT
Address.AddressID,
Address.CustomerID,
Address.AddressTypeID,
Address.Street,
Address.Area,
Address.Town,
Address.County,
Address.Postcode,
Address.DeliveryNote,
Address.ShowTerms,
Address.StoreID,
Address.ZoneID,
Address.HouseName
FROM Address
INNER JOIN StoreInStoreGroup
ON Address.StoreID = StoreInStoreGroup.StoreID
WHERE StoreInStoreGroup.StoreGroupID = @StoreGroupID
AND Address.CustomerID = @CustomerID
" connection="Grocery" type="replace" use="raw">
<parameter name="StoreGroupID" datatype="integer" direction="in"/>
<parameter name="CustomerID" datatype="integer" direction="in"/>
</select>
<update name="UPDATE Address
SET AddressTypeID =@AddressTypeID,
HouseName = @HouseName,
Street = @Street,
Area = @Area,
Town = @Town,
County = @County,
Postcode = @Postcode,
DeliveryNote = @DeliveryNote,
ShowTerms = @ShowTerms,
StoreID = @StoreID
WHERE CustomerID = @CustomerID AND AddressID = @AddressID
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="AddressID" datatype="integer" direction="in"/>
<parameter name="AddressTypeID" datatype="integer" direction="in"/>
<parameter name="HouseName" datatype="string" direction="in"/>
<parameter name="Street" datatype="string" direction="in"/>
<parameter name="Area" datatype="string" direction="in"/>
<parameter name="Town" datatype="string" direction="in"/>
<parameter name="County" datatype="string" direction="in"/>
<parameter name="Postcode" datatype="string" direction="in"/>
<parameter name="DeliveryNote" datatype="string" direction="in"/>
<parameter name="ShowTerms" datatype="boolean" direction="in"/>
<parameter name="StoreID" datatype="integer" direction="in"/>
</update>
</query>
</datasource>
<properties>
<property name="AddressID" alias="AddressID" datatype="integer" nullable="false" pkey="true"/>
<property name="CustomerID" alias="CustomerID" datatype="integer" nullable="false" pkey="true"/>
<property name="AddressTypeID" alias="AddressTypeID" datatype="integer" nullable="false" pkey="true"/>
<property name="HouseName" alias="HouseName" datatype="string" nullable="false"/>
<property name="Street" alias="Street" datatype="string" nullable="false"/>
<property name="Area" alias="Area" datatype="string" nullable="true"/>
<property name="Town" alias="Town" datatype="string" nullable="false"/>
<property name="County" alias="County" datatype="string" nullable="true"/>
<property name="Postcode" alias="Postcode" datatype="string" nullable="false"/>
<property name="DeliveryNote" alias="DeliveryNote" datatype="string" nullable="true"/>
<property name="ShowTerms" alias="ShowTerms" datatype="boolean" nullable="false"/>
<property name="StoreID" alias="StoreID" datatype="integer" nullable="true"/>
<property name="ZoneID" alias="ZoneID" datatype="integer" nullable="true"/>
<property name="StoreGroupID" alias="StoreGroupID" datatype="integer" nullable="true"/>
</properties>
<relationships>
<relationship name="AddressByID" object="Address" keyprop="none" collection="false" query="AddressByID">
<key pkey="AddressID" fkey="AddressID" from="parent" to="child"/>
</relationship>
<relationship name="AddressesByStoreGroup" object="Address" keyprop="none" collection="true" query="AddressesByStoreGroup">
<key pkey="StoreGroupID" fkey="StoreGroupID" from="parent" to="child"/>
</relationship>
<relationship name="CustomerAddressesByStoreGroup" object="Address" keyprop="none" collection="true" query="CustomerAddressesByStoreGroup">
<key pkey="StoreGroupID" fkey="StoreGroupID" from="parent" to="child"/>
<key pkey="CustomerID" fkey="CustomerID" from="parent" to="child"/>
</relationship>
</relationships>
</object>
<object name="Basket">
<datasource>
<query id="CustomerBasket" default="true">
<select name="SELECT @CustomerID AS CustomerID, @StoreID AS StoreID
FROM Customer
WHERE CustomerID=@CustomerID
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="StoreID" datatype="integer" direction="in"/>
</select>
<delete name="DELETE FROM BasketItem
WHERE CustomerID = @CustomerID
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
</delete>
</query>
</datasource>
<properties>
<property name="CustomerID" alias="CustomerID" datatype="integer" nullable="false" pkey="true" identity="false"/>
<property name="StoreID" alias="StoreID" datatype="integer" nullable="true"/>
<property name="PromoReduction" alias="PromoReduction" datatype="money" nullable="true"/>
<property name="LoyaltyPoints" alias="LoyaltyPoints" datatype="integer" nullable="true"/>
<property name="BasketTotal" alias="BasketTotal" datatype="money" nullable="true"/>
<property name="IntroductionDate" alias="IntroductionDate" datatype="date" nullable="true"/>
</properties>
<relationships>
<relationship name="Items" object="BasketItem" keyprop="none" collection="true" query="CustomerBasketItems">
<key pkey="CustomerID" fkey="CustomerID" from="parent" to="child"/>
<key pkey="StoreID" fkey="StoreID" from="parent" to="child"/>
<key pkey="IntroductionDate" fkey="IntroductionDate" from="parent" to="child"/>
</relationship>
<relationship name="Promos" object="Promo" keyprop="none" collection="true" query="StoreBasketPromos">
<key pkey="CustomerID" fkey="CustomerID" from="parent" to="child"/>
<key pkey="StoreID" fkey="StoreID" from="parent" to="child"/>
<key pkey="IntroductionDate" fkey="IntroductionDate" from="parent" to="child"/>
</relationship>
<relationship name="BasketPromos" object="Promo" keyprop="none" collection="true" query="BasketPromos">
<key pkey="CustomerID" fkey="CustomerID" from="parent" to="child"/>
<key pkey="StoreID" fkey="StoreID" from="parent" to="child"/>
<key pkey="IntroductionDate" fkey="IntroductionDate" from="parent" to="child"/>
</relationship>
</relationships>
<methods>
<method name="BasketToOrder" returntype="integer" uuid="IcelandGrocery.Basket" implname="BasketToOrder">
<parameter name="OrderID" datatype="integer" direction="in"/>
</method>
<method name="CalcPromos" returntype="object" uuid="IcelandGrocery.Basket" implname="CalcPromos">
<parameter name="IsCheckout" datatype="boolean" direction="in"/>
</method>
</methods>
</object>
<object name="BasketItem">
<datasource>
<query id="CustomerBasketItems" default="false">
<select name="SELECT DISTINCT
BasketItem.BasketItemID,
BasketItem.CustomerID,
BasketItem.Quantity,
BasketItem.ItemNo,
BasketItem.Note,
BasketItem.UnitID AS BasketUnitID,
Product.ProductID,
Product.Name,
Product.Description,
Product.PackSize,
Product.UnitSize,
Product.UnitID,
Product.HasLabelData,
ProductInStore.CaseDealImageID,
Product.CaseDealParentID,
ProductInStore.ComparativeSizeInfo,
ProductInStore.AddedVal,
ProductInStore.Saving,
ProductInStore.IsNew,
ProductInStore.IsCaseDealParent,
ProductInStore.Price,
ProductInStore.StoreID AS IsAvailable,
ProductInStore.IntroductionDate,
ProductOptionValue.ProductID AS HasOptions,
BasketItem.UpdateTime
FROM BasketItem
INNER JOIN Product
ON BasketItem.ProductID = Product.ProductID
LEFT JOIN ProductInStore
ON Product.ProductID = ProductInStore.ProductID
LEFT JOIN ProductOptionValue
ON ProductOptionValue.ProductID = Product.ProductID
WHERE BasketItem.CustomerID = @CustomerID
AND @IntroductionDate != NULL
AND ProductInStore.StoreID = @StoreID
AND ProductInStore.IntroductionDate <= @IntroductionDate
ORDER BY
BasketItem.UpdateTime DES,
BasketItem.ItemNo DES,
ProductInStore.IntroductionDate DES
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="IntroductionDate" datatype="Date" direction="in"/>
</select>
<insert name="INSERT INTO BasketItem(
CustomerID,
ProductID,
Quantity,
UnitID,
ItemNo,
Note)
VALUES(
@CustomerID,
@ProductID,
@Quantity,
@UnitID,
@ItemNo,
@Note )
SELECT @@IDENTITY AS BasketItemID
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="ProductID" datatype="integer" direction="in"/>
<parameter name="Quantity" datatype="float" direction="in"/>
<parameter name="UnitID" datatype="integer" direction="in"/>
<parameter name="ItemNo" datatype="short" direction="in"/>
<parameter name="Note" datatype="string" direction="in"/>
</insert>
<update name="UPDATE BasketItem
SET ProductID = @ProductID,
Quantity = @Quantity,
UnitID = @UnitID,
Note = @Note,
UpdateTime=GETDATE()
WHERE CustomerID = @CustomerID AND ItemNo = @ItemNo
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="ProductID" datatype="integer" direction="in"/>
<parameter name="Quantity" datatype="float" direction="in"/>
<parameter name="UnitID" datatype="integer" direction="in"/>
<parameter name="ItemNo" datatype="short" direction="in"/>
<parameter name="Note" datatype="string" direction="in"/>
</update>
<delete name="DELETE FROM BasketItem
WHERE CustomerID = @CustomerID AND ItemNo = @ItemNo
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="ItemNo" datatype="short" direction="in"/>
</delete>
</query>
<query id="CustomerBasketItem" default="true">
<select name="SELECT DISTINCT
BasketItem.BasketItemID,
BasketItem.CustomerID,
BasketItem.Quantity,
BasketItem.ItemNo,
BasketItem.Note,
BasketItem.UnitID AS BasketUnitID,
Product.ProductID,
Product.Name,
Product.Description,
Product.PackSize,
Product.UnitSize,
Product.UnitID,
Product.HasLabelData,
ProductInStore.IsCaseDealParent,
ProductInStore.CaseDealImageID,
Product.CaseDealParentID,
ProductInStore.ComparativeSizeInfo,
ProductInStore.AddedVal,
ProductInStore.Saving,
ProductInStore.IsNew,
ProductInStore.Price,
ProductInStore.StoreID AS IsAvailable,
ProductInStore.IntroductionDate,
ProductOptionValue.ProductID AS HasOptions
FROM BasketItem
INNER JOIN Product
ON BasketItem.ProductID = Product.ProductID
LEFT JOIN ProductInStore
ON Product.ProductID = ProductInStore.ProductID
LEFT JOIN ProductOptionValue
ON ProductOptionValue.ProductID = Product.ProductID
WHERE
BasketItem.CustomerID = @CustomerID
AND BasketItem.ItemNo = @ItemNo
AND @IntroductionDate != NULL
AND ProductInStore.StoreID = @StoreID
AND ProductInStore.IntroductionDate <= @IntroductionDate
ORDER BY ProductInStore.IntroductionDate DESC
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="ItemNo" datatype="short" direction="in"/>
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="IntroductionDate" datatype="Date" direction="in"/>
</select>
<insert name="INSERT INTO BasketItem(
CustomerID,
ProductID,
Quantity,
UnitID,
ItemNo,
Note)
VALUES(
@CustomerID,
@ProductID,
@Quantity,
@UnitID,
@ItemNo,
@Note )
SELECT @@IDENTITY AS BasketItemID
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="ProductID" datatype="integer" direction="in"/>
<parameter name="Quantity" datatype="float" direction="in"/>
<parameter name="UnitID" datatype="integer" direction="in"/>
<parameter name="ItemNo" datatype="short" direction="in"/>
<parameter name="Note" datatype="string" direction="in"/>
</insert>
<update name="UPDATE BasketItem
SET ProductID = @ProductID,
Quantity = @Quantity,
UnitID = @UnitID,
Note = @Note,
UpdateTime=GETDATE()
WHERE CustomerID = @CustomerID AND ItemNo = @ItemNo
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="ProductID" datatype="integer" direction="in"/>
<parameter name="Quantity" datatype="float" direction="in"/>
<parameter name="UnitID" datatype="integer" direction="in"/>
<parameter name="ItemNo" datatype="short" direction="in"/>
<parameter name="Note" datatype="string" direction="in"/>
</update>
<delete name="DELETE FROM BasketItem
WHERE CustomerID = @CustomerID AND ItemNo = @ItemNo
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="ItemNo" datatype="short" direction="in"/>
</delete>
</query>
</datasource>
<properties>
<property name="ItemID" alias="BasketItemID" datatype="integer" nullable="false" pkey="true" identity="true"/>
<property name="CustomerID" alias="CustomerID" datatype="integer" nullable="false"/>
<property name="Quantity" alias="Quantity" datatype="float" nullable="false"/>
<property name="ItemNo" alias="ItemNo" datatype="short" nullable="false"/>
<property name="Note" alias="Note" datatype="string" nullable="true"/>
<property name="ItemUnitID" alias="BasketUnitID" datatype="integer" nullable="false"/>
<property name="ProductID" alias="ProductID" datatype="integer" nullable="false"/>
<property name="Name" alias="Name" datatype="string" nullable="true"/>
<property name="Description" alias="Description" datatype="string" nullable="true"/>
<property name="PackSize" alias="PackSize" datatype="short" nullable="true"/>
<property name="UnitSize" alias="UnitSize" datatype="float" nullable="true"/>
<property name="UnitID" alias="UnitID" datatype="integer" nullable="false"/>
<property name="ComparativeSizeInfo" alias="ComparativeSizeInfo" datatype="String" nullable="true"/>
<property name="AddedVal" alias="AddedVal" datatype="string" nullable="true"/>
<property name="Saving" alias="Saving" datatype="money" nullable="true"/>
<property name="IsNew" alias="IsNew" datatype="boolean" nullable="true"/>
<property name="HasLabelData" alias="HasLabelData" datatype="boolean" nullable="false"/>
<property name="Price" alias="Price" datatype="money" nullable="true"/>
<property name="ItemCost" alias="ItemCost" datatype="money" nullable="true"/>
<property name="IsAvailable" alias="IsAvailable" datatype="integer" nullable="true"/>
<property name="IntroductionDate" alias="IntroductionDate" datatype="Date" nullable="false"/>
<property name="HasOptions" alias="HasOptions" datatype="integer" nullable="true"/>
<property name="PromoReduction" alias="PromoReduction" datatype="money" nullable="true"/>
<property name="IsCaseDealParent" alias="IsCaseDealParent" datatype="boolean" nullable="false"/>
<property name="CaseDealParentID" alias="CaseDealParentID" datatype="integer" nullable="true"/>
<property name="CaseDealImageID" alias="CaseDealImageID" datatype="string" nullable="true"/>
<property name="CategoryRank" alias="CategoryRank" datatype="integer" nullable="true"/>
</properties>
<relationships>
<relationship name="OptionValues" object="BasketItemOptionValue" keyprop="down" collection="true" query="BasketItemOptionValues">
<key pkey="ItemID" fkey="BasketItemID" from="parent" to="child"/>
</relationship>
<relationship name="Options" object="ProductOption" keyprop="none" collection="true" query="ProductOptions">
<key pkey="ProductID" fkey="ProductID" from="parent" to="child"/>
</relationship>
<relationship name="Categories" object="Category" keyprop="none" collection="true" query="ProductCategories">
<key pkey="IsAvailable" fkey="StoreID" from="parent" to="child"/>
<key pkey="ProductID" fkey="ProductID" from="parent" to="child"/>
</relationship>
<relationship name="CaseDealProducts" object="Product" keyprop="none" collection="true" query="StoreProductCaseDealProducts">
<key pkey="IsAvailable" fkey="StoreID" from="parent" to="child"/>
<key pkey="ProductID" fkey="CaseDealParentID" from="parent" to="child"/>
<key pkey="IntroductionDate" fkey="IntroductionDate" from="parent" to="child"/>
</relationship>
</relationships>
</object>
<object name="BasketItemOptionValue">
<datasource>
<query id="BasketItemOptionValues" default="false">
<select name="SELECT BasketItemID, ProductOptionID, OptionValue
FROM BasketItemOptionValue
WHERE BasketItemID = @BasketItemID
" connection="Grocery" type="replace" use="raw">
<parameter name="BasketItemID" datatype="integer" direction="in"/>
</select>
<insert name="INSERT INTO BasketItemOptionValue(BasketItemID, ProductOptionID, OptionValue)
VALUES(@BasketItemID, @ProductOptionID, @OptionValue)
" connection="Grocery" type="replace" use="raw">
<parameter name="BasketItemID" datatype="integer" direction="in"/>
<parameter name="ProductOptionID" datatype="integer" direction="in"/>
<parameter name="OptionValue" datatype="string" direction="in"/>
</insert>
<update name="UPDATE BasketItemOptionValue
SET OptionValue = @OptionValue
WHERE BasketItemID = @BasketItemID AND ProductOptionID = @ProductOptionID
" connection="Grocery" type="replace" use="raw">
<parameter name="BasketItemID" datatype="integer" direction="in"/>
<parameter name="ProductOptionID" datatype="integer" direction="in"/>
<parameter name="OptionValue" datatype="string" direction="in"/>
</update>
<delete name="DELETE FROM BasketItemOptionValue
WHERE BasketItemID = @BasketItemID
" connection="Grocery" type="replace" use="raw">
<parameter name="BasketItemID" datatype="integer" direction="in"/>
</delete>
</query>
<query id="BasketItemOptionValue" default="true">
<select name="SELECT BasketItemID, ProductOptionID, OptionValue
FROM BasketItemOptionValue
WHERE BasketItemID = @BasketItemID AND ProductOptionID = @ProductOptionID
" connection="Grocery" type="replace" use="raw">
<parameter name="BasketItemID" datatype="integer" direction="in"/>
<parameter name="ProductOptionID" datatype="integer" direction="in"/>
</select>
<insert name="INSERT INTO BasketItemOptionValue(BasketItemID, ProductOptionID, OptionValue)
VALUES(@BasketItemID, @ProductOptionID, @OptionValue)
" connection="Grocery" type="replace" use="raw">
<parameter name="BasketItemID" datatype="integer" direction="in"/>
<parameter name="ProductOptionID" datatype="integer" direction="in"/>
<parameter name="OptionValue" datatype="string" direction="in"/>
</insert>
<update name="UPDATE BasketItemOptionValue
SET OptionValue = @OptionValue
WHERE BasketItemID = @BasketItemID AND ProductOptionID = @ProductOptionID
" connection="Grocery" type="replace" use="raw">
<parameter name="BasketItemID" datatype="integer" direction="in"/>
<parameter name="ProductOptionID" datatype="integer" direction="in"/>
<parameter name="OptionValue" datatype="string" direction="in"/>
</update>
<delete name="DELETE FROM BasketItemOptionValue
WHERE BasketItemID = @BasketItemID AND ProductOptionID = @ProductOptionID
" connection="Grocery" type="replace" use="raw">
<parameter name="BasketItemID" datatype="integer" direction="in"/>
<parameter name="ProductOptionID" datatype="integer" direction="in"/>
</delete>
</query>
</datasource>
<properties>
<property name="BasketItemID" alias="BasketItemID" datatype="integer" nullable="false" pkey="true" identity="false"/>
<property name="ProductOptionID" alias="ProductOptionID" datatype="integer" nullable="false" pkey="true" identity="false"/>
<property name="OptionValue" alias="OptionValue" datatype="string" nullable="false"/>
</properties>
<relationships/>
</object>
<object name="Category">
<datasource>
<query id="ProductCategories" default="false">
<select name="SELECT DISTINCT
CategoryInStore.StoreID AS StoreID,
Category.CategoryID,
Name,
ParentID,
LevelNo,
IsLeaf,
TopLevelID,
ColorCode,
SortOrder
FROM Category
INNER JOIN ProductInCategory
ON Category.CategoryID = ProductInCategory.CategoryID
INNER JOIN CategoryInStore
ON Category.CategoryID = CategoryInStore.CategoryID
INNER JOIN ProductInStore
ON ProductInStore.StoreID = CategoryInStore.StoreID
WHERE ProductInStore.ProductID = @ProductID
AND ProductInCategory.ProductID = @ProductID
AND ProductInStore.StoreID = @StoreID
" connection="Grocery" type="replace" use="raw">
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="ProductID" datatype="integer" direction="in"/>
</select>
</query>
<query id="StoreCategory" default="true">
<select name="SELECT
CategoryInStore.StoreID,
Category.CategoryID,
Name,
ParentID,
LevelNo,
IsLeaf,
TopLevelID,
ColorCode,
SortOrder
FROM Category
INNER JOIN CategoryInStore
ON CategoryInStore.CategoryID = Category.CategoryID
WHERE CategoryInStore.StoreID = @StoreID
AND Category.CategoryID = @CategoryID
" connection="Grocery" type="replace" use="raw">
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="CategoryID" datatype="integer" direction="in"/>
</select>
</query>
<query id="StoreCategories" default="false">
<select name="SELECT
CategoryInStore.StoreID,
Category.CategoryID,
Category.Name,
Category.ParentID,
Category.LevelNo,
Category.IsLeaf,
Category.TopLevelID,
Category.ColorCode,
Category.SortOrder
FROM Category
INNER JOIN CategoryInStore
ON Category.CategoryID = CategoryInStore.CategoryID
WHERE CategoryInStore.StoreID = @StoreID
ORDER BY Category.LevelNo
" connection="Grocery" type="replace" use="raw">
<parameter name="StoreID" datatype="integer" direction="in"/>
</select>
</query>
<query id="StoreSubCategories" default="false">
<select name="SELECT
CategoryInStore.StoreID,
Category.CategoryID,
Name, ParentID,
LevelNo,
IsLeaf,
TopLevelID,
ColorCode,
SortOrder
FROM Category
INNER JOIN CategoryInStore
ON Category.CategoryID = CategoryInStore.CategoryID
WHERE CategoryInStore.StoreID = @StoreID
AND ParentID = @ParentID
" connection="Grocery" type="replace" use="raw">
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="ParentID" datatype="integer" direction="in"/>
</select>
</query>
</datasource>
<properties>
<property name="StoreID" alias="StoreID" datatype="integer" nullable="false" pkey="false"/>
<property name="CategoryID" alias="CategoryID" datatype="integer" nullable="false" pkey="true"/>
<property name="Name" alias="Name" datatype="string" nullable="false"/>
<property name="ParentID" alias="ParentID" datatype="integer" nullable="false"/>
<property name="LevelNo" alias="LevelNo" datatype="short" nullable="false"/>
<property name="IsLeaf" alias="IsLeaf" datatype="boolean" nullable="false"/>
<property name="TopLevelID" alias="TopLevelID" datatype="integer" nullable="false"/>
<property name="ColorCode" alias="ColorCode" datatype="String" nullable="true"/>
<property name="SortOrder" alias="SortOrder" datatype="integer" nullable="true"/>
</properties>
<relationships>
<relationship name="Categories" object="Category" keyprop="none" collection="true" query="StoreSubCategories">
<key pkey="StoreID" fkey="StoreID" from="parent" to="child"/>
<key pkey="CategoryID" fkey="ParentID" from="parent" to="child"/>
</relationship>
<relationship name="Products" object="Product" keyprop="none" collection="true" query="StoreCategoryProducts">
<key pkey="StoreID" fkey="StoreID" from="parent" to="child"/>
<key pkey="CategoryID" fkey="CategoryID" from="parent" to="child"/>
</relationship>
<relationship name="ProductsWithAV" object="Product" keyprop="none" collection="true" query="StoreCategoryProductsWithAV">
<key pkey="StoreID" fkey="StoreID" from="parent" to="child"/>
<key pkey="CategoryID" fkey="CategoryID" from="parent" to="child"/>
<key pkey="AttributeID" fkey="AttributeID" from="parent" to="child"/>
</relationship>
<relationship name="Attributes" object="ProductAttribute" keyprop="none" collection="true" query="StoreCategoryAttributes">
<key pkey="StoreID" fkey="StoreID" from="parent" to="child"/>
<key pkey="CategoryID" fkey="CategoryID" from="parent" to="child"/>
</relationship>
</relationships>
</object>
<object name="Coupon">
<datasource>
<query id="CustomerCoupon" default="true">
<select name="SELECT CouponID, CustomerID, PromoID
FROM Coupon
WHERE CouponID = @CouponID
" connection="Grocery" type="replace" use="raw">
<parameter name="CouponID" datatype="integer" direction="in"/>
</select>
<insert name="INSERT INTO Coupon(PromoID, CustomerID)
VALUES(@PromoID, @CustomerID)
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="PromoID" datatype="integer" direction="in"/>
</insert>
<delete name="DELETE FROM Coupon
WHERE CouponID = @CouponID
" connection="Grocery" type="replace" use="raw">
<parameter name="CouponID" datatype="integer" direction="in"/>
</delete>
</query>
</datasource>
<properties>
<property name="CouponID" alias="CouponID" datatype="integer" nullable="false" pkey="true"/>
<property name="CustomerID" alias="CustomerID" datatype="integer" nullable="false" pkey="false"/>
<property name="PromoID" alias="PromoID" datatype="integer" nullable="false" pkey="false"/>
</properties>
</object>
<object name="CreditCardScheme">
<datasource>
<query id="CreditCardScheme" default="true">
<select name="NOT_USED_OFFLINE" type="replace" use="raw" connection="Grocery">
<parameter name="CCNo" datatype="string" direction="in"/>
</select>
</query>
</datasource>
<properties>
<property name="CardType" alias="CardType" datatype="string"/>
<property name="PANLength" alias="PANLength" datatype="integer"/>
<property name="ExpDate" alias="ExpDate" datatype="boolean"/>
<property name="IssueNo" alias="IssueNo" datatype="boolean"/>
<property name="FromDate" alias="FromDate" datatype="boolean"/>
<property name="Accepted" alias="Accepted" datatype="boolean"/>
<property name="IssueLength" alias="IssueLength" datatype="integer"/>
</properties>
<relationships/>
</object>
<object name="Customer">
<datasource>
<query id="Customer" default="true">
<select name="SELECT
CustomerID,
SessionGuid,
LastLogin,
CreationDate,
Title,
Surname,
Forename,
EMail,
Password,
HomeTel,
CustomerType,
Status,
GuestPostcode,
LoyaltyPoints,
LoginID,
LastAddressID,
IsAdmin,
CCNo,
CCName,
CCFromDate,
CCExpDate,
CCIssueNo,
CCSave,
RecieveInfoIceland,
RecieveInfoOther,
UpdateFlag,
Source
FROM Customer
WHERE
CustomerID = @CustomerID
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
</select>
<insert name="INSERT INTO Customer
(
SessionGuid,
LastLogin,
CreationDate,
Title,
Surname,
Forename,
EMail,
Password,
HomeTel,
CustomerType,
Status,
GuestPostCode,
LoginID,
LastAddressID,
IsAdmin,
CCNo,
CCName,
CCFromDate,
CCExpDate,
CCIssueNo,
CCSave,
RecieveInfoIceland,
RecieveInfoOther,
UpdateFlag,
Source
)
VALUES
(
@SessionGuid,
@LastLogin,
@CreationDate,
@Title,
@Surname,
@Forename,
@EMail,
@Password,
@HomeTel,
@CustomerType,
@Status,
@GuestPostCode,
@LoginID,
@LastAddressID,
@IsAdmin,
@CCNo,
@CCName,
@CCFromDate,
@CCExpDate,
@CCIssueNo,
@CCSave,
@RecieveInfoIceland,
@RecieveInfoOther,
@UpdateFlag,
@Source
)
" connection="Grocery" type="replace" use="raw">
<parameter name="SessionGuid" datatype="guid" direction="in"/>
<parameter name="LastLogin" datatype="date" direction="in"/>
<parameter name="CreationDate" datatype="date" direction="in"/>
<parameter name="Title" datatype="string" direction="in"/>
<parameter name="Surname" datatype="string" direction="in"/>
<parameter name="Forename" datatype="string" direction="in"/>
<parameter name="EMail" datatype="string" direction="in"/>
<parameter name="Password" datatype="string" direction="in"/>
<parameter name="HomeTel" datatype="string" direction="in"/>
<parameter name="CustomerType" datatype="short" direction="in"/>
<parameter name="Status" datatype="short" direction="in"/>
<parameter name="GuestPostcode" datatype="string" direction="in"/>
<parameter name="LoginID" datatype="string" direction="in"/>
<parameter name="LastAddressID" datatype="integer" direction="in"/>
<parameter name="IsAdmin" datatype="boolean" direction="in"/>
<parameter name="CCNo" datatype="string" direction="in"/>
<parameter name="CCName" datatype="string" direction="in"/>
<parameter name="CCFromDate" datatype="date" direction="in"/>
<parameter name="CCExpDate" datatype="date" direction="in"/>
<parameter name="CCIssueNo" datatype="String" direction="in"/>
<parameter name="CCSave" datatype="boolean" direction="in"/>
<parameter name="RecieveInfoIceland" datatype="boolean" direction="in"/>
<parameter name="RecieveInfoOther" datatype="boolean" direction="in"/>
<parameter name="UpdateFlag" datatype="boolean" direction="in"/>
<parameter name="Source" datatype="string" direction="in"/>
</insert>
<update name="UPDATE Customer
SET
SessionGuid = @SessionGuid,
LastLogIn = @LastLogIn,
Title = @Title,
Surname = @Surname,
Forename = @Forename,
EMail = @EMail,
Password = @Password,
HomeTel = @HomeTel,
CustomerType = @CustomerType,
Status = @Status,
GuestPostCode = @GuestPostCode,
LoyaltyPoints = @LoyaltyPoints,
LoginID = @LoginID,
LastAddressID = @LastAddressID,
IsAdmin = @IsAdmin,
CCNo = @CCNo,
CCName = @CCName,
CCFromDate = @CCFromDate,
CCExpDate = @CCExpDate,
CCIssueNo = @CCIssueNo,
CCSave = @CCSave,
RecieveInfoIceland = @RecieveInfoIceland,
RecieveInfoOther = @RecieveInfoOther,
UpdateFlag = @UpdateFlag,
Source=@Source
WHERE CustomerID = @CustomerID
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="SessionGuid" datatype="guid" direction="in"/>
<parameter name="LastLogin" datatype="date" direction="in"/>
<parameter name="Title" datatype="string" direction="in"/>
<parameter name="Surname" datatype="string" direction="in"/>
<parameter name="Forename" datatype="string" direction="in"/>
<parameter name="EMail" datatype="string" direction="in"/>
<parameter name="Password" datatype="string" direction="in"/>
<parameter name="HomeTel" datatype="string" direction="in"/>
<parameter name="CustomerType" datatype="short" direction="in"/>
<parameter name="Status" datatype="short" direction="in"/>
<parameter name="GuestPostcode" datatype="string" direction="in"/>
<parameter name="LoyaltyPoints" datatype="float" direction="in"/>
<parameter name="LoginID" datatype="string" direction="in"/>
<parameter name="LastAddressID" datatype="integer" direction="in"/>
<parameter name="IsAdmin" datatype="boolean" direction="in"/>
<parameter name="CCNo" datatype="string" direction="in"/>
<parameter name="CCName" datatype="string" direction="in"/>
<parameter name="CCFromDate" datatype="date" direction="in"/>
<parameter name="CCExpDate" datatype="date" direction="in"/>
<parameter name="CCIssueNo" datatype="String" direction="in"/>
<parameter name="CCSave" datatype="boolean" direction="in"/>
<parameter name="RecieveInfoIceland" datatype="boolean" direction="in"/>
<parameter name="RecieveInfoOther" datatype="boolean" direction="in"/>
<parameter name="UpdateFlag" datatype="boolean" direction="in"/>
<parameter name="Source" datatype="string" direction="in"/>
</update>
<delete name="DELETE FROM Customer WHERE CustomerID = @CustomerID" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
</delete>
</query>
<query id="CustomerByGuid" default="false">
<select name="SELECT
CustomerID,
SessionGuid,
LastLogin,
CreationDate,
Title,
Surname,
Forename,
EMail,
Password,
HomeTel,
CustomerType,
Status,
GuestPostcode,
LoyaltyPoints,
LoginID,
LastAddressID,
IsAdmin,
CCNo,
CCName,
CCFromDate,
CCExpDate,
CCIssueNo,
CCSave,
RecieveInfoIceland,
RecieveInfoOther,
UpdateFlag,
Source
FROM Customer
WHERE SessionGuid = @SessionGuid" connection="Grocery" type="replace" use="raw">
<parameter name="SessionGuid" datatype="guid" direction="in"/>
</select>
<insert name="INSERT INTO Customer
(
SessionGuid,
LastLogin,
CreationDate,
Title,
Surname,
Forename,
EMail,
Password,
HomeTel,
CustomerType,
Status,
GuestPostCode,
LoginID,
LastAddressID,
IsAdmin,
CCNo,
CCName,
CCFromDate,
CCExpDate,
CCIssueNo,
CCSave,
RecieveInfoIceland,
RecieveInfoOther,
UpdateFlag,
Source
)
VALUES
(
@SessionGuid,
@LastLogin,
@CreationDate,
@Title,
@Surname,
@Forename,
@EMail,
@Password,
@HomeTel,
@CustomerType,
@Status,
@GuestPostCode,
@LoginID,
@LastAddressID,
@IsAdmin,
@CCNo,
@CCName,
@CCFromDate,
@CCExpDate,
@CCIssueNo,
@CCSave,
@RecieveInfoIceland,
@RecieveInfoOther,
@UpdateFlag,
@Source
)
" connection="Grocery" type="replace" use="raw">
<parameter name="SessionGuid" datatype="guid" direction="in"/>
<parameter name="LastLogin" datatype="date" direction="in"/>
<parameter name="CreationDate" datatype="date" direction="in"/>
<parameter name="Title" datatype="string" direction="in"/>
<parameter name="Surname" datatype="string" direction="in"/>
<parameter name="Forename" datatype="string" direction="in"/>
<parameter name="EMail" datatype="string" direction="in"/>
<parameter name="Password" datatype="string" direction="in"/>
<parameter name="HomeTel" datatype="string" direction="in"/>
<parameter name="CustomerType" datatype="short" direction="in"/>
<parameter name="Status" datatype="short" direction="in"/>
<parameter name="GuestPostcode" datatype="string" direction="in"/>
<parameter name="LoginID" datatype="string" direction="in"/>
<parameter name="LastAddressID" datatype="integer" direction="in"/>
<parameter name="IsAdmin" datatype="boolean" direction="in"/>
<parameter name="CCNo" datatype="string" direction="in"/>
<parameter name="CCName" datatype="string" direction="in"/>
<parameter name="CCFromDate" datatype="date" direction="in"/>
<parameter name="CCExpDate" datatype="date" direction="in"/>
<parameter name="CCIssueNo" datatype="String" direction="in"/>
<parameter name="CCSave" datatype="boolean" direction="in"/>
<parameter name="RecieveInfoIceland" datatype="boolean" direction="in"/>
<parameter name="RecieveInfoOther" datatype="boolean" direction="in"/>
<parameter name="UpdateFlag" datatype="boolean" direction="in"/>
<parameter name="Source" datatype="string" direction="in"/>
</insert>
<update name="UPDATE Customer
SET
SessionGuid = @SessionGuid,
LastLogIn = @LastLogIn,
Title = @Title,
Surname = @Surname,
Forename = @Forename,
EMail = @EMail,
Password = @Password,
HomeTel = @HomeTel,
CustomerType = @CustomerType,
Status = @Status,
GuestPostCode = @GuestPostCode,
LoyaltyPoints = @LoyaltyPoints,
LoginID = @LoginID,
LastAddressID = @LastAddressID,
IsAdmin = @IsAdmin,
CCNo = @CCNo,
CCName = @CCName,
CCFromDate = @CCFromDate,
CCExpDate = @CCExpDate,
CCIssueNo = @CCIssueNo,
CCSave = @CCSave,
RecieveInfoIceland = @RecieveInfoIceland,
RecieveInfoOther = @RecieveInfoOther,
UpdateFlag = @UpdateFlag,
Source=@Source
WHERE CustomerID = @CustomerID
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="SessionGuid" datatype="guid" direction="in"/>
<parameter name="LastLogin" datatype="date" direction="in"/>
<parameter name="Title" datatype="string" direction="in"/>
<parameter name="Surname" datatype="string" direction="in"/>
<parameter name="Forename" datatype="string" direction="in"/>
<parameter name="EMail" datatype="string" direction="in"/>
<parameter name="Password" datatype="string" direction="in"/>
<parameter name="HomeTel" datatype="string" direction="in"/>
<parameter name="CustomerType" datatype="short" direction="in"/>
<parameter name="Status" datatype="short" direction="in"/>
<parameter name="GuestPostcode" datatype="string" direction="in"/>
<parameter name="LoyaltyPoints" datatype="float" direction="in"/>
<parameter name="LoginID" datatype="string" direction="in"/>
<parameter name="LastAddressID" datatype="integer" direction="in"/>
<parameter name="IsAdmin" datatype="boolean" direction="in"/>
<parameter name="CCNo" datatype="string" direction="in"/>
<parameter name="CCName" datatype="string" direction="in"/>
<parameter name="CCFromDate" datatype="date" direction="in"/>
<parameter name="CCExpDate" datatype="date" direction="in"/>
<parameter name="CCIssueNo" datatype="String" direction="in"/>
<parameter name="CCSave" datatype="boolean" direction="in"/>
<parameter name="RecieveInfoIceland" datatype="boolean" direction="in"/>
<parameter name="RecieveInfoOther" datatype="boolean" direction="in"/>
<parameter name="UpdateFlag" datatype="boolean" direction="in"/>
<parameter name="Source" datatype="string" direction="in"/>
</update>
<delete name="DELETE FROM Customer WHERE CustomerID = @CustomerID
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
</delete>
</query>
<query id="CustomerByEMail" default="false">
<select name="SELECT
CustomerID,
SessionGuid,
LastLogin,
CreationDate,
Title,
Surname,
Forename,
EMail,
Password,
HomeTel,
CustomerType,
Status,
GuestPostcode,
LoyaltyPoints,
LoginID,
LastAddressID,
IsAdmin,
CCNo,
CCName,
CCFromDate,
CCExpDate,
CCIssueNo,
CCSave,
RecieveInfoIceland,
RecieveInfoOther,
UpdateFlag,
Source
FROM Customer
WHERE EMail = @EMail
" connection="Grocery" type="replace" use="raw">
<parameter name="EMail" datatype="string" direction="in"/>
</select>
<insert name="INSERT INTO Customer
(
SessionGuid,
LastLogin,
CreationDate,
Title,
Surname,
Forename,
EMail,
Password,
HomeTel,
CustomerType,
Status,
GuestPostCode,
LoginID,
LastAddressID,
IsAdmin,
CCNo,
CCName,
CCFromDate,
CCExpDate,
CCIssueNo,
CCSave,
RecieveInfoIceland,
RecieveInfoOther,
UpdateFlag,
Source
)
VALUES
(
@SessionGuid,
@LastLogin,
@CreationDate,
@Title,
@Surname,
@Forename,
@EMail,
@Password,
@HomeTel,
@CustomerType,
@Status,
@GuestPostCode,
@LoginID,
@LastAddressID,
@IsAdmin,
@CCNo,
@CCName,
@CCFromDate,
@CCExpDate,
@CCIssueNo,
@CCSave,
@RecieveInfoIceland,
@RecieveInfoOther,
@UpdateFlag,
@Source
)
" connection="Grocery" type="replace" use="raw">
<parameter name="SessionGuid" datatype="guid" direction="in"/>
<parameter name="LastLogin" datatype="date" direction="in"/>
<parameter name="CreationDate" datatype="date" direction="in"/>
<parameter name="Title" datatype="string" direction="in"/>
<parameter name="Surname" datatype="string" direction="in"/>
<parameter name="Forename" datatype="string" direction="in"/>
<parameter name="EMail" datatype="string" direction="in"/>
<parameter name="Password" datatype="string" direction="in"/>
<parameter name="HomeTel" datatype="string" direction="in"/>
<parameter name="CustomerType" datatype="short" direction="in"/>
<parameter name="Status" datatype="short" direction="in"/>
<parameter name="GuestPostcode" datatype="string" direction="in"/>
<parameter name="LoginID" datatype="string" direction="in"/>
<parameter name="LastAddressID" datatype="integer" direction="in"/>
<parameter name="IsAdmin" datatype="boolean" direction="in"/>
<parameter name="CCNo" datatype="string" direction="in"/>
<parameter name="CCName" datatype="string" direction="in"/>
<parameter name="CCFromDate" datatype="date" direction="in"/>
<parameter name="CCExpDate" datatype="date" direction="in"/>
<parameter name="CCIssueNo" datatype="String" direction="in"/>
<parameter name="CCSave" datatype="boolean" direction="in"/>
<parameter name="RecieveInfoIceland" datatype="boolean" direction="in"/>
<parameter name="RecieveInfoOther" datatype="boolean" direction="in"/>
<parameter name="UpdateFlag" datatype="boolean" direction="in"/>
<parameter name="Source" datatype="string" direction="in"/>
</insert>
<update name="UPDATE Customer
SET
SessionGuid = @SessionGuid,
LastLogIn = @LastLogIn,
Title = @Title,
Surname = @Surname,
Forename = @Forename,
EMail = @EMail,
Password = @Password,
HomeTel = @HomeTel,
CustomerType = @CustomerType,
Status = @Status,
GuestPostCode = @GuestPostCode,
LoyaltyPoints = @LoyaltyPoints,
LoginID = @LoginID,
LastAddressID = @LastAddressID,
IsAdmin = @IsAdmin,
CCNo = @CCNo,
CCName = @CCName,
CCFromDate = @CCFromDate,
CCExpDate = @CCExpDate,
CCIssueNo = @CCIssueNo,
CCSave = @CCSave,
RecieveInfoIceland = @RecieveInfoIceland,
RecieveInfoOther = @RecieveInfoOther,
UpdateFlag = @UpdateFlag,
Source=@Source
WHERE CustomerID = @CustomerID" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="SessionGuid" datatype="guid" direction="in"/>
<parameter name="LastLogin" datatype="date" direction="in"/>
<parameter name="Title" datatype="string" direction="in"/>
<parameter name="Surname" datatype="string" direction="in"/>
<parameter name="Forename" datatype="string" direction="in"/>
<parameter name="EMail" datatype="string" direction="in"/>
<parameter name="Password" datatype="string" direction="in"/>
<parameter name="HomeTel" datatype="string" direction="in"/>
<parameter name="CustomerType" datatype="short" direction="in"/>
<parameter name="Status" datatype="short" direction="in"/>
<parameter name="GuestPostcode" datatype="string" direction="in"/>
<parameter name="LoyaltyPoints" datatype="float" direction="in"/>
<parameter name="LoginID" datatype="string" direction="in"/>
<parameter name="LastAddressID" datatype="integer" direction="in"/>
<parameter name="IsAdmin" datatype="boolean" direction="in"/>
<parameter name="CCNo" datatype="string" direction="in"/>
<parameter name="CCName" datatype="string" direction="in"/>
<parameter name="CCFromDate" datatype="date" direction="in"/>
<parameter name="CCExpDate" datatype="date" direction="in"/>
<parameter name="CCIssueNo" datatype="String" direction="in"/>
<parameter name="CCSave" datatype="boolean" direction="in"/>
<parameter name="RecieveInfoIceland" datatype="boolean" direction="in"/>
<parameter name="RecieveInfoOther" datatype="boolean" direction="in"/>
<parameter name="UpdateFlag" datatype="boolean" direction="in"/>
<parameter name="Source" datatype="string" direction="in"/>
</update>
<delete name="DELETE FROM Customer WHERE CustomerID = @CustomerID" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
</delete>
</query>
<query id="CustomerByLoginID" default="false">
<select name="SELECT
CustomerID,
SessionGuid,
LastLogin,
CreationDate,
Title,
Surname,
Forename,
EMail,
Password,
HomeTel,
CustomerType,
Status,
GuestPostcode,
LoyaltyPoints,
LoginID,
LastAddressID,
IsAdmin,
CCNo,
CCName,
CCFromDate,
CCExpDate,
CCIssueNo,
CCSave,
RecieveInfoIceland,
RecieveInfoOther,
UpdateFlag,
Source
FROM Customer
WHERE LoginID = @LoginID" connection="Grocery" type="replace" use="raw">
<parameter name="LoginID" datatype="string" direction="in"/>
</select>
<insert name="INSERT INTO Customer
(
SessionGuid,
LastLogin,
CreationDate,
Title,
Surname,
Forename,
EMail,
Password,
HomeTel,
CustomerType,
Status,
GuestPostCode,
LoginID,
LastAddressID,
IsAdmin,
CCNo,
CCName,
CCFromDate,
CCExpDate,
CCIssueNo,
CCSave,
RecieveInfoIceland,
RecieveInfoOther,
UpdateFlag,
Source
)
VALUES
(
@SessionGuid,
@LastLogin,
@CreationDate,
@Title,
@Surname,
@Forename,
@EMail,
@Password,
@HomeTel,
@CustomerType,
@Status,
@GuestPostCode,
@LoginID,
@LastAddressID,
@IsAdmin,
@CCNo,
@CCName,
@CCFromDate,
@CCExpDate,
@CCIssueNo,
@CCSave,
@RecieveInfoIceland,
@RecieveInfoOther,
@UpdateFlag,
@Source
)
" connection="Grocery" type="replace" use="raw">
<parameter name="SessionGuid" datatype="guid" direction="in"/>
<parameter name="LastLogin" datatype="date" direction="in"/>
<parameter name="CreationDate" datatype="date" direction="in"/>
<parameter name="Title" datatype="string" direction="in"/>
<parameter name="Surname" datatype="string" direction="in"/>
<parameter name="Forename" datatype="string" direction="in"/>
<parameter name="EMail" datatype="string" direction="in"/>
<parameter name="Password" datatype="string" direction="in"/>
<parameter name="HomeTel" datatype="string" direction="in"/>
<parameter name="CustomerType" datatype="short" direction="in"/>
<parameter name="Status" datatype="short" direction="in"/>
<parameter name="GuestPostcode" datatype="string" direction="in"/>
<parameter name="LoginID" datatype="string" direction="in"/>
<parameter name="LastAddressID" datatype="integer" direction="in"/>
<parameter name="IsAdmin" datatype="boolean" direction="in"/>
<parameter name="CCNo" datatype="string" direction="in"/>
<parameter name="CCName" datatype="string" direction="in"/>
<parameter name="CCFromDate" datatype="date" direction="in"/>
<parameter name="CCExpDate" datatype="date" direction="in"/>
<parameter name="CCIssueNo" datatype="String" direction="in"/>
<parameter name="CCSave" datatype="boolean" direction="in"/>
<parameter name="RecieveInfoIceland" datatype="boolean" direction="in"/>
<parameter name="RecieveInfoOther" datatype="boolean" direction="in"/>
<parameter name="UpdateFlag" datatype="boolean" direction="in"/>
<parameter name="Source" datatype="string" direction="in"/>
</insert>
<update name="UPDATE Customer
SET
SessionGuid = @SessionGuid,
LastLogIn = @LastLogIn,
Title = @Title,
Surname = @Surname,
Forename = @Forename,
EMail = @EMail,
Password = @Password,
HomeTel = @HomeTel,
CustomerType = @CustomerType,
Status = @Status,
GuestPostCode = @GuestPostCode,
LoyaltyPoints = @LoyaltyPoints,
LoginID = @LoginID,
LastAddressID = @LastAddressID,
IsAdmin = @IsAdmin,
CCNo = @CCNo,
CCName = @CCName,
CCFromDate = @CCFromDate,
CCExpDate = @CCExpDate,
CCIssueNo = @CCIssueNo,
CCSave = @CCSave,
RecieveInfoIceland = @RecieveInfoIceland,
RecieveInfoOther = @RecieveInfoOther,
UpdateFlag = @UpdateFlag,
Source=@Source
WHERE CustomerID = @CustomerID
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="SessionGuid" datatype="guid" direction="in"/>
<parameter name="LastLogin" datatype="date" direction="in"/>
<parameter name="Title" datatype="string" direction="in"/>
<parameter name="Surname" datatype="string" direction="in"/>
<parameter name="Forename" datatype="string" direction="in"/>
<parameter name="EMail" datatype="string" direction="in"/>
<parameter name="Password" datatype="string" direction="in"/>
<parameter name="HomeTel" datatype="string" direction="in"/>
<parameter name="CustomerType" datatype="short" direction="in"/>
<parameter name="Status" datatype="short" direction="in"/>
<parameter name="GuestPostcode" datatype="string" direction="in"/>
<parameter name="LoyaltyPoints" datatype="float" direction="in"/>
<parameter name="LoginID" datatype="string" direction="in"/>
<parameter name="LastAddressID" datatype="integer" direction="in"/>
<parameter name="IsAdmin" datatype="boolean" direction="in"/>
<parameter name="CCNo" datatype="string" direction="in"/>
<parameter name="CCName" datatype="string" direction="in"/>
<parameter name="CCFromDate" datatype="date" direction="in"/>
<parameter name="CCExpDate" datatype="date" direction="in"/>
<parameter name="CCIssueNo" datatype="String" direction="in"/>
<parameter name="CCSave" datatype="boolean" direction="in"/>
<parameter name="RecieveInfoIceland" datatype="boolean" direction="in"/>
<parameter name="RecieveInfoOther" datatype="boolean" direction="in"/>
<parameter name="UpdateFlag" datatype="boolean" direction="in"/>
<parameter name="Source" datatype="string" direction="in"/>
</update>
<delete name="DELETE FROM Customer WHERE CustomerID = @CustomerID" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
</delete>
</query>
<query id="Customers" default="false">
<select name="SELECT
CustomerID,
SessionGuid,
LastLogin,
CreationDate,
Title,
Surname,
Forename,
EMail,
Password,
HomeTel,
CustomerType,
Status,
GuestPostcode,
LoyaltyPoints,
LoginID,
LastAddressID,
IsAdmin,
CCNo,
CCName,
CCFromDate,
CCExpDate,
CCIssueNo,
CCSave,
RecieveInfoIceland,
RecieveInfoOther,
UpdateFlag,
Source
FROM Customer
" connection="Grocery" type="replace" use="raw">
</select>
</query>
</datasource>
<properties>
<property name="CustomerID" alias="CustomerID" datatype="integer" nullable="false" pkey="true" identity="true"/>
<property name="SessionGuid" alias="SessionGuid" datatype="guid" nullable="false"/>
<property name="LastLogin" alias="LastLogin" datatype="date" nullable="false"/>
<property name="CreationDate" alias="CreationDate" datatype="date" nullable="true"/>
<property name="Title" alias="Title" datatype="string" nullable="false"/>
<property name="Surname" alias="Surname" datatype="string" nullable="false"/>
<property name="Forename" alias="Forename" datatype="string" nullable="false"/>
<property name="EMail" alias="EMail" datatype="string" nullable="true"/>
<property name="Password" alias="Password" datatype="string" nullable="true"/>
<property name="HomeTel" alias="HomeTel" datatype="string" nullable="true"/>
<property name="CustomerType" alias="CustomerType" datatype="short" nullable="true"/>
<property name="Status" alias="Status" datatype="short" nullable="true"/>
<property name="GuestPostcode" alias="GuestPostcode" datatype="string" nullable="true"/>
<property name="LoyaltyPoints" alias="LoyaltyPoints" datatype="float" nullable="true"/>
<property name="LoginID" alias="LoginID" datatype="string" nullable="true"/>
<property name="LastAddressID" alias="LastAddressID" datatype="integer" nullable="true"/>
<property name="IsAdmin" alias="IsAdmin" datatype="boolean" nullable="true"/>
<property name="CCNo" alias="CCNo" datatype="string" nullable="true"/>
<property name="CCName" alias="CCName" datatype="string" nullable="true"/>
<property name="CCFromDate" alias="CCFromDate" datatype="date" nullable="true"/>
<property name="CCExpDate" alias="CCExpDate" datatype="date" nullable="true"/>
<property name="CCIssueNo" alias="CCIssueNo" datatype="string" nullable="true"/>
<property name="CCSave" alias="CCSave" datatype="boolean" nullable="true"/>
<property name="RecieveInfoIceland" alias="RecieveInfoIceland" datatype="boolean" nullable="true"/>
<property name="RecieveInfoOther" alias="RecieveInfoOther" datatype="boolean" nullable="true"/>
<property name="UpdateFlag" alias="UpdateFlag" datatype="boolean" nullable="true"/>
<property name="Source" alias="Source" datatype="string" nullable="true"/>
<property name="IntroductionDate" alias="IntroductionDate" datatype="date" nullable="true"/>
</properties>
<relationships>
<relationship name="Customers" object="Customer" keyprop="down" collection="true" query="Customers"/>
<relationship name="Addresses" object="Address" keyprop="down" collection="true" query="CustomerAddresses">
<key pkey="CustomerID" fkey="CustomerID" from="parent" to="child"/>
</relationship>
<relationship name="Orders" object="Order" keyprop="down" collection="true" query="CustomerOrders">
<key pkey="CustomerID" fkey="CustomerID" from="parent" to="child"/>
</relationship>
<relationship name="CurrentOrder" object="Order" keyprop="down" collection="false" query="CustomerCurrentOrder">
<key pkey="CustomerID" fkey="CustomerID" from="parent" to="child"/>
</relationship>
<relationship name="CustomerByEMail" object="Customer" keyprop="down" collection="false" query="CustomerByEMail">
<key pkey="EMail" fkey="EMail" from="parent" to="child"/>
</relationship>
<relationship name="CustomerByLoginID" object="Customer" keyprop="down" collection="false" query="CustomerByLoginID">
<key pkey="LoginID" fkey="LoginID" from="parent" to="child"/>
</relationship>
<relationship name="CustomerByGuid" object="Customer" keyprop="none" collection="false" query="CustomerByGuid">
<key pkey="SessionGuid" fkey="SessionGuid" from="parent" to="child"/>
</relationship>
<relationship name="Favourites" object="Favourite" keyprop="none" collection="true" query="CustomerFavourites">
<key pkey="CustomerID" fkey="CustomerID" from="parent" to="child"/>
</relationship>
<relationship name="FavouriteProducts" object="Favourite" keyprop="down" collection="true" query="CustomerFavouriteProducts">
<key pkey="CustomerID" fkey="CustomerID" from="parent" to="child"/>
<key pkey="StoreID" fkey="StoreID" from="parent" to="child"/>
<key pkey="IntroductionDate" fkey="IntroductionDate" from="parent" to="child"/>
</relationship>
<relationship name="CouponsBasket" object="Promo" keyprop="down" collection="true" query="CustomerBasketCoupons">
<key pkey="CustomerID" fkey="CustomerID" from="parent" to="child"/>
</relationship>
<relationship name="CouponsProduct" object="Promo" keyprop="down" collection="true" query="CustomerProductCoupons">
<key pkey="CustomerID" fkey="CustomerID" from="parent" to="child"/>
</relationship>
<relationship name="Coupons" object="Promo" keyprop="down" collection="true" query="CustomerAllCoupons">
<key pkey="CustomerID" fkey="CustomerID" from="parent" to="child"/>
<key pkey="IntroductionDate" fkey="IntroductionDate" from="parent" to="child"/>
</relationship>
<relationship name="ProductCoupons" object="Promo" keyprop="down" collection="true" query="CustomerStoreProductCoupons">
<key pkey="CustomerID" fkey="CustomerID" from="parent" to="child"/>
<key pkey="StoreID" fkey="CustomerID" from="parent" to="child"/>
<key pkey="IntroductionDate" fkey="IntroductionDate" from="parent" to="child"/>
</relationship>
<relationship name="Lists" object="List" keyprop="down" collection="true" query="CustomerLists">
<key pkey="CustomerID" fkey="CustomerID" from="parent" to="child"/>
<key pkey="StoreID" fkey="StoreID" from="parent" to="child"/>
</relationship>
<relationship name="UsedOneTimePromo" object="UsedOneTimePromo" keyprop="none" collection="false" query="UsedOneTimePromo">
<key pkey="CustomerID" fkey="CustomerID" from="parent" to="child"/>
<key pkey="PromoID" fkey="PromoID" from="parent" to="child"/>
</relationship>
<relationship name="Questionnaires" object="Questionnaire" keyprop="none" collection="true" query="CustomerQuestionnaire">
<key pkey="CustomerID" fkey="CustomerID" from="parent" to="child"/>
</relationship>
</relationships>
<methods>
<method name="Login" returntype="boolean" uuid="IcelandGrocery.Customer" implname="Login">
<parameter name="LoginID" datatype="string" direction="in"/>
<parameter name="Password" datatype="string" direction="in"/>
<parameter name="IsAdmin" datatype="boolean" direction="in"/>
<parameter name="IsCaseSensitive" datatype="boolean" direction="in"/>
</method>
<method name="Basket" returntype="UPRObject" uuid="IcelandGrocery.Customer" implname="ReturnBasket">
<parameter name="StoreID" datatype="integer" direction="out"/>
</method>
<method name="LocateStore" returntype="Integer" uuid="IcelandGrocery.Customer" implname="LocateStore">
<parameter name="Postcode" datatype="string" direction="in"/>
</method>
<method name="LocateZone" returntype="Integer" uuid="IcelandGrocery.Customer" implname="LocateZone">
<parameter name="Postcode" datatype="string" direction="in"/>
</method>
<method name="GuestLogin" returntype="Integer" uuid="IcelandGrocery.Customer" implname="GuestLogin">
<parameter name="Postcode" datatype="string" direction="in"/>
</method>
<method name="MakeNewSessionGuid" returntype="string" uuid="IcelandGrocery.Customer" implname="MakeNewSessionGuid"/>
</methods>
</object>
<object name="Delivery">
<datasource>
<query id="Deliveries" default="false">
<select name="SELECT DeliveryID, StartDate, EndDate, Cost, SlotCount, ZoneID, CutoffDate
FROM Delivery
WHERE ZoneID = @ZoneID AND CutoffDate >= GetDate() AND SlotCount > 0 AND StartDate > @startDate AND StartDate< @endDate
ORDER BY startDate
" connection="Grocery" type="replace" use="raw">
<parameter name="ZoneID" datatype="integer" direction="in"/>
<parameter name="StartDate" datatype="date" direction="in"/>
<parameter name="EndDate" datatype="date" direction="in"/>
</select>
</query>
<query id="Delivery" default="true">
<select name="SELECT DeliveryID, StartDate, EndDate, Cost, SlotCount, ZoneID, CutoffDate
FROM Delivery
WHERE DeliveryID = @DeliveryID
" connection="Grocery" type="replace" use="raw">
<parameter name="DeliveryID" datatype="integer" direction="in"/>
</select>
<update name="UPDATE Delivery
SET SlotCount=@SlotCount
WHERE DeliveryID = @DeliveryID
" connection="Grocery" type="replace" use="raw">
<parameter name="DeliveryID" datatype="integer" direction="in"/>
<parameter name="SlotCount" datatype="short" direction="in"/>
</update>
<delete name="DeleteDelivery" connection="Grocery" type="proc" use="raw">
<parameter name="DeliveryID" datatype="integer" direction="in"/>
</delete>
</query>
<query id="OrderDelivery" default="false">
<select name="SELECT
Delivery.DeliveryID,
Delivery.StartDate,
Delivery.EndDate,
Delivery.Cost,
Delivery.SlotCount,
Delivery.ZoneID,
Delivery.CutoffDate
FROM Delivery
INNER JOIN
Orders
ON Delivery.DeliveryID = Orders.DeliveryID
WHERE
Orders.OrderID=@OrderID
" connection="Grocery" type="replace" use="raw">
<parameter name="OrderID" datatype="integer" direction="in"/>
</select>
</query>
</datasource>
<properties>
<property name="DeliveryID" alias="DeliveryID" datatype="integer" nullable="false" pkey="true" identity="true"/>
<property name="ZoneID" alias="ZoneID" datatype="integer" nullable="true"/>
<property name="StartDate" alias="StartDate" datatype="date" nullable="true"/>
<property name="EndDate" alias="EndDate" datatype="date" nullable="true"/>
<property name="Cost" alias="Cost" datatype="money" nullable="true"/>
<property name="SlotCount" alias="SlotCount" datatype="short" nullable="true"/>
<property name="CutoffDate" alias="CutoffDate" datatype="date" nullable="true"/>
</properties>
<relationships/>
</object>
<object name="Favourite">
<datasource>
<query id="CustomerFavourites" default="false">
<select name="SELECT
CustomerID,
ProductID,
NumberOfOrders,
TotalQtyBought,
LastPurchaseDate,
IsVisible
FROM Favourite
WHERE Favourite.CustomerID = @CustomerID
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
</select>
<insert name="INSERT INTO Favourite(CustomerID, ProductID,TotalQtyBought, NumberOfOrders, LastPurchaseDate, FirstPurchaseDate, IsVisible)
VALUES(@CustomerID, @ProductID, @TotalQtyBought, @NumberOfOrders, @LastPurchaseDate, @FirstPurchaseDate, @IsVisible)
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="ProductID" datatype="integer" direction="in"/>
<parameter name="TotalQtyBought" datatype="float" direction="in"/>
<parameter name="NumberOfOrders" datatype="integer" direction="in"/>
<parameter name="LastPurchaseDate" datatype="date" direction="in"/>
<parameter name="FirstPurchaseDate" datatype="date" direction="in"/>
<parameter name="IsVisible" datatype="boolean" direction="in"/>
</insert>
<update name="UPDATE Favourite
SET IsVisible = @IsVisible,
TotalQtyBought = @TotalQtyBought,
NumberOfOrders = @NumberOfOrders,
LastPurchaseDate = @LastPurchaseDate
WHERE CustomerID = @CustomerID AND ProductID = @ProductID
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="ProductID" datatype="integer" direction="in"/>
<parameter name="TotalQtyBought" datatype="float" direction="in"/>
<parameter name="NumberOfOrders" datatype="integer" direction="in"/>
<parameter name="LastPurchaseDate" datatype="date" direction="in"/>
<parameter name="IsVisible" datatype="boolean" direction="in"/>
</update>
</query>
<query id="CustomerFavouriteProducts" default="false">
<select name="SELECT DISTINCT
Favourite.ProductID,
Favourite.CustomerID,
Favourite.NumberOfOrders,
Favourite.LastPurchaseDate,
Favourite.FirstPurchaseDate,
Favourite.IsVisible,
Product.Name,
Product.Description,
Product.PackSize,
Product.UnitSize,
Product.UnitID,
Product.HasLabelData,
ProductInStore.IsCaseDealParent,
ProductInStore.CaseDealImageID,
Product.CaseDealParentID,
ProductInStore.ComparativeSizeInfo,
ProductInStore.AddedVal,
ProductInStore.Saving,
ProductInStore.IsNew,
ProductInStore.Price,
ProductInStore.StoreID AS IsAvailable,
ProductInStore.IntroductionDate,
ProductOptionValue.ProductID AS HasOptions
FROM Favourite
INNER JOIN Product
ON Product.ProductID = Favourite.ProductID
LEFT JOIN ProductInStore
ON ProductInStore.ProductID = Product.ProductID
LEFT JOIN ProductOptionValue
ON ProductOptionValue.ProductID = Product.ProductID
WHERE Favourite.CustomerID = @CustomerID
AND @IntroductionDate != NULL
AND ProductInStore.StoreID = @StoreID
AND ProductInStore.IntroductionDate <= @IntroductionDate
ORDER BY Favourite.ProductID ASC,
ProductInStore.IntroductionDate DESC
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="IntroductionDate" datatype="Date" direction="in"/>
</select>
</query>
<query id="CustomerFavourite" default="true">
<select name="SELECT
CustomerID,
ProductID,
NumberOfOrders,
TotalQtyBought,
LastPurchaseDate,
FirstPurchaseDate,
IsVisible
FROM Favourite
WHERE Favourite.CustomerID = @CustomerID
AND Favourite.ProductID = @ProductID
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="ProductID" datatype="integer" direction="in"/>
</select>
<insert name="INSERT INTO Favourite(CustomerID, ProductID,TotalQtyBought, NumberOfOrders, LastPurchaseDate, FirstPurchaseDate, IsVisible)
VALUES(@CustomerID, @ProductID, @TotalQtyBought, @NumberOfOrders, @LastPurchaseDate, @FirstPurchaseDate, @IsVisible)
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="ProductID" datatype="integer" direction="in"/>
<parameter name="TotalQtyBought" datatype="float" direction="in"/>
<parameter name="NumberOfOrders" datatype="integer" direction="in"/>
<parameter name="LastPurchaseDate" datatype="date" direction="in"/>
<parameter name="FirstPurchaseDate" datatype="date" direction="in"/>
<parameter name="IsVisible" datatype="boolean" direction="in"/>
</insert>
<update name="UPDATE Favourite
SET IsVisible = @IsVisible,
TotalQtyBought = @TotalQtyBought,
NumberOfOrders = @NumberOfOrders,
LastPurchaseDate = @LastPurchaseDate
WHERE CustomerID = @CustomerID AND ProductID = @ProductID
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="ProductID" datatype="integer" direction="in"/>
<parameter name="TotalQtyBought" datatype="float" direction="in"/>
<parameter name="NumberOfOrders" datatype="integer" direction="in"/>
<parameter name="LastPurchaseDate" datatype="date" direction="in"/>
<parameter name="IsVisible" datatype="boolean" direction="in"/>
</update>
<delete name="DELETE FROM
Favourite
WHERE
CustomerID = @CustomerID
AND ProductID = @ProductID
" type="replace" use="raw" connection="Grocery">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="ProductID" datatype="integer" direction="in"/>
</delete>
</query>
</datasource>
<properties>
<property name="CustomerID" alias="CustomerID" datatype="integer" nullable="false" pkey="true"/>
<property name="TotalQtyBought" alias="TotalQtyBought" datatype="float" nullable="true"/>
<property name="NumberOfOrders" alias="NumberOfOrders" datatype="integer" nullable="true"/>
<property name="LastPurchaseDate" alias="LastPurchaseDate" datatype="date" nullable="true"/>
<property name="FirstPurchaseDate" alias="FirstPurchaseDate" datatype="date" nullable="true"/>
<property name="IsVisible" alias="IsVisible" datatype="integer" nullable="true"/>
<property name="Quantity" alias="Quantity" datatype="float" nullable="false"/>
<property name="ItemNo" alias="ItemNo" datatype="short" nullable="true"/>
<property name="Note" alias="Note" datatype="string" nullable="true"/>
<property name="ItemUnitID" alias="BasketUnitID" datatype="integer" nullable="false"/>
<property name="ProductID" alias="ProductID" datatype="integer" nullable="false"/>
<property name="Name" alias="Name" datatype="string" nullable="true"/>
<property name="Description" alias="Description" datatype="string" nullable="true"/>
<property name="PackSize" alias="PackSize" datatype="short" nullable="true"/>
<property name="UnitSize" alias="UnitSize" datatype="float" nullable="true"/>
<property name="UnitID" alias="UnitID" datatype="integer" nullable="false"/>
<property name="ComparativeSizeInfo" alias="ComparativeSizeInfo" datatype="String" nullable="true"/>
<property name="AddedVal" alias="AddedVal" datatype="string" nullable="true"/>
<property name="Saving" alias="Saving" datatype="money" nullable="true"/>
<property name="IsNew" alias="IsNew" datatype="boolean" nullable="true"/>
<property name="HasLabelData" alias="HasLabelData" datatype="boolean" nullable="false"/>
<property name="Price" alias="Price" datatype="money" nullable="true"/>
<property name="ItemCost" alias="ItemCost" datatype="money" nullable="true"/>
<property name="IsAvailable" alias="IsAvailable" datatype="integer" nullable="true"/>
<property name="IntroductionDate" alias="IntroductionDate" datatype="Date" nullable="false"/>
<property name="HasOptions" alias="HasOptions" datatype="integer" nullable="true"/>
<property name="IsCaseDealParent" alias="IsCaseDealParent" datatype="boolean" nullable="false"/>
<property name="CaseDealParentID" alias="CaseDealParentID" datatype="integer" nullable="true"/>
<property name="CaseDealImageID" alias="CaseDealImageID" datatype="string" nullable="true"/>
<property name="CategoryRank" alias="CategoryRank" datatype="integer" nullable="true"/>
</properties>
<relationships>
<relationship name="Categories" object="Category" keyprop="none" collection="true" query="ProductCategories">
<key pkey="IsAvailable" fkey="StoreID" from="parent" to="child"/>
<key pkey="ProductID" fkey="ProductID" from="parent" to="child"/>
</relationship>
<relationship name="CaseDealProducts" object="Product" keyprop="none" collection="true" query="StoreProductCaseDealProducts">
<key pkey="IsAvailable" fkey="StoreID" from="parent" to="child"/>
<key pkey="ProductID" fkey="CaseDealParentID" from="parent" to="child"/>
<key pkey="IntroductionDate" fkey="IntroductionDate" from="parent" to="child"/>
</relationship>
</relationships>
</object>
<object name="LabelData">
<datasource>
<query id="ProductLabelData" default="true">
<select name="SELECT
AttributeMap.AttributeMapID AS MapID,
AttributeMap.AttributeMapName AS MapName,
AttributeGroup.Name AS AttributeGroupName,
Attribute.AttributeID,
Attribute.Name AS AttributeName,
ProductAttributeValue.AttributeValue,
ProductAttributeValue.PartName,
ProductAttributeValue.ColumnNumber,
ProductAttributeValue.OrderNumber
FROM
AttributeMap
INNER JOIN AttributeGroup
ON AttributeGroup.AttributeMapID = AttributeMap.AttributeMapID
INNER JOIN Attribute
ON AttributeGroup.AttributeGroupID = Attribute.AttributeGroupID
INNER JOIN ProductAttributeValue
ON Attribute.AttributeID = ProductAttributeValue.AttributeID
WHERE
ProductAttributeValue.ProductID=@ProductID
ORDER BY MapID, AttributeGroupName,
ProductAttributeValue.OrderNumber
" type="replace" use="raw" connection="Grocery">
<parameter name="ProductID" datatype="integer" direction="in"/>
</select>
</query>
</datasource>
<properties>
<property name="MapName" alias="MapName" datatype="string"/>
<property name="MapID" alias="MapID" datatype="integer"/>
<property name="AttributeGroupName" alias="AttributeGroupName" datatype="string"/>
<property name="AttributeID" alias="AttributeID" datatype="integer"/>
<property name="AttributeName" alias="AttributeName" datatype="string"/>
<property name="PartName" alias="PartName" datatype="string"/>
<property name="AttributeValue" alias="AttributeValue" datatype="string"/>
<property name="ColumnNumber" alias="ColumnNumber" datatype="integer"/>
</properties>
</object>
<object name="List">
<datasource>
<query id="CustomerLists" default="false">
<select name="SELECT
ListID,
CustomerID,
Name,
@StoreID AS StoreID
FROM List
WHERE CustomerID = @CustomerID
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="StoreID" datatype="integer" direction="in"/>
</select>
</query>
<query id="CustomerList" default="true">
<select name="SELECT ListID,
CustomerID,
Name,
@StoreID AS StoreID
FROM List
WHERE ListID = @ListID
" connection="Grocery" type="replace" use="raw">
<parameter name="ListID" datatype="integer" direction="in"/>
<parameter name="StoreID" datatype="integer" direction="in"/>
</select>
<insert name="INSERT INTO List(CustomerID, Name)
VALUES(@CustomerID, @Name)
SELECT @@IDENTITY AS ListID
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="Name" datatype="string" direction="in"/>
</insert>
<update name="UPDATE List SET Name = @Name
WHERE ListID = @ListID" connection="Grocery" type="replace" use="raw">
<parameter name="ListID" datatype="integer" direction="in"/>
<parameter name="Name" datatype="string" direction="in"/>
</update>
<delete name="DELETE FROM List WHERE ListID = @ListID
" connection="Grocery" type="replace" use="raw">
<parameter name="ListID" datatype="integer" direction="in"/>
</delete>
</query>
</datasource>
<properties>
<property name="ListID" alias="ListID" datatype="integer" nullable="false" pkey="true" identity="true"/>
<property name="CustomerID" alias="CustomerID" datatype="integer" nullable="false"/>
<property name="Name" alias="Name" datatype="string" nullable="true"/>
<property name="StoreID" alias="StoreID" datatype="string" nullable="true"/>
<property name="IntroductionDate" alias="IntroductionDate" datatype="Date" nullable="true"/>
</properties>
<relationships>
<relationship name="Items" object="ListItem" keyprop="down" collection="true" query="CustomerListItems">
<key pkey="ListID" fkey="ListID" from="parent" to="child"/>
<key pkey="StoreID" fkey="StoreID" from="parent" to="child"/>
<key pkey="IntroductionDate" fkey="IntroductionDate" from="parent" to="child"/>
</relationship>
</relationships>
</object>
<object name="ListItem">
<datasource>
<query id="CustomerListItems" default="false">
<select name="SELECT DISTINCT
ListItem.ListItemID,
ListItem.ListID,
ListItem.Quantity,
ListItem.ItemNo,
ListItem.Note,
ListItem.UnitID AS ListUnitID,
Product.ProductID,
Product.Name,
Product.Description,
Product.PackSize,
Product.UnitSize,
Product.UnitID,
Product.HasLabelData,
ProductInStore.IsCaseDealParent,
ProductInStore.CaseDealImageID,
Product.CaseDealParentID,
ProductInStore.ComparativeSizeInfo,
ProductInStore.AddedVal,
ProductInStore.Saving,
ProductInStore.IsNew,
ProductInStore.Price,
ProductInStore.StoreID AS IsAvailable,
ProductInStore.IntroductionDate,
ProductOptionValue.ProductID AS HasOptions
FROM ListItem
INNER JOIN Product
ON ListItem.ProductID = Product.ProductID
LEFT JOIN ProductInStore
ON Product.ProductID = ProductInStore.ProductID
LEFT JOIN ProductOptionValue
ON ProductOptionValue.ProductID = Product.ProductID
WHERE ListItem.ListID = @ListID
AND @IntroductionDate != NULL
AND ProductInStore.StoreID = @StoreID
AND ProductInStore.IntroductionDate <= @IntroductionDate
ORDER BY ListItem.ItemNo DESC,
ProductInStore.IntroductionDate DESC
" connection="Grocery" type="replace" use="raw">
<parameter name="ListID" datatype="integer" direction="in"/>
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="IntroductionDate" datatype="Date" direction="in"/>
</select>
<insert name="
INSERT INTO ListItem(ListID, ProductID, Quantity, UnitID, ItemNo, Note)
VALUES(@ListID, @ProductID, @Quantity, @UnitID, @ItemNo, @Note)
SELECT @@IDENTITY AS ListItemID
" connection="Grocery" type="replace" use="raw">
<parameter name="ListID" datatype="integer" direction="in"/>
<parameter name="ProductID" datatype="integer" direction="in"/>
<parameter name="Quantity" datatype="float" direction="in"/>
<parameter name="UnitID" datatype="integer" direction="in"/>
<parameter name="ItemNo" datatype="short" direction="in"/>
<parameter name="Note" datatype="string" direction="in"/>
</insert>
<update name="UPDATE ListItem
SET ProductID = @ProductID,
Quantity = @Quantity,
UnitID = @UnitID,
Note = @Note
WHERE ListID = @ListID AND ItemNo = @ItemNo
" connection="Grocery" type="replace" use="raw">
<parameter name="ListID" datatype="integer" direction="in"/>
<parameter name="ProductID" datatype="integer" direction="in"/>
<parameter name="Quantity" datatype="float" direction="in"/>
<parameter name="UnitID" datatype="integer" direction="in"/>
<parameter name="ItemNo" datatype="short" direction="in"/>
<parameter name="Note" datatype="string" direction="in"/>
</update>
<delete name="DELETE FROM ListItem WHERE ListID = @ListID AND ItemNo = @ItemNo" connection="Grocery" type="replace" use="raw">
<parameter name="ListID" datatype="integer" direction="in"/>
<parameter name="ItemNo" datatype="short" direction="in"/>
</delete>
</query>
<query id="CustomerListItem" default="true">
<select name="SELECT DISTINCT
ListItem.ListItemID,
ListItem.ListID,
ListItem.Quantity,
ListItem.ItemNo,
ListItem.Note,
ListItem.UnitID AS ListUnitID,
Product.ProductID,
Product.Name,
Product.Description,
Product.PackSize,
Product.UnitSize,
Product.UnitID,
Product.HasLabelData,
ProductInStore.IsCaseDealParent,
ProductInStore.CaseDealImageID,
Product.CaseDealParentID,
ProductInStore.ComparativeSizeInfo,
ProductInStore.AddedVal,
ProductInStore.Saving,
ProductInStore.IsNew,
ProductInStore.Price,
ProductInStore.StoreID AS IsAvailable,
ProductInStore.IntroductionDate,
ProductOptionValue.ProductID AS HasOptions
FROM ListItem
INNER JOIN Product
ON ListItem.ProductID = Product.ProductID
LEFT JOIN ProductInStore
ON Product.ProductID = ProductInStore.ProductID
LEFT JOIN ProductOptionValue
ON ProductOptionValue.ProductID = Product.ProductID
WHERE
ListItem.ListID = @ListID
AND ListItem.ItemNo = @ItemNo
AND @IntroductionDate != NULL
AND ProductInStore.StoreID = @StoreID
AND ProductInStore.IntroductionDate <= @IntroductionDate
ORDER BY ProductInStore.IntroductionDate DESC" connection="Grocery" type="replace" use="raw">
<parameter name="ListID" datatype="integer" direction="in"/>
<parameter name="ItemNo" datatype="short" direction="in"/>
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="IntroductionDate" datatype="Date" direction="in"/>
</select>
<delete name="DELETE FROM ListItem WHERE ListID = @ListID AND ItemNo = @ItemNo" connection="Grocery" type="replace" use="raw">
<parameter name="ListID" datatype="integer" direction="in"/>
<parameter name="ItemNo" datatype="short" direction="in"/>
</delete>
<insert name="INSERT INTO ListItem(ListID, ProductID, Quantity, UnitID, ItemNo, Note)
VALUES(@ListID, @ProductID, @Quantity, @UnitID, @ItemNo, @Note)
SELECT @@IDENTITY AS ListItemID
" connection="Grocery" type="replace" use="raw">
<parameter name="ListID" datatype="integer" direction="in"/>
<parameter name="ProductID" datatype="integer" direction="in"/>
<parameter name="Quantity" datatype="float" direction="in"/>
<parameter name="UnitID" datatype="integer" direction="in"/>
<parameter name="ItemNo" datatype="short" direction="in"/>
<parameter name="Note" datatype="string" direction="in"/>
</insert>
<update name="UPDATE ListItem
SET ProductID = @ProductID,
Quantity = @Quantity,
UnitID = @UnitID,
Note = @Note
WHERE ListID = @ListID AND ItemNo = @ItemNo" connection="Grocery" type="replace" use="raw">
<parameter name="ListID" datatype="integer" direction="in"/>
<parameter name="ProductID" datatype="integer" direction="in"/>
<parameter name="Quantity" datatype="float" direction="in"/>
<parameter name="UnitID" datatype="integer" direction="in"/>
<parameter name="ItemNo" datatype="short" direction="in"/>
<parameter name="Note" datatype="string" direction="in"/>
</update>
</query>
</datasource>
<properties>
<property name="ItemID" alias="ListItemID" datatype="integer" nullable="false" pkey="true" identity="true"/>
<property name="ListID" alias="ListID" datatype="integer" nullable="true"/>
<property name="Quantity" alias="Quantity" datatype="float" nullable="false"/>
<property name="ItemNo" alias="ItemNo" datatype="short" nullable="true"/>
<property name="Note" alias="Note" datatype="string" nullable="true"/>
<property name="ItemUnitID" alias="ListUnitID" datatype="integer" nullable="false"/>
<property name="ProductID" alias="ProductID" datatype="integer" nullable="false"/>
<property name="Name" alias="Name" datatype="string" nullable="true"/>
<property name="Description" alias="Description" datatype="string" nullable="true"/>
<property name="PackSize" alias="PackSize" datatype="short" nullable="true"/>
<property name="UnitSize" alias="UnitSize" datatype="float" nullable="true"/>
<property name="UnitID" alias="UnitID" datatype="integer" nullable="false"/>
<property name="ComparativeSizeInfo" alias="ComparativeSizeInfo" datatype="String" nullable="true"/>
<property name="AddedVal" alias="AddedVal" datatype="String" nullable="true"/>
<property name="Saving" alias="Saving" datatype="money" nullable="true"/>
<property name="IsNew" alias="IsNew" datatype="boolean" nullable="true"/>
<property name="HasLabelData" alias="HasLabelData" datatype="boolean" nullable="false"/>
<property name="Price" alias="Price" datatype="money" nullable="true"/>
<property name="ItemCost" alias="ItemCost" datatype="money" nullable="true"/>
<property name="IsAvailable" alias="IsAvailable" datatype="integer" nullable="true"/>
<property name="IntroductionDate" alias="IntroductionDate" datatype="Date" nullable="false"/>
<property name="HasOptions" alias="HasOptions" datatype="integer" nullable="true"/>
<property name="IsCaseDealParent" alias="IsCaseDealParent" datatype="boolean" nullable="false"/>
<property name="CaseDealParentID" alias="CaseDealParentID" datatype="integer" nullable="true"/>
<property name="CaseDealImageID" alias="CaseDealImageID" datatype="string" nullable="true"/>
<property name="CategoryRank" alias="CategoryRank" datatype="integer" nullable="true"/>
</properties>
<relationships>
<relationship name="OptionValues" object="ListItemOptionValue" keyprop="down" collection="true" query="ListItemOptionValues">
<key pkey="ItemID" fkey="ListItemID" from="parent" to="child"/>
</relationship>
<relationship name="Categories" object="Category" keyprop="none" collection="true" query="ProductCategories">
<key pkey="IsAvailable" fkey="StoreID" from="parent" to="child"/>
<key pkey="ProductID" fkey="ProductID" from="parent" to="child"/>
</relationship>
<relationship name="CaseDealProducts" object="Product" keyprop="none" collection="true" query="StoreProductCaseDealProducts">
<key pkey="IsAvailable" fkey="StoreID" from="parent" to="child"/>
<key pkey="ProductID" fkey="CaseDealParentID" from="parent" to="child"/>
<key pkey="IntroductionDate" fkey="IntroductionDate" from="parent" to="child"/>
</relationship>
</relationships>
</object>
<object name="ListItemOptionValue">
<datasource>
<query id="ListItemOptionValues" default="true">
<select name="SELECT ListItemID, ProductOptionID, OptionValue
FROM ListItemOptionValue
WHERE ListItemID = @ListItemID
" connection="Grocery" type="replace" use="raw">
<parameter name="ListItemID" datatype="integer" direction="in"/>
</select>
<insert name="INSERT INTO ListItemOptionValue(ListItemID, ProductOptionID, OptionValue)
VALUES(@ListItemID, @ProductOptionID, @OptionValue)
" connection="Grocery" type="replace" use="raw">
<parameter name="ListItemID" datatype="integer" direction="in"/>
<parameter name="ProductOptionID" datatype="integer" direction="in"/>
<parameter name="OptionValue" datatype="string" direction="in"/>
</insert>
<update name="UPDATE ListItemOptionValue
SET OptionValue = @OptionValue
WHERE ListItemID = @ListItemID AND ProductOptionID = @ProductOptionID
" connection="Grocery" type="replace" use="raw">
<parameter name="ListItemID" datatype="integer" direction="in"/>
<parameter name="ProductOptionID" datatype="integer" direction="in"/>
<parameter name="OptionValue" datatype="string" direction="in"/>
</update>
<delete name="DELETE FROM ListItemOptionValue
WHERE ListItemID = @ListItemID
" connection="Grocery" type="replace" use="raw">
<parameter name="ListItemID" datatype="integer" direction="in"/>
</delete>
</query>
<query id="ListItemOptionValue" default="false">
<select name="SELECT ListItemID, ProductOptionID, OptionValue
FROM ListItemOptionValue
WHERE ListItemID = @ListItemID AND ProductOptionID = @ProductOptionID
" connection="Grocery" type="replace" use="raw">
<parameter name="ListItemID" datatype="integer" direction="in"/>
<parameter name="ProductOptionID" datatype="integer" direction="in"/>
</select>
<insert name="INSERT INTO ListItemOptionValue(ListItemID, ProductOptionID, OptionValue)
VALUES(@ListItemID, @ProductOptionID, @OptionValue)" connection="Grocery" type="replace" use="raw">
<parameter name="ListItemID" datatype="integer" direction="in"/>
<parameter name="ProductOptionID" datatype="integer" direction="in"/>
<parameter name="OptionValue" datatype="string" direction="in"/>
</insert>
<update name="UPDATE ListItemOptionValue
SET OptionValue = @OptionValue
WHERE ListItemID = @ListItemID AND ProductOptionID = @ProductOptionID
" connection="Grocery" type="replace" use="raw">
<parameter name="ListItemID" datatype="integer" direction="in"/>
<parameter name="ProductOptionID" datatype="integer" direction="in"/>
<parameter name="OptionValue" datatype="string" direction="in"/>
</update>
<delete name="DELETE FROM ListItemOptionValue
WHERE ListItemID = @ListItemID AND ProductOptionID = @ProductOptionID
" connection="Grocery" type="replace" use="raw">
<parameter name="ListItemID" datatype="integer" direction="in"/>
<parameter name="OptionID" datatype="integer" direction="in"/>
</delete>
</query>
</datasource>
<properties>
<property name="ListItemID" alias="ListItemID" datatype="integer" nullable="false" pkey="true" identity="false"/>
<property name="ProductOptionID" alias="ProductOptionID" datatype="integer" nullable="false" pkey="true" identity="false"/>
<property name="OptionValue" alias="OptionValue" datatype="string" nullable="false"/>
</properties>
<relationships/>
</object>
<object name="OrderItem">
<datasource>
<query id="OrderItems" default="false">
<select name="SELECT DISTINCT
OrderItem.OrderItemID,
OrderItem.OrderID,
OrderItem.Quantity,
OrderItem.ItemNo,
OrderItem.Note,
OrderItem.ItemCost,
OrderItem.UnitID AS OrderUnitID,
Product.ProductID,
Product.Name,
Product.Description,
Product.PackSize,
Product.UnitSize,
Product.UnitID,
Product.HasLabelData,
ProductInStore.IsCaseDealParent,
ProductInStore.CaseDealImageID,
Product.CaseDealParentID,
ProductInStore.ComparativeSizeInfo,
ProductInStore.AddedVal,
ProductInStore.Saving,
ProductInStore.IsNew,
ProductInStore.Price,
ProductInStore.StoreID AS IsAvailable,
ProductInStore.IntroductionDate,
ProductOptionValue.ProductID AS HasOptions
FROM OrderItem
INNER JOIN Product
ON Product.ProductID = OrderItem.ProductID
LEFT JOIN ProductInStore
ON Product.ProductID = ProductInStore.ProductID
LEFT JOIN ProductOptionValue
ON ProductOptionValue.ProductID = Product.ProductID
WHERE OrderItem.OrderID = @OrderID
AND @IntroductionDate != NULL
AND ProductInStore.StoreID = @StoreID
AND ProductInStore.IntroductionDate <= @IntroductionDate
ORDER BY OrderItem.ItemNo ASC,
ProductInStore.IntroductionDate DESC
" connection="Grocery" type="replace" use="raw">
<parameter name="OrderID" datatype="integer" direction="in"/>
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="IntroductionDate" datatype="Date" direction="in"/>
</select>
<insert name="INSERT INTO OrderItem(
OrderID,
ProductID,
Quantity,
UnitID,
ItemCost,
ItemNo,
Note,
PromoReduction )
VALUES(
@OrderID,
@ProductID,
@Quantity,
@UnitID,
@ItemCost,
@ItemNo,
@Note,
@PromoReduction )
" connection="Grocery" type="replace" use="raw">
<parameter name="OrderID" datatype="integer" direction="in"/>
<parameter name="ProductID" datatype="integer" direction="in"/>
<parameter name="Quantity" datatype="float" direction="in"/>
<parameter name="UnitID" datatype="integer" direction="in"/>
<parameter name="ItemCost" datatype="money" direction="in"/>
<parameter name="ItemNo" datatype="short" direction="in"/>
<parameter name="Note" datatype="string" direction="in"/>
<parameter name="PromoReduction" datatype="money" direction="in"/>
</insert>
<update name="UPDATE OrderItem
SET OrderID=@OrderID,
ProductID=@ProductID,
Quantity=@Quantity,
UnitID=@UnitID,
ItemCost=@ItemCost,
ItemNo=@ItemNo,
Note=@Note,
PromoReduction = @PromoReduction
WHERE OrderItemID = @OrderItemID
" connection="Grocery" type="replace" use="raw">
<parameter name="OrderID" datatype="integer" direction="in"/>
<parameter name="OrderItemID" datatype="integer" direction="in"/>
<parameter name="ProductID" datatype="integer" direction="in"/>
<parameter name="Quantity" datatype="float" direction="in"/>
<parameter name="UnitID" datatype="integer" direction="in"/>
<parameter name="ItemCost" datatype="money" direction="in"/>
<parameter name="ItemNo" datatype="short" direction="in"/>
<parameter name="Note" datatype="string" direction="in"/>
<parameter name="PromoReduction" datatype="money" direction="in"/>
</update>
<delete name="DELETE FROM OrderItem WHERE OrderItemID = @OrderItemID" connection="Grocery" type="replace" use="raw">
<parameter name="OrderItemID" datatype="integer" direction="in"/>
</delete>
</query>
<query id="OrderItem" default="true">
<select name="SELECT DISTINCT
OrderItem.OrderItemID,
OrderItem.OrderID,
OrderItem.Quantity,
OrderItem.ItemNo,
OrderItem.Note,
OrderItem.UnitID AS OrderUnitID,
OrderItem.ItemCost,
Product.ProductID,
Product.Name,
Product.Description,
Product.PackSize,
Product.UnitSize,
Product.UnitID,
Product.HasLabelData,
ProductInStore.IsCaseDealParent,
ProductInStore.CaseDealImageID,
Product.CaseDealParentID,
ProductInStore.ComparativeSizeInfo,
ProductInStore.AddedVal,
ProductInStore.Saving,
ProductInStore.IsNew,
ProductInStore.Price,
ProductInStore.StoreID AS IsAvailable,
ProductInStore.IntroductionDate,
ProductOptionValue.ProductID AS HasOptions
FROM OrderItem
INNER JOIN Product
ON Product.ProductID = OrderItem.ProductID
LEFT JOIN ProductInStore
ON Product.ProductID = ProductInStore.ProductID
LEFT JOIN ProductOptionValue
ON ProductOptionValue.ProductID = Product.ProductID
WHERE OrderItem.OrderItemID = @OrderItemID
AND @IntroductionDate != NULL
AND ProductInStore.StoreID = @StoreID
AND ProductInStore.IntroductionDate <= @IntroductionDate
ORDER BY OrderItem.ItemNo ASC,
ProductInStore.IntroductionDate DESC" connection="Grocery" type="replace" use="raw">
<parameter name="OrderItemID" datatype="integer" direction="in"/>
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="IntroductionDate" datatype="Date" direction="in"/>
</select>
<insert name="INSERT INTO OrderItem(
OrderID,
ProductID,
Quantity,
UnitID,
ItemCost,
ItemNo,
Note,
PromoReduction )
VALUES(
@OrderID,
@ProductID,
@Quantity,
@UnitID,
@ItemCost,
@ItemNo,
@Note,
@PromoReduction )
" connection="Grocery" type="replace" use="raw">
<parameter name="OrderID" datatype="integer" direction="in"/>
<parameter name="ProductID" datatype="integer" direction="in"/>
<parameter name="Quantity" datatype="float" direction="in"/>
<parameter name="UnitID" datatype="integer" direction="in"/>
<parameter name="ItemCost" datatype="money" direction="in"/>
<parameter name="ItemNo" datatype="short" direction="in"/>
<parameter name="Note" datatype="string" direction="in"/>
<parameter name="PromoReduction" datatype="money" direction="in"/>
</insert>
<update name="UPDATE OrderItem
SET OrderID=@OrderID,
ProductID=@ProductID,
Quantity=@Quantity,
UnitID=@UnitID,
ItemCost=@ItemCost,
ItemNo=@ItemNo,
Note=@Note,
PromoReduction = @PromoReduction
WHERE OrderItemID = @OrderItemID
" connection="Grocery" type="replace" use="raw">
<parameter name="OrderID" datatype="integer" direction="in"/>
<parameter name="OrderItemID" datatype="integer" direction="in"/>
<parameter name="ProductID" datatype="integer" direction="in"/>
<parameter name="Quantity" datatype="float" direction="in"/>
<parameter name="UnitID" datatype="integer" direction="in"/>
<parameter name="ItemCost" datatype="money" direction="in"/>
<parameter name="ItemNo" datatype="short" direction="in"/>
<parameter name="Note" datatype="string" direction="in"/>
<parameter name="PromoReduction" datatype="money" direction="in"/>
</update>
<delete name="DELETE FROM OrderItem WHERE OrderItemID = @OrderItemID" connection="Grocery" type="replace" use="raw">
<parameter name="OrderItemID" datatype="integer" direction="in"/>
</delete>
</query>
</datasource>
<properties>
<property name="ItemID" alias="OrderItemID" datatype="integer" nullable="false" pkey="true" identity="true"/>
<property name="OrderID" alias="OrderID" datatype="integer" nullable="false"/>
<property name="Quantity" alias="Quantity" datatype="float" nullable="false"/>
<property name="ItemNo" alias="ItemNo" datatype="short" nullable="true"/>
<property name="Note" alias="Note" datatype="string" nullable="true"/>
<property name="ItemUnitID" alias="OrderUnitID" datatype="integer" nullable="false"/>
<property name="ProductID" alias="ProductID" datatype="integer" nullable="false"/>
<property name="Name" alias="Name" datatype="string" nullable="true"/>
<property name="Description" alias="Description" datatype="string" nullable="true"/>
<property name="PackSize" alias="PackSize" datatype="short" nullable="true"/>
<property name="UnitSize" alias="UnitSize" datatype="float" nullable="true"/>
<property name="UnitID" alias="UnitID" datatype="integer" nullable="false"/>
<property name="ComparativeSizeInfo" alias="ComparativeSizeInfo" datatype="String" nullable="true"/>
<property name="AddedVal" alias="AddedVal" datatype="string" nullable="true"/>
<property name="Saving" alias="Saving" datatype="money" nullable="true"/>
<property name="IsNew" alias="IsNew" datatype="boolean" nullable="true"/>
<property name="HasLabelData" alias="HasLabelData" datatype="boolean" nullable="false"/>
<property name="Price" alias="Price" datatype="money" nullable="true"/>
<property name="ItemCost" alias="ItemCost" datatype="money" nullable="true"/>
<property name="IsAvailable" alias="IsAvailable" datatype="integer" nullable="true"/>
<property name="IntroductionDate" alias="IntroductionDate" datatype="Date" nullable="false"/>
<property name="HasOptions" alias="HasOptions" datatype="integer" nullable="true"/>
<property name="PromoReduction" alias="PromoReduction" datatype="money" nullable="true"/>
<property name="IsCaseDealParent" alias="IsCaseDealParent" datatype="boolean" nullable="false"/>
<property name="CaseDealParentID" alias="CaseDealParentID" datatype="integer" nullable="true"/>
<property name="CaseDealImageID" alias="CaseDealImageID" datatype="string" nullable="true"/>
<property name="CategoryRank" alias="CategoryRank" datatype="integer" nullable="true"/>
</properties>
<relationships>
<relationship name="OptionValues" object="OrderItemOptionValue" keyprop="down" collection="true" query="OrderItemOptionValues">
<key pkey="ItemID" fkey="OrderItemID" from="parent" to="child"/>
</relationship>
<relationship name="Categories" object="Category" keyprop="none" collection="true" query="ProductCategories">
<key pkey="IsAvailable" fkey="StoreID" from="parent" to="child"/>
<key pkey="ProductID" fkey="ProductID" from="parent" to="child"/>
</relationship>
<relationship name="CaseDealProducts" object="Product" keyprop="none" collection="true" query="StoreProductCaseDealProducts">
<key pkey="IsAvailable" fkey="StoreID" from="parent" to="child"/>
<key pkey="ProductID" fkey="CaseDealParentID" from="parent" to="child"/>
<key pkey="IntroductionDate" fkey="IntroductionDate" from="parent" to="child"/>
</relationship>
</relationships>
</object>
<object name="OrderItemOptionValue">
<datasource>
<query id="OrderItemOptionValues" default="false">
<select name="SELECT OrderItemID, ProductOptionID, OptionValue
FROM OrderItemOptionValue
WHERE OrderItemID = @OrderItemID
" connection="Grocery" type="replace" use="raw">
<parameter name="OrderItemID" datatype="integer" direction="in"/>
</select>
<insert name="INSERT INTO OrderItemOptionValue(OrderItemID, ProductOptionID, OptionValue)
VALUES(@OrderItemID, @ProductOptionID, @OptionValue)
" connection="Grocery" type="replace" use="raw">
<parameter name="OrderItemID" datatype="integer" direction="in"/>
<parameter name="ProductOptionID" datatype="integer" direction="in"/>
<parameter name="OptionValue" datatype="string" direction="in"/>
</insert>
<update name="NOT_USED" connection="Grocery" type="replace" use="raw">
<parameter name="OrderItemID" datatype="integer" direction="in"/>
<parameter name="ProductOptionID" datatype="integer" direction="in"/>
<parameter name="OptionValue" datatype="string" direction="in"/>
</update>
<delete name="DELETE FROM OrderItemOptionValue
WHERE OrderItemID = @OrderItemID" connection="Grocery" type="replace" use="raw">
<parameter name="OrderItemID" datatype="integer" direction="in"/>
</delete>
</query>
<query id="OrderItemOptionValue" default="true">
<select name="SELECT OrderItemID, ProductOptionID, OptionValue
FROM OrderItemOptionValue
WHERE OrderItemID = @OrderItemID AND ProductOptionID = @ProductOptionID
" connection="Grocery" type="replace" use="raw">
<parameter name="OrderItemID" datatype="integer" direction="in"/>
<parameter name="ProductOptionID" datatype="integer" direction="in"/>
</select>
<insert name="INSERT INTO OrderItemOptionValue(OrderItemID, ProductOptionID, OptionValue)
VALUES(@OrderItemID, @ProductOptionID, @OptionValue)
" connection="Grocery" type="replace" use="raw">
<parameter name="OrderItemID" datatype="integer" direction="in"/>
<parameter name="ProductOptionID" datatype="integer" direction="in"/>
<parameter name="OptionValue" datatype="string" direction="in"/>
</insert>
<update name="UpdateOrderItemOptionValue" connection="Grocery" type="proc" use="raw">
<parameter name="OrderItemID" datatype="integer" direction="in"/>
<parameter name="ProductOptionID" datatype="integer" direction="in"/>
<parameter name="OptionValue" datatype="string" direction="in"/>
</update>
<delete name="DELETE FROM OrderItemOptionValue
WHERE OrderItemID = @OrderItemID AND ProductOptionID = @ProductOptionID
" connection="Grocery" type="replace" use="raw">
<parameter name="OrderItemID" datatype="integer" direction="in"/>
<parameter name="ProductOptionID" datatype="integer" direction="in"/>
</delete>
</query>
</datasource>
<properties>
<property name="OrderItemID" alias="OrderItemID" datatype="integer" nullable="false" pkey="true" identity="false"/>
<property name="ProductOptionID" alias="ProductOptionID" datatype="integer" nullable="false" pkey="true" identity="false"/>
<property name="OptionValue" alias="OptionValue" datatype="string" nullable="false"/>
<property name="OptionType" alias="OptionType" datatype="string" nullable="false"/>
<property name="SelectedOptionValue" alias="SelectedOptionValue" datatype="string" nullable="false"/>
</properties>
<relationships/>
</object>
<object name="Order">
<datasource>
<query id="CustomerOrders" default="false">
<select name="SELECT Orders.OrderID,
Orders.CustomerID,
Orders.StoreID,
Orders.OrderCost,
Orders.TotalItemCost,
Orders.TotalItems,
Orders.OrderDate,
Orders.Status,
Orders.PromoReduction,
Orders.LoyaltyPoints,
Orders.InvoiceAddress,
Orders.DeliveryHouseName,
Orders.DeliveryStreet,
Orders.DeliveryArea,
Orders.DeliveryTown,
Orders.DeliveryCounty,
Orders.DeliveryPostcode,
Orders.IsMailingAddress,
Orders.DeliveryID,
Orders.DeliveryStartDate,
Orders.DeliveryEndDate,
Orders.AcceptSubs,
Orders.Instructions,
Orders.DeliveryInstructions,
Orders.CCNo,
Orders.CCName,
Orders.CCFromDate,
Orders.CCExpDate,
Orders.CCIssueNo,
Orders.CCType,
Orders.Source
FROM Orders
WHERE CustomerID = @CustomerID
ORDER BY OrderDate DESC
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
</select>
</query>
<query id="CustomerCurrentOrder" default="false">
<select name="SELECT Orders.OrderID,
Orders.CustomerID,
Orders.StoreID,
Orders.OrderCost,
Orders.TotalItemCost,
Orders.TotalItems,
Orders.OrderDate,
Orders.Status,
Orders.PromoReduction,
Orders.LoyaltyPoints,
Orders.InvoiceAddress,
Orders.DeliveryHouseName,
Orders.DeliveryStreet,
Orders.DeliveryArea,
Orders.DeliveryTown,
Orders.DeliveryCounty,
Orders.DeliveryPostcode,
Orders.IsMailingAddress,
Orders.DeliveryID,
Orders.DeliveryStartDate,
Orders.DeliveryEndDate,
Orders.AcceptSubs,
Orders.Instructions,
Orders.DeliveryInstructions,
Orders.CCNo,
Orders.CCName,
Orders.CCFromDate,
Orders.CCExpDate,
Orders.CCIssueNo,
Orders.CCType,
Orders.Source
FROM Orders
WHERE CustomerID = @CustomerID
AND Status = 1
ORDER BY OrderDate DESC" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
</select>
<insert name="INSERT INTO Orders
(
CustomerID,
StoreID,
OrderCost,
TotalItemCost,
TotalItems,
OrderDate,
Status,
PromoReduction,
LoyaltyPoints,
InvoiceAddress,
DeliveryHouseName,
DeliveryStreet,
DeliveryArea,
DeliveryTown,
DeliveryCounty,
DeliveryPostcode,
IsMailingAddress,
DeliveryID,
DeliveryStartDate,
DeliveryEndDate,
AcceptSubs,
Instructions,
DeliveryInstructions,
CCNo,
CCName,
CCFromDate,
CCExpDate,
CCIssueNo,
CCType,
Source
)
VALUES
(
@CustomerID,
@StoreID,
@OrderCost,
@TotalItemCost,
@TotalItems,
@OrderDate,
@Status,
@PromoReduction,
@LoyaltyPoints,
@InvoiceAddress,
@DeliveryHouseName,
@DeliveryStreet,
@DeliveryArea,
@DeliveryTown,
@DeliveryCounty,
@DeliveryPostcode,
@IsMailingAddress,
@DeliveryID,
@DeliveryStartDate,
@DeliveryEndDate,
@AcceptSubs,
@Instructions,
@DeliveryInstructions,
@CCNo,
@CCName,
@CCFromDate,
@CCExpDate,
@CCIssueNo,
@CCType,
@Source
)
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="OrderCost" datatype="money" direction="in"/>
<parameter name="TotalItemCost" datatype="money" direction="in"/>
<parameter name="TotalItems" datatype="short" direction="in"/>
<parameter name="OrderDate" datatype="date" direction="in"/>
<parameter name="Status" datatype="integer" direction="in"/>
<parameter name="PromoReduction" datatype="money" direction="in"/>
<parameter name="LoyaltyPoints" datatype="integer" direction="in"/>
<parameter name="InvoiceAddress" datatype="string" direction="in"/>
<parameter name="DeliveryHouseName" datatype="string" direction="in"/>
<parameter name="DeliveryStreet" datatype="string" direction="in"/>
<parameter name="DeliveryArea" datatype="string" direction="in"/>
<parameter name="DeliveryTown" datatype="string" direction="in"/>
<parameter name="DeliveryCounty" datatype="string" direction="in"/>
<parameter name="DeliveryPostcode" datatype="string" direction="in"/>
<parameter name="IsMailingAddress" datatype="boolean" direction="in"/>
<parameter name="DeliveryID" datatype="integer" direction="in"/>
<parameter name="DeliveryStartDate" datatype="date" direction="in"/>
<parameter name="DeliveryEndDate" datatype="date" direction="in"/>
<parameter name="AcceptSubs" datatype="boolean" direction="in"/>
<parameter name="Instructions" datatype="string" direction="in"/>
<parameter name="DeliveryInstructions" datatype="string" direction="in"/>
<parameter name="CCNo" datatype="string" direction="in"/>
<parameter name="CCName" datatype="string" direction="in"/>
<parameter name="CCFromDate" datatype="date" direction="in"/>
<parameter name="CCExpDate" datatype="date" direction="in"/>
<parameter name="CCIssueNo" datatype="String" direction="in"/>
<parameter name="CCType" datatype="string" direction="in"/>
<parameter name="Source" datatype="string" direction="in"/>
</insert>
<update name="UPDATE Orders
SET
StoreID=@StoreID,
OrderCost=@OrderCost,
TotalItemCost=@TotalItemCost,
TotalItems=@TotalItems,
OrderDate=@OrderDate,
Status = @Status,
PromoReduction=@PromoReduction,
LoyaltyPoints=@LoyaltyPoints,
InvoiceAddress=@InvoiceAddress,
DeliveryHouseName=@DeliveryHouseName,
DeliveryStreet=@DeliveryStreet,
DeliveryArea=@DeliveryArea,
DeliveryTown=@DeliveryTown,
DeliveryCounty=@DeliveryCounty,
DeliveryPostcode=@DeliveryPostcode,
IsMailingAddress=@IsMailingAddress,
DeliveryID=@DeliveryID,
DeliveryStartDate=@DeliveryStartDate,
DeliveryEndDate=@DeliveryEndDate,
AcceptSubs=@AcceptSubs,
Instructions=@Instructions,
DeliveryInstructions=@DeliveryInstructions,
CCNo=@CCNo,
CCName=@CCName,
CCFromDate=@CCFromDate,
CCExpDate=@CCExpDate,
CCIssueNo=@CCIssueNo,
CCType=@CCType,
Source=@Source
WHERE Orders.OrderID = @OrderID
" connection="Grocery" type="replace" use="raw">
<parameter name="OrderID" datatype="integer" direction="in"/>
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="OrderCost" datatype="money" direction="in"/>
<parameter name="TotalItemCost" datatype="money" direction="in"/>
<parameter name="TotalItems" datatype="short" direction="in"/>
<parameter name="OrderDate" datatype="date" direction="in"/>
<parameter name="Status" datatype="integer" direction="in"/>
<parameter name="PromoReduction" datatype="money" direction="in"/>
<parameter name="LoyaltyPoints" datatype="integer" direction="in"/>
<parameter name="InvoiceAddress" datatype="string" direction="in"/>
<parameter name="DeliveryHouseName" datatype="string" direction="in"/>
<parameter name="DeliveryStreet" datatype="string" direction="in"/>
<parameter name="DeliveryArea" datatype="string" direction="in"/>
<parameter name="DeliveryTown" datatype="string" direction="in"/>
<parameter name="DeliveryCounty" datatype="string" direction="in"/>
<parameter name="DeliveryPostcode" datatype="string" direction="in"/>
<parameter name="IsMailingAddress" datatype="boolean" direction="in"/>
<parameter name="DeliveryID" datatype="integer" direction="in"/>
<parameter name="DeliveryStartDate" datatype="date" direction="in"/>
<parameter name="DeliveryEndDate" datatype="date" direction="in"/>
<parameter name="AcceptSubs" datatype="boolean" direction="in"/>
<parameter name="Instructions" datatype="string" direction="in"/>
<parameter name="DeliveryInstructions" datatype="string" direction="in"/>
<parameter name="CCNo" datatype="string" direction="in"/>
<parameter name="CCName" datatype="string" direction="in"/>
<parameter name="CCFromDate" datatype="date" direction="in"/>
<parameter name="CCExpDate" datatype="date" direction="in"/>
<parameter name="CCIssueNo" datatype="String" direction="in"/>
<parameter name="CCType" datatype="string" direction="in"/>
<parameter name="Source" datatype="string" direction="in"/>
</update>
<delete name="NOT_USED" connection="Grocery" type="replace" use="raw">
<parameter name="OrderID" datatype="integer" direction="in"/>
</delete>
</query>
<query id="CustomerOrder" default="true">
<select name="SELECT Orders.OrderID,
Orders.CustomerID,
Orders.StoreID,
Orders.OrderCost,
Orders.TotalItemCost,
Orders.TotalItems,
Orders.OrderDate,
Orders.Status,
Orders.PromoReduction,
Orders.LoyaltyPoints,
Orders.InvoiceAddress,
Orders.DeliveryHouseName,
Orders.DeliveryStreet,
Orders.DeliveryArea,
Orders.DeliveryTown,
Orders.DeliveryCounty,
Orders.DeliveryPostcode,
Orders.IsMailingAddress,
Orders.DeliveryID,
Orders.DeliveryStartDate,
Orders.DeliveryEndDate,
Orders.AcceptSubs,
Orders.Instructions,
Orders.DeliveryInstructions,
Orders.CCNo,
Orders.CCName,
Orders.CCFromDate,
Orders.CCExpDate,
Orders.CCIssueNo,
Orders.CCType,
Orders.Source
FROM Orders
WHERE OrderID = @OrderID" connection="Grocery" type="replace" use="raw">
<parameter name="OrderID" datatype="integer" direction="in"/>
</select>
<insert name="INSERT INTO Orders
(
CustomerID,
StoreID,
OrderCost,
TotalItemCost,
TotalItems,
OrderDate,
Status,
PromoReduction,
LoyaltyPoints,
InvoiceAddress,
DeliveryHouseName,
DeliveryStreet,
DeliveryArea,
DeliveryTown,
DeliveryCounty,
DeliveryPostcode,
IsMailingAddress,
DeliveryID,
DeliveryStartDate,
DeliveryEndDate,
AcceptSubs,
Instructions,
DeliveryInstructions,
CCNo,
CCName,
CCFromDate,
CCExpDate,
CCIssueNo,
CCType,
Source
)
VALUES
(
@CustomerID,
@StoreID,
@OrderCost,
@TotalItemCost,
@TotalItems,
@OrderDate,
@Status,
@PromoReduction,
@LoyaltyPoints,
@InvoiceAddress,
@DeliveryHouseName,
@DeliveryStreet,
@DeliveryArea,
@DeliveryTown,
@DeliveryCounty,
@DeliveryPostcode,
@IsMailingAddress,
@DeliveryID,
@DeliveryStartDate,
@DeliveryEndDate,
@AcceptSubs,
@Instructions,
@DeliveryInstructions,
@CCNo,
@CCName,
@CCFromDate,
@CCExpDate,
@CCIssueNo,
@CCType,
@Source
)
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="OrderCost" datatype="money" direction="in"/>
<parameter name="TotalItemCost" datatype="money" direction="in"/>
<parameter name="TotalItems" datatype="short" direction="in"/>
<parameter name="OrderDate" datatype="date" direction="in"/>
<parameter name="Status" datatype="integer" direction="in"/>
<parameter name="PromoReduction" datatype="money" direction="in"/>
<parameter name="LoyaltyPoints" datatype="integer" direction="in"/>
<parameter name="InvoiceAddress" datatype="string" direction="in"/>
<parameter name="DeliveryHouseName" datatype="string" direction="in"/>
<parameter name="DeliveryStreet" datatype="string" direction="in"/>
<parameter name="DeliveryArea" datatype="string" direction="in"/>
<parameter name="DeliveryTown" datatype="string" direction="in"/>
<parameter name="DeliveryCounty" datatype="string" direction="in"/>
<parameter name="DeliveryPostcode" datatype="string" direction="in"/>
<parameter name="IsMailingAddress" datatype="boolean" direction="in"/>
<parameter name="DeliveryID" datatype="integer" direction="in"/>
<parameter name="DeliveryStartDate" datatype="date" direction="in"/>
<parameter name="DeliveryEndDate" datatype="date" direction="in"/>
<parameter name="AcceptSubs" datatype="boolean" direction="in"/>
<parameter name="Instructions" datatype="string" direction="in"/>
<parameter name="DeliveryInstructions" datatype="string" direction="in"/>
<parameter name="CCNo" datatype="string" direction="in"/>
<parameter name="CCName" datatype="string" direction="in"/>
<parameter name="CCFromDate" datatype="date" direction="in"/>
<parameter name="CCExpDate" datatype="date" direction="in"/>
<parameter name="CCIssueNo" datatype="String" direction="in"/>
<parameter name="CCType" datatype="string" direction="in"/>
<parameter name="Source" datatype="string" direction="in"/>
</insert>
<update name="UPDATE Orders
SET
StoreID=@StoreID,
OrderCost=@OrderCost,
TotalItemCost=@TotalItemCost,
TotalItems=@TotalItems,
OrderDate=@OrderDate,
Status = @Status,
PromoReduction=@PromoReduction,
LoyaltyPoints=@LoyaltyPoints,
InvoiceAddress=@InvoiceAddress,
DeliveryHouseName=@DeliveryHouseName,
DeliveryStreet=@DeliveryStreet,
DeliveryArea=@DeliveryArea,
DeliveryTown=@DeliveryTown,
DeliveryCounty=@DeliveryCounty,
DeliveryPostcode=@DeliveryPostcode,
IsMailingAddress=@IsMailingAddress,
DeliveryID=@DeliveryID,
DeliveryStartDate=@DeliveryStartDate,
DeliveryEndDate=@DeliveryEndDate,
AcceptSubs=@AcceptSubs,
Instructions=@Instructions,
DeliveryInstructions=@DeliveryInstructions,
CCNo=@CCNo,
CCName=@CCName,
CCFromDate=@CCFromDate,
CCExpDate=@CCExpDate,
CCIssueNo=@CCIssueNo,
CCType=@CCType,
Source=@Source
WHERE Orders.OrderID = @OrderID
" connection="Grocery" type="replace" use="raw">
<parameter name="OrderID" datatype="integer" direction="in"/>
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="OrderCost" datatype="money" direction="in"/>
<parameter name="TotalItemCost" datatype="money" direction="in"/>
<parameter name="TotalItems" datatype="short" direction="in"/>
<parameter name="OrderDate" datatype="date" direction="in"/>
<parameter name="Status" datatype="integer" direction="in"/>
<parameter name="PromoReduction" datatype="money" direction="in"/>
<parameter name="LoyaltyPoints" datatype="integer" direction="in"/>
<parameter name="InvoiceAddress" datatype="string" direction="in"/>
<parameter name="DeliveryHouseName" datatype="string" direction="in"/>
<parameter name="DeliveryStreet" datatype="string" direction="in"/>
<parameter name="DeliveryArea" datatype="string" direction="in"/>
<parameter name="DeliveryTown" datatype="string" direction="in"/>
<parameter name="DeliveryCounty" datatype="string" direction="in"/>
<parameter name="DeliveryPostcode" datatype="string" direction="in"/>
<parameter name="IsMailingAddress" datatype="boolean" direction="in"/>
<parameter name="DeliveryID" datatype="integer" direction="in"/>
<parameter name="DeliveryStartDate" datatype="date" direction="in"/>
<parameter name="DeliveryEndDate" datatype="date" direction="in"/>
<parameter name="AcceptSubs" datatype="boolean" direction="in"/>
<parameter name="Instructions" datatype="string" direction="in"/>
<parameter name="DeliveryInstructions" datatype="string" direction="in"/>
<parameter name="CCNo" datatype="string" direction="in"/>
<parameter name="CCName" datatype="string" direction="in"/>
<parameter name="CCFromDate" datatype="date" direction="in"/>
<parameter name="CCExpDate" datatype="date" direction="in"/>
<parameter name="CCIssueNo" datatype="String" direction="in"/>
<parameter name="CCType" datatype="string" direction="in"/>
<parameter name="Source" datatype="string" direction="in"/>
</update>
<delete name="NOT_USED" connection="Grocery" type="replace" use="raw">
<parameter name="OrderID" datatype="integer" direction="in"/>
</delete>
</query>
</datasource>
<properties>
<property name="OrderID" alias="OrderID" datatype="integer" nullable="false" pkey="true" identity="true"/>
<property name="StoreID" alias="StoreID" datatype="integer" nullable="false"/>
<property name="CustomerID" alias="CustomerID" datatype="integer" nullable="true"/>
<property name="OrderCost" alias="OrderCost" datatype="money" nullable="true"/>
<property name="TotalItemCost" alias="TotalItemCost" datatype="money" nullable="true"/>
<property name="TotalItems" alias="TotalItems" datatype="short" nullable="true"/>
<property name="OrderDate" alias="OrderDate" datatype="date" nullable="true"/>
<property name="Status" alias="Status" datatype="short" nullable="true"/>
<property name="PromoReduction" alias="PromoReduction" datatype="money" nullable="true"/>
<property name="LoyaltyPoints" alias="LoyaltyPoints" datatype="integer" nullable="true"/>
<property name="InvoiceAddress" alias="InvoiceAddress" datatype="string" nullable="true"/>
<property name="DeliveryHouseName" alias="DeliveryHouseName" datatype="string" nullable="true"/>
<property name="DeliveryStreet" alias="DeliveryStreet" datatype="string" nullable="true"/>
<property name="DeliveryArea" alias="DeliveryArea" datatype="string" nullable="true"/>
<property name="DeliveryTown" alias="DeliveryTown" datatype="string" nullable="true"/>
<property name="DeliveryCounty" alias="DeliveryCounty" datatype="string" nullable="true"/>
<property name="DeliveryPostcode" alias="DeliveryPostcode" datatype="string" nullable="true"/>
<property name="IsMailingAddress" alias="IsMailingAddress" datatype="boolean" nullable="true"/>
<property name="DeliveryID" alias="DeliveryID" datatype="integer" nullable="true"/>
<property name="DeliveryStartDate" alias="DeliveryStartDate" datatype="date" nullable="true"/>
<property name="DeliveryEndDate" alias="DeliveryEndDate" datatype="date" nullable="true"/>
<property name="AcceptSubs" alias="AcceptSubs" datatype="boolean" nullable="true"/>
<property name="Instructions" alias="Instructions" datatype="string" nullable="true"/>
<property name="DeliveryInstructions" alias="DeliveryInstructions" datatype="string" nullable="true"/>
<property name="CCNo" alias="CCNo" datatype="string" nullable="true"/>
<property name="CCName" alias="CCName" datatype="string" nullable="true"/>
<property name="CCFromDate" alias="CCFromDate" datatype="date" nullable="true"/>
<property name="CCExpDate" alias="CCExpDate" datatype="date" nullable="true"/>
<property name="CCIssueNo" alias="CCIssueNo" datatype="string" nullable="true"/>
<property name="CCType" alias="CCType" datatype="string" nullable="true"/>
<property name="Source" alias="Source" datatype="string" nullable="true"/>
<property name="IntroductionDate" alias="IntroductionDate" datatype="Date" nullable="true"/>
</properties>
<relationships>
<relationship name="Items" object="OrderItem" keyprop="down" collection="true" query="OrderItems">
<key pkey="OrderID" fkey="OrderID" from="parent" to="child"/>
<key pkey="StoreID" fkey="StoreID" from="parent" to="child"/>
</relationship>
<relationship name="ItemsInStore" object="OrderItem" keyprop="down" collection="true" query="OrderItems">
<key pkey="OrderID" fkey="OrderID" from="parent" to="child"/>
<key pkey="StoreID" fkey="StoreID" from="parent" to="child"/>
<key pkey="IntroductionDate" fkey="IntroductionDate" from="parent" to="child"/>
</relationship>
<relationship name="InvoiceAddress" object="Address" keyprop="down" collection="false" query="AddressByID">
<key pkey="InvoiceAddressID" fkey="AddressID" from="parent" to="child"/>
</relationship>
<relationship name="Delivery" object="Delivery" keyprop="down" collection="false" query="OrderDelivery">
<key pkey="OrderID" fkey="OrderID" from="parent" to="child"/>
</relationship>
</relationships>
<methods>
<method name="CancelOrder" returntype="boolean" uuid="IcelandGrocery.Order" implname="CancelOrder">
<parameter name="OrderID" datatype="integer" direction="in"/>
<parameter name="Status" datatype="integer" direction="in"/>
</method>
</methods>
</object>
<object name="Parameter">
<datasource>
<query id="SiteParameter" default="true">
<select name="SELECT
Parameter.ParameterID,
Parameter.Name,
Parameter.ParameterValue
FROM
Parameter
WHERE
Parameter.Name = @Name
" connection="Grocery" type="replace" use="raw">
<parameter name="Name" datatype="string" direction="in"/>
</select>
<update name="UPDATE Parameter
SET ParameterValue = @ParameterValue
WHERE Name = @Name
" connection="Grocery" type="replace" use="raw">
<parameter name="Name" datatype="string" direction="in"/>
<parameter name="ParameterValue" datatype="string" direction="in"/>
</update>
</query>
<query id="SiteParameters" default="false">
<select name="SELECT
Parameter.ParameterID,
Parameter.Name,
Parameter.ParameterValue
FROM
Parameter
" connection="Grocery" type="replace" use="raw"/>
</query>
</datasource>
<properties>
<property name="ParameterID" alias="ParameterID" datatype="int" nullable="false" identity="true" pkey="true"/>
<property name="Name" alias="Name" datatype="string" nullable="false"/>
<property name="ParameterValue" alias="ParameterValue" datatype="string" nullable="true"/>
</properties>
<relationships>
<relationship object="Parameter" name="Parameters" keyprop="none" collection="true" query="SiteParameters"/>
</relationships>
</object>
<object name="PostcodeZone">
<datasource>
<query id="PostcodeStore" default="true">
<select name="SelectPostcodeStore" connection="Grocery" type="proc" use="raw">
<parameter name="Postcode" datatype="string" direction="in"/>
</select>
</query>
</datasource>
<properties>
<property name="Postcode" alias="Postcode" datatype="string" nullable="false" pkey="false"/>
<property name="StoreID" alias="StoreID" datatype="integer" nullable="false" pkey="false"/>
<property name="ZoneID" alias="ZoneID" datatype="integer" nullable="false" pkey="false"/>
</properties>
<relationships>
<relationship name="DeliverySlots" object="Delivery" keyprop="none" collection="true" query="Deliveries">
<key pkey="ZoneID" fkey="ZoneID" from="parent" to="child"/>
</relationship>
</relationships>
</object>
<object name="PriceChange">
<datasource>
<query id="NextChange" default="true">
<select name="SELECT
PriceChangeDate
FROM
PriceChange
WHERE
PriceChangeDate>=GetDate()
ORDER BY PriceChangeDate
" connection="Grocery" use="raw" type="replace"/>
<update name="UPDATE PriceChange
SET PriceChangeDate=@PriceChangeDate
WHERE PriceChangeID = @PriceChangeID" connection="Grocery" use="raw" type="replace">
<parameter name="PriceChangeID" datatype="integer" direction="in"/>
<parameter name="PriceChangeDate" datatype="date" direction="in"/>
</update>
<insert name="INSERT INTO PriceChange
(PriceChangeDate)
VALUES
(@PriceChangeDate)" connection="Grocery" use="raw" type="replace">
<parameter name="PriceChangeDate" datatype="date" direction="in"/>
</insert>
<delete name="DELETE FROM PriceChange
WHERE PriceChangeID=@PriceChangeID" connection="Grocery" type="replace" use="raw">
<parameter name="PriceChangeID" datatype="integer" direction="in"/>
</delete>
</query>
<query id="PriceChangeDates" default="false">
<select name="SELECT PriceChangeID,PriceChangeDate
FROM PriceChange" connection="Grocery" use="raw" type="replace"/>
<update name="UPDATE PriceChange
SET PriceChangeDate=@PriceChangeDate
WHERE PriceChangeID = @PriceChangeID
" connection="Grocery" use="raw" type="replace">
<parameter name="PriceChangeID" datatype="integer" direction="in"/>
<parameter name="PriceChangeDate" datatype="date" direction="in"/>
</update>
<insert name="INSERT INTO PriceChange
(PriceChangeDate)
VALUES
(@PriceChangeDate)" connection="Grocery" use="raw" type="replace">
<parameter name="PriceChangeDate" datatype="date" direction="in"/>
</insert>
<delete name="DELETE FROM PriceChange
WHERE PriceChangeID=@PriceChangeID" connection="Grocery" type="replace" use="raw">
<parameter name="PriceChangeID" datatype="integer" direction="in"/>
</delete>
</query>
</datasource>
<properties>
<property name="PriceChangeID" alias="PriceChangeID" datatype="integer" pkey="true" identity="true" nullable="false"/>
<property name="PriceChangeDate" alias="PriceChangeDate" datatype="date"/>
</properties>
<relationships>
<relationship name="PriceChangeDates" query="PriceChangeDates" object="PriceChange" collection="true" keyprop="none"/>
</relationships>
</object>
<object name="Product">
<datasource>
<query id="StoreCategoryProducts" default="false">
<select name="SELECT DISTINCT
Product.ProductID,
NULL AS ProductGroupID,
NULL AS GroupName,
Product.Name,
Product.Description,
Product.PackSize,
Product.UnitSize,
Product.UnitID,
Product.HasLabelData,
ProductInStore.IsCaseDealParent,
ProductInStore.CaseDealImageID,
ProductInStore.ComparativeSizeInfo,
ProductInStore.AddedVal,
ProductInStore.Saving,
ProductInStore.IsNew,
ProductInStore.Price,
ProductInStore.StoreID,
ProductInStore.IntroductionDate,
ProductOptionValue.ProductID AS HasOptions
FROM
ProductInCategory
INNER JOIN ProductInStore
ON ProductInCategory.ProductID = ProductInStore.ProductID
INNER JOIN Product
ON ProductInCategory.ProductID = Product.ProductID
LEFT JOIN ProductOptionValue
ON ProductOptionValue.ProductID = Product.ProductID
WHERE
ProductInStore.StoreID = @StoreID AND ProductInCategory.CategoryID = @CategoryID
AND ProductInStore.IntroductionDate <= @IntroductionDate
AND Product.CaseDealParentID = NULL
ORDER BY Product.ProductID ASC,
ProductInStore.IntroductionDate DESC
" connection="Grocery" type="replace" use="raw">
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="CategoryID" datatype="integer" direction="in"/>
<parameter name="IntroductionDate" datatype="Date" direction="in"/>
</select>
</query>
<query id="StoreCategoryProductsWithAV" default="false">
<select name="SELECT DISTINCT
Product.ProductID,
NULL AS ProductGroupID,
NULL AS GroupName,
Product.Name,
Product.Description,
Product.PackSize,
Product.UnitSize,
Product.UnitID,
Product.HasLabelData,
ProductInStore.IsCaseDealParent,
ProductInStore.CaseDealImageID,
ProductInStore.ComparativeSizeInfo,
ProductInStore.AddedVal,
ProductInStore.Saving,
ProductInStore.IsNew,
ProductInStore.Price,
ProductInStore.StoreID,
ProductInStore.IntroductionDate,
ProductOptionValue.ProductID AS HasOptions,
ProductAttributeValue.AttributeValue,
ProductAttributeValue.UnitID AS AttributeUnitID
FROM
ProductInCategory
INNER JOIN ProductInStore
ON ProductInCategory.ProductID = ProductInStore.ProductID
INNER JOIN Product
ON ProductInCategory.ProductID = Product.ProductID
LEFT JOIN ProductOptionValue
ON ProductOptionValue.ProductID = Product.ProductID
LEFT JOIN ProductAttributeValue
ON ProductAttributeValue.ProductID = Product.ProductID
WHERE
ProductInStore.StoreID = @StoreID
AND ProductInCategory.CategoryID = @CategoryID
AND ProductInStore.IntroductionDate <= @IntroductionDate
AND Product.CaseDealParentID = NULL
AND ProductAttributeValue.AttributeID = @AttributeID
ORDER BY Product.ProductID ASC,ProductInStore.IntroductionDate DESC
" connection="Grocery" type="replace" use="raw">
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="CategoryID" datatype="integer" direction="in"/>
<parameter name="AttributeID" datatype="integer" direction="in"/>
<parameter name="IntroductionDate" datatype="Date" direction="in"/>
</select>
</query>
<query id="StoreProduct" default="true">
<select name="SELECT DISTINCT
Product.ProductID,
NULL AS ProductGroupID,
Product.Name,
Product.Description,
Product.PackSize,
Product.UnitSize,
Product.UnitID,
Product.HasLabelData,
ProductInStore.IsCaseDealParent,
ProductInStore.CaseDealImageID,
Product.CaseDealParentID,
ProductInStore.ComparativeSizeInfo,
ProductInStore.AddedVal,
ProductInStore.Saving,
ProductInStore.IsNew,
ProductInStore.Price,
ProductInStore.StoreID,
ProductInStore.IntroductionDate,
ProductOptionValue.ProductID AS HasOptions
FROM
Product
INNER JOIN ProductInStore
ON Product.ProductID = ProductInStore.ProductID
LEFT JOIN ProductOptionValue
ON ProductOptionValue.ProductID = Product.ProductID
WHERE ProductInStore.StoreID = @StoreID
AND Product.ProductID = @ProductID
AND ProductInStore.IntroductionDate <= @IntroductionDate
ORDER BY ProductInStore.IntroductionDate DESC" connection="Grocery" type="replace" use="raw">
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="ProductID" datatype="integer" direction="in"/>
<parameter name="IntroductionDate" datatype="Date" direction="in"/>
</select>
</query>
<query id="StoreProductCaseDealProducts" default="false">
<select name="SELECT DISTINCT
Product.ProductID,
Product.Name,
Product.Description,
Product.PackSize,
Product.UnitSize,
Product.UnitID,
Product.HasLabelData,
ProductInStore.IsCaseDealParent,
Product.CaseDealParentID,
ProductInStore.ComparativeSizeInfo,
ProductInStore.AddedVal,
ProductInStore.Saving,
ProductInStore.IsNew,
ProductInStore.Price,
ProductInStore.StoreID,
ProductInStore.IntroductionDate,
ProductOptionValue.ProductID AS HasOptions
FROM
Product
INNER JOIN ProductInStore
ON Product.ProductID = ProductInStore.ProductID
LEFT JOIN ProductOptionValue
ON ProductOptionValue.ProductID = Product.ProductID
WHERE
ProductInStore.StoreID = @StoreID
AND ProductInStore.IntroductionDate <= @IntroductionDate
AND Product.CaseDealParentID = @CaseDealParentID
ORDER BY Product.ProductID ASC,ProductInStore.IntroductionDate DESC" connection="Grocery" type="replace" use="raw">
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="CaseDealParentID" datatype="integer" direction="in"/>
<parameter name="IntroductionDate" datatype="Date" direction="in"/>
</select>
</query>
<query id="StoreProductRelatedProducts" default="false">
<select name="
SELECT DISTINCT
Product.ProductID,
Product.Name,
Product.Description,
Product.PackSize,
Product.UnitSize,
Product.UnitID,
Product.HasLabelData,
ProductInStore.IsCaseDealParent,
ProductInStore.CaseDealImageID,
Product.CaseDealParentID,
ProductInStore.ComparativeSizeInfo,
ProductInStore.AddedVal,
ProductInStore.Saving,
ProductInStore.IsNew,
ProductInStore.Price,
ProductInStore.StoreID,
ProductInStore.IntroductionDate,
ProductOptionValue.ProductID AS HasOptions
FROM
RelatedProductInProduct
INNER JOIN Product
ON Product.ProductID = RelatedProductInProduct.RelatedProductID
INNER JOIN ProductInStore
ON Product.ProductID = ProductInStore.ProductID
LEFT JOIN ProductOptionValue
ON ProductOptionValue.ProductID = Product.ProductID
WHERE
ProductInStore.StoreID = @StoreID
AND RelatedProductInProduct.ProductID = @ProductID
AND ProductInStore.IntroductionDate <= @IntroductionDate
AND Product.CaseDealParentID = NULL
ORDER BY Product.ProductID ASC,ProductInStore.IntroductionDate DESC
" connection="Grocery" type="replace" use="raw">
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="ProductID" datatype="integer" direction="in"/>
<parameter name="IntroductionDate" datatype="Date" direction="in"/>
</select>
</query>
<query id="StoreProductSubstituteProducts" default="false">
<select name="SELECT DISTINCT
Product.ProductID,
Product.Name,
Product.Description,
Product.PackSize,
Product.UnitSize,
Product.UnitID,
Product.HasLabelData,
ProductInStore.IsCaseDealParent,
ProductInStore.CaseDealImageID,
Product.CaseDealParentID,
ProductInStore.ComparativeSizeInfo,
ProductInStore.AddedVal,
ProductInStore.Saving,
ProductInStore.IsNew,
ProductInStore.Price,
ProductInStore.StoreID,
ProductInStore.IntroductionDate,
ProductOptionValue.ProductID AS HasOptions
FROM
SubstituteProductInProduct
INNER JOIN Product
ON Product.ProductID = SubstituteProductInProduct.SubstituteProductID
INNER JOIN ProductInStore
ON Product.ProductID = ProductInStore.ProductID
LEFT JOIN ProductOptionValue
ON ProductOptionValue.ProductID = Product.ProductID
WHERE
ProductInStore.StoreID = @StoreID
AND SubstituteProductInProduct.ProductID = @ProductID
AND ProductInStore.IntroductionDate <= @IntroductionDate
AND Product.CaseDealParentID = NULL
ORDER BY Product.ProductID ASC,ProductInStore.IntroductionDate DESC
" connection="Grocery" type="replace" use="raw">
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="ProductID" datatype="integer" direction="in"/>
<parameter name="IntroductionDate" datatype="Date" direction="in"/>
</select>
</query>
<query id="AdvancedSearchStoreProductsWithAV" default="false">
<select name="SELECT DISTINCT
Product.ProductID,
NULL AS ProductGroupID,
NULL AS GroupName,
Product.Name,
Product.Description,
Product.PackSize,
Product.UnitSize,
Product.UnitID,
Product.HasLabelData,
ProductInStore.IsCaseDealParent,
ProductInStore.CaseDealImageID,
ProductInStore.ComparativeSizeInfo,
ProductInStore.AddedVal,
ProductInStore.Saving,
ProductInStore.IsNew,
ProductInStore.Price,
ProductInStore.StoreID,
ProductInStore.IntroductionDate,
CategoryRank.RANK As CategoryRank,
Category.CategoryID,
Category.ParentID,
Category.LevelNo,
ProductOptionValue.ProductID AS HasOptions,
ProductAttributeValue.AttributeValue,
ProductAttributeValue.UnitID AS AttributeUnitID
FROM
Product
INNER JOIN ProductInCategory
ON ProductInCategory.ProductID = Product.ProductID
INNER JOIN Category
ON Category.CategoryID = ProductInCategory.CategoryID
INNER JOIN ProductInStore
ON Product.ProductID = ProductInStore.ProductID
LEFT JOIN ProductOptionValue
ON ProductOptionValue.ProductID = Product.ProductID
LEFT JOIN ProductAttributeValue
ON ProductAttributeValue.ProductID = Product.ProductID
WHERE
ProductInStore.StoreID = @StoreID
AND CONTAINS(Product.Name, @SearchString)
OR CONTAINS(Product.ProductCode, @SearchString)
AND Category.TopLevelID = @TopLevelID
AND ProductInStore.IntroductionDate <= @IntroductionDate
AND Product.CaseDealParentID = NULL
AND ProductAttributeValue.AttributeID = @AttributeID
ORDER BY Product.ProductID ASC,ProductInStore.IntroductionDate DESC" connection="Grocery" type="replace" use="raw">
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="TopLevelID" datatype="integer" direction="in"/>
<parameter name="AttributeID" datatype="integer" direction="in"/>
<parameter name="SearchString" datatype="string" direction="in"/>
<parameter name="IntroductionDate" datatype="Date" direction="in"/>
</select>
</query>
<query id="AdvancedSearchStoreProducts" default="false">
<select name="SELECT DISTINCT
Product.ProductID,
NULL AS ProductGroupID,
NULL AS GroupName,
Product.Name,
Product.Description,
Product.PackSize,
Product.UnitSize,
Product.UnitID,
Product.HasLabelData,
ProductInStore.IsCaseDealParent,
ProductInStore.CaseDealImageID,
ProductInStore.ComparativeSizeInfo,
ProductInStore.AddedVal,
ProductInStore.Saving,
ProductInStore.IsNew,
ProductInStore.Price,
ProductInStore.StoreID,
ProductInStore.IntroductionDate,
Category.CategoryID,
Category.ParentID,
Category.LevelNo,
ProductOptionValue.ProductID AS HasOptions
FROM
Product
INNER JOIN ProductInCategory
ON ProductInCategory.ProductID = Product.ProductID
INNER JOIN Category
ON Category.CategoryID = ProductInCategory.CategoryID
INNER JOIN ProductInStore
ON Product.ProductID = ProductInStore.ProductID
LEFT JOIN ProductOptionValue
ON ProductOptionValue.ProductID = Product.ProductID
WHERE
ProductInStore.StoreID = @StoreID
AND CONTAINS(Product.Name, @SearchString)
OR CONTAINS(Product.ProductCode, @SearchString)
AND Category.TopLevelID = @TopLevelID
AND ProductInStore.IntroductionDate <= @IntroductionDate
AND Product.CaseDealParentID = NULL
ORDER BY Product.ProductID ASC,ProductInStore.IntroductionDate DESC" connection="Grocery" type="replace" use="raw">
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="TopLevelID" datatype="integer" direction="in"/>
<parameter name="SearchString" datatype="string" direction="in"/>
<parameter name="IntroductionDate" datatype="Date" direction="in"/>
</select>
</query>
<query id="SearchStoreProductsWithAV" default="false">
<select name="SELECT DISTINCT
Product.ProductID,
NULL AS ProductGroupID,
NULL AS GroupName,
Product.Name,
Product.Description,
Product.PackSize,
Product.UnitSize,
Product.UnitID,
Product.HasLabelData,
ProductInStore.IsCaseDealParent,
ProductInStore.CaseDealImageID,
ProductInStore.ComparativeSizeInfo,
ProductInStore.AddedVal,
ProductInStore.Saving,
ProductInStore.IsNew,
ProductInStore.Price,
ProductInStore.StoreID,
ProductInStore.IntroductionDate,
ProductOptionValue.ProductID AS HasOptions,
Category.TopLevelID,
Category.CategoryID,
Category.ParentID,
Category.LevelNo,
CategoryTop.Name AS TopLevelName,
ProductAttributeValue.AttributeValue,
ProductAttributeValue.UnitID AS AttributeUnitID
FROM
Product
INNER JOIN ProductInCategory
ON ProductInCategory.ProductID = Product.ProductID
INNER JOIN Category
ON Category.CategoryID = ProductInCategory.CategoryID
INNER JOIN Category CategoryTop
ON Category.TopLevelID = CategoryTop.CategoryID
INNER JOIN ProductInStore
ON Product.ProductID = ProductInStore.ProductID
LEFT JOIN ProductOptionValue
ON ProductOptionValue.ProductID = Product.ProductID
LEFT JOIN ProductAttributeValue
ON ProductAttributeValue.ProductID = Product.ProductID
WHERE
ProductInStore.StoreID = @StoreID
AND CONTAINS(Product.Name, @SearchString)
OR CONTAINS(Product.ProductCode, @SearchString)
AND ProductInStore.IntroductionDate <= @IntroductionDate
AND Product.CaseDealParentID = NULL
AND ProductAttributeValue.AttributeID = @AttributeID
ORDER BY
TopLevelName LIKE @SearchString, Category.TopLevelID ASC,Product.ProductID ASC,ProductInStore.IntroductionDate DESC" connection="Grocery" type="replace" use="raw">
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="AttributeID" datatype="integer" direction="in"/>
<parameter name="SearchString" datatype="string" direction="in"/>
<parameter name="IntroductionDate" datatype="Date" direction="in"/>
</select>
</query>
<query id="SearchStoreProducts" default="false">
<select name="SELECT DISTINCT
Product.ProductID,
NULL AS ProductGroupID,
NULL AS GroupName,
Product.Name,
Product.Description,
Product.PackSize,
Product.UnitSize,
Product.UnitID,
Product.HasLabelData,
ProductInStore.IsCaseDealParent,
ProductInStore.CaseDealImageID,
ProductInStore.ComparativeSizeInfo,
ProductInStore.AddedVal,
ProductInStore.Saving,
ProductInStore.IsNew,
ProductInStore.Price,
ProductInStore.StoreID,
ProductInStore.IntroductionDate,
ProductOptionValue.ProductID AS HasOptions,
Category.TopLevelID,
Category.CategoryID,
Category.ParentID,
Category.LevelNo,
CategoryTop.Name AS TopLevelName
FROM
Product
INNER JOIN ProductInCategory
ON ProductInCategory.ProductID = Product.ProductID
INNER JOIN Category
ON Category.CategoryID = ProductInCategory.CategoryID
INNER JOIN Category CategoryTop
ON Category.TopLevelID = CategoryTop.Categoryid
INNER JOIN ProductInStore
ON Product.ProductID = ProductInStore.ProductID
LEFT JOIN ProductOptionValue
ON ProductOptionValue.ProductID = Product.ProductID
WHERE
ProductInStore.StoreID = @StoreID
AND CONTAINS(Product.Name, @SearchString)
OR CONTAINS(Product.ProductCode, @SearchString)
AND ProductInStore.IntroductionDate <= @IntroductionDate
AND Product.CaseDealParentID = NULL
ORDER BY TopLevelName LIKE @SearchString, Product.ProductID ASC,ProductInStore.IntroductionDate DESC
" connection="Grocery" type="replace" use="raw">
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="SearchString" datatype="string" direction="in"/>
<parameter name="IntroductionDate" datatype="Date" direction="in"/>
</select>
</query>
<query id="StorePromoProducts" default="false">
<select name="SELECT
DISTINCT Product.ProductID,
ProductInStore.StoreID,
NULL AS ProductGroupID,
Product.Name,
Product.Description,
Product.PackSize,
Product.UnitSize,
NULL AS GroupName,
ProductInStore.Price,
ProductInStore.IntroductionDate,
Product.UnitID,
Product.HasLabelData,
ProductInStore.IsCaseDealParent,
Unit.Name AS UnitName,
Unit.ConvertRate,
Unit.IsInteger,
Product.IsUnitSelectable,
Product.CaseDealParentID,
ProductInStore.CaseDealImageID,
ProductInStore.ComparativeSizeInfo,
ProductInStore.AddedVal,
ProductInStore.Saving,
ProductInStore.IsNew,
1 AS HasPromos,
ProductOptionValue.ProductID AS HasOptions
FROM
Promo
INNER JOIN PromoSet
ON PromoSet.PromoID = Promo.PromoID
INNER JOIN ProductInPromoSet
ON ProductInPromoSet.PromoSetID = PromoSet.PromoSetID
INNER JOIN Product
ON Product.ProductID = ProductInPromoSet.ProductID
INNER JOIN ProductInStore
ON Product.ProductID = ProductInStore.ProductID
LEFT JOIN Unit
ON Unit.UnitID = Product.UnitID
LEFT JOIN ProductOptionValue
ON ProductOptionValue.ProductID = Product.ProductID
WHERE
ProductInStore.StoreID = @StoreID
AND Promo.PromoID = @PromoID
AND ProductInStore.IntroductionDate <= @IntroductionDate
ORDER BY Product.ProductID ASC,ProductInStore.IntroductionDate DESC
" connection="Grocery" type="replace" use="raw">
<parameter name="PromoID" datatype="integer" direction="in"/>
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="IntroductionDate" datatype="Date" direction="in"/>
</select>
</query>
<query id="StoreDynamicProducts" default="false">
<select name="SELECT DISTINCT
Product.ProductID,
NULL AS ProductGroupID,
NULL AS GroupName,
Product.Name,
Product.Description,
Product.PackSize,
Product.UnitSize,
Product.UnitID,
Product.HasLabelData,
ProductInStore.IsCaseDealParent,
ProductInStore.CaseDealImageID,
ProductInStore.ComparativeSizeInfo,
ProductInStore.AddedVal,
ProductInStore.Saving,
ProductInStore.IsNew,
ProductInStore.Price,
ProductInStore.StoreID,
ProductInStore.IntroductionDate,
ProductOptionValue.ProductID AS HasOptions
FROM
Product
INNER JOIN ProductInCategory
ON ProductInCategory.ProductID = Product.ProductID
INNER JOIN ProductInStore
ON Product.ProductID = ProductInStore.ProductID
LEFT JOIN ProductOptionValue
ON ProductOptionValue.ProductID = Product.ProductID
WHERE
ProductInStore.StoreID = @StoreID
AND CONTAINS(Product.ProductCode, @SearchString)
AND ProductInStore.IntroductionDate <= @IntroductionDate
AND Product.CaseDealParentID = NULL
ORDER BY Product.ProductID ASC,ProductInStore.IntroductionDate DESC" connection="Grocery" type="replace" use="raw">
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="SearchString" datatype="string" direction="in"/>
<parameter name="IntroductionDate" datatype="Date" direction="in"/>
</select>
</query>
</datasource>
<properties>
<property name="ProductID" alias="ProductID" datatype="integer" nullable="false" pkey="true"/>
<property name="StoreID" alias="StoreID" datatype="integer" nullable="true"/>
<property name="AttributeValue" alias="AttributeValue" datatype="string" nullable="true"/>
<property name="AttributeUnitID" alias="AttributeUnitID" datatype="integer" nullable="true"/>
<property name="ProductGroupID" alias="ProductGroupID" datatype="integer" nullable="true"/>
<property name="GroupName" alias="GroupName" datatype="string" nullable="false"/>
<property name="Name" alias="Name" datatype="string" nullable="false"/>
<property name="Description" alias="Description" datatype="string" nullable="true"/>
<property name="PackSize" alias="PackSize" datatype="short" nullable="true"/>
<property name="UnitSize" alias="UnitSize" datatype="float" nullable="true"/>
<property name="Price" alias="Price" datatype="money" nullable="false"/>
<property name="IntroductionDate" alias="IntroductionDate" datatype="Date" nullable="false"/>
<property name="UnitID" alias="UnitID" datatype="integer" nullable="true"/>
<property name="ComparativeSizeInfo" alias="ComparativeSizeInfo" datatype="String" nullable="true"/>
<property name="AddedVal" alias="AddedVal" datatype="string" nullable="true"/>
<property name="Saving" alias="Saving" datatype="money" nullable="true"/>
<property name="IsNew" alias="IsNew" datatype="boolean" nullable="true"/>
<property name="HasLabelData" alias="HasLabelData" datatype="boolean" nullable="false"/>
<property name="CategoryID" alias="CategoryID" datatype="integer" nullable="true"/>
<property name="ParentID" alias="ParentID" datatype="integer" nullable="true"/>
<property name="LevelNo" alias="LevelNo" datatype="integer" nullable="true"/>
<property name="TopLevelID" alias="TopLevelID" datatype="Integer" nullable="false"/>
<property name="TopLevelName" alias="TopLevelName" datatype="String" nullable="false"/>
<property name="HasOptions" alias="HasOptions" datatype="boolean" nullable="false"/>
<property name="HasPromos" alias="HasPromos" datatype="boolean" nullable="false"/>
<property name="IsCaseDealParent" alias="IsCaseDealParent" datatype="boolean" nullable="false"/>
<property name="CaseDealParentID" alias="CaseDealParentID" datatype="integer" nullable="true"/>
<property name="CaseDealImageID" alias="CaseDealImageID" datatype="string" nullable="true"/>
<property name="CategoryRank" alias="CategoryRank" datatype="integer" nullable="true"/>
</properties>
<relationships>
<relationship name="Options" object="ProductOption" keyprop="none" collection="true" query="ProductOptions">
<key pkey="ProductID" fkey="ProductID" from="parent" to="child"/>
</relationship>
<relationship name="SelectableAttributeValues" object="ProductAttributeValue" keyprop="none" collection="true" query="SelectableAttributeValues">
<key pkey="GroupID" fkey="GroupID" from="parent" to="child"/>
<key pkey="ProductID" fkey="ProductID" from="parent" to="child"/>
</relationship>
<relationship name="CaseDealProducts" object="Product" keyprop="none" collection="true" query="StoreProductCaseDealProducts">
<key pkey="StoreID" fkey="StoreID" from="parent" to="child"/>
<key pkey="ProductID" fkey="CaseDealParentID" from="parent" to="child"/>
<key pkey="IntroductionDate" fkey="IntroductionDate" from="parent" to="child"/>
</relationship>
<relationship name="RelatedProducts" object="Product" keyprop="none" collection="true" query="StoreProductRelatedProducts">
<key pkey="StoreID" fkey="StoreID" from="parent" to="child"/>
<key pkey="ProductID" fkey="ProductID" from="parent" to="child"/>
<key pkey="IntroductionDate" fkey="IntroductionDate" from="parent" to="child"/>
</relationship>
<relationship name="SubstituteProducts" object="Product" keyprop="none" collection="true" query="StoreProductSubstituteProducts">
<key pkey="StoreID" fkey="StoreID" from="parent" to="child"/>
<key pkey="ProductID" fkey="ProductID" from="parent" to="child"/>
<key pkey="IntroductionDate" fkey="IntroductionDate" from="parent" to="child"/>
</relationship>
<relationship name="Categories" object="Category" keyprop="none" collection="true" query="ProductCategories">
<key pkey="StoreID" fkey="StoreID" from="parent" to="child"/>
<key pkey="ProductID" fkey="ProductID" from="parent" to="child"/>
</relationship>
<relationship name="AttributeGroupMaps" object="ProductAttributeGroupMap" keyprop="none" collection="true" query="ProductAttributeGroupMaps">
<key fkey="ProductID" pkey="ProductID" to="child" from="parent"/>
</relationship>
<relationship name="LabelData" object="LabelData" keyprop="none" collection="true" query="ProductLabelData">
<key pkey="ProductID" fkey="ProductID" from="parent" to="child"/>
</relationship>
</relationships>
</object>
<object name="ProductAttribute">
<datasource>
<query id="AttributeGroupAttributes" default="false">
<select name="SELECT
Attribute.AttributeID,
Attribute.AttributeGroupID,
Attribute.SortValue,
Attribute.Name
FROM
Attribute
INNER JOIN AttributeGroup
ON Attribute.AttributeGroupID = AttributeGroup.AttributeGroupID
INNER JOIN ProductAttributeValue
ON Attribute.AttributeID = ProductAttributeValue.AttributeID
WHERE
AttributeGroup.AttributeGroupID = @AttributeGroupID
AND ProductAttributeValue.productID = @ProductID
" type="replace" use="raw" connection="Grocery">
<parameter name="ProductID" datatype="integer" direction="in"/>
<parameter name="AttributeGroupID" datatype="integer" direction="in"/>
</select>
</query>
<query id="ProductGroupAttributes" default="false">
<select name="SELECT SelectableAttributeInProdGroup.ProductGroupID AS ProductGroupID, Attribute.Name , Attribute.AttributeID, Attribute.AttributeGroupID, Attribute.SortValue, Attribute.IsAllowedInList
FROM Attribute
INNER JOIN SelectableAttributeInProdGroup
ON SelectableAttributeInProdGroup.AttributeID = Attribute.AttributeID
WHERE SelectableAttributeInProdGroup.ProductGroupID = @ProductGroupID
ORDER BY Attribute.SortValue
" connection="Grocery" type="replace" use="raw">
<parameter name="ProductGroupID" datatype="integer" direction="in"/>
</select>
</query>
<query id="StoreCategoryAttributes" default="false">
<select name="SELECT
DISTINCT Attribute.AttributeID,
Attribute.Name
FROM
ProductInCategory
INNER JOIN ProductInStore
ON ProductInStore.ProductID = ProductInCategory.ProductID
INNER JOIN ProductAttributeValue
ON ProductAttributeValue.ProductID = ProductInCategory.ProductID
INNER JOIN Attribute
ON ProductAttributeValue.AttributeID = Attribute.AttributeID
WHERE
ProductInCategory.CategoryID = @CategoryID AND ProductInStore.StoreID = @StoreID AND Attribute.IsAllowedInList <> 0" connection="Grocery" type="replace" use="raw">
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="CategoryID" datatype="integer" direction="in"/>
</select>
</query>
<query id="AdvancedSearchStoreAttributes" default="false">
<select name="SELECT
DISTINCT Attribute.AttributeID,
Attribute.Name
FROM
Attribute
INNER JOIN ProductAttributeValue
ON ProductAttributeValue.AttributeID = Attribute.AttributeID
INNER JOIN Product
ON Product.ProductID = ProductAttributeValue.ProductID
INNER JOIN ProductInStore
ON Product.ProductID = ProductInStore.ProductID
INNER JOIN ProductInCategory
ON ProductInCategory.ProductID = Product.ProductID
INNER JOIN Category
ON Category.CategoryID = ProductInCategory.CategoryID
WHERE
ProductInStore.StoreID = @StoreID
AND CONTAINS(Product.Name, @SearchString)
AND Category.TopLevelID = @TopLevelID
AND Attribute.IsAllowedInList != 0" connection="Grocery" type="replace" use="raw">
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="TopLevelID" datatype="integer" direction="in"/>
<parameter name="SearchString" datatype="string" direction="in"/>
</select>
</query>
<query id="SearchStoreAttributes" default="false">
<select name="SELECT
DISTINCT Attribute.AttributeID,
Attribute.Name
FROM
Product
INNER JOIN ProductInStore
ON Product.ProductID = ProductInStore.ProductID
INNER JOIN ProductAttributeValue
ON Product.ProductID = ProductAttributeValue.ProductID
INNER JOIN Attribute
ON ProductAttributeValue.AttributeID = Attribute.AttributeID
WHERE
ProductInStore.StoreID = @StoreID
AND CONTAINS(Product.Name, @SearchString)
AND Attribute.IsAllowedInList != 0" connection="Grocery" type="replace" use="raw">
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="SearchString" datatype="string" direction="in"/>
</select>
</query>
</datasource>
<properties>
<property name="AttributeID" alias="AttributeID" datatype="integer" nullable="false" pkey="true"/>
<property name="AttributeGroupID" alias="AttributeGroupID" datatype="integer" nullable="true" pkey="false"/>
<property name="SortValue" alias="SortValue" datatype="short" nullable="true" pkey="false"/>
<property name="Name" alias="Name" datatype="string" nullable="false" pkey="false"/>
<property name="IsAllowedInList" alias="IsAllowedInList" datatype="boolean" nullable="true" pkey="false"/>
<property name="ProductGroupID" alias="ProductGroupID" datatype="integer" nullable="true" pkey="false"/>
<property name="PartName" alias="PartName" datatype="string" nullable="true" pkey="false"/>
</properties>
<relationships>
<relationship name="Values" object="ProductAttributeValue" keyprop="none" collection="true" query="ProductGroupAttributeValues">
<key pkey="ProductGroupID" fkey="ProductGroupID" from="parent" to="child"/>
<key pkey="AttributeID" fkey="AttributeID" from="parent" to="child"/>
</relationship>
</relationships>
</object>
<object name="ProductAttributeGroup">
<datasource>
<query id="ProductAttributeGroups" default="true">
<select name="NOT_USED_AT_ALL
" connection="Grocery" type="replace" use="raw">
<parameter name="MapID" datatype="integer" direction="in"/>
<parameter name="ProductID" datatype="integer" direction="in"/>
</select>
</query>
</datasource>
<properties>
<property name="ProductID" alias="ProductID" datatype="integer" nullable="true" pkey="false"/>
<property name="AttributeGroupID" alias="AttributeGroupID" datatype="integer" nullable="false" pkey="true"/>
<property name="Name" alias="Name" datatype="string" nullable="false" pkey="false"/>
</properties>
<relationships>
<relationship name="Attributes" object="ProductAttribute" keyprop="none" collection="true" query="AttributeGroupAttributes">
<key pkey="ProductID" fkey="ProductID" from="parent" to="child"/>
<key pkey="AttributeGroupID" fkey="AttributeGroupID" from="parent" to="child"/>
</relationship>
<relationship name="AttributeValues" object="ProductAttributeValue" keyprop="none" collection="true" query="ProductAttributeGroupValues">
<key pkey="ProductID" fkey="ProductID" from="parent" to="child"/>
<key pkey="AttributeGroupID" fkey="AttributeGroupID" from="parent" to="child"/>
</relationship>
</relationships>
</object>
<object name="ProductAttributeGroupMap">
<datasource>
<query id="ProductAttributeGroupMaps" default="true">
<select name="SELECT
AttributeMap.AttributeMapID AS MapID,
AttributeMap.AttributeMapName AS MapName,
@ProductID AS ProductID
FROM AttributeMap
" connection="Grocery" type="replace" use="raw">
<parameter name="ProductID" datatype="integer" direction="in"/>
</select>
</query>
</datasource>
<properties>
<property name="MapID" alias="MapID" datatype="integer" nullable="true" pkey="true"/>
<property name="MapName" alias="MapName" datatype="string" nullable="false" pkey="false"/>
<property name="ProductID" alias="ProductID" datatype="integer" nullable="false" pkey="false"/>
</properties>
<relationships>
<relationship name="AttributeGroups" object="ProductAttributeGroup" keyprop="none" collection="true" query="ProductAttributeGroups">
<key fkey="MapID" pkey="MapID" to="child" from="parent"/>
<key fkey="ProductID" pkey="ProductID" to="child" from="parent"/>
</relationship>
</relationships>
</object>
<object name="ProductAttributeValue">
<datasource>
<query id="ProductGroupAttributeValues" default="false">
<select name="NOT_USED_AT_ALL" connection="Grocery" type="replace" use="raw">
<parameter name="ProductGroupID" datatype="integer" direction="in"/>
<parameter name="AttributeID" datatype="integer" direction="in"/>
</select>
</query>
<query id="ProductAttributeGroupValues" default="false">
<select name="SELECT
Attribute.Name AS AttributeName,
Attribute.AttributeID,
Attribute.SortValue,
PAV.ProductID,
PAV.AttributeValue,
PAV.UnitID,
Unit.Name AS UnitName,
Unit.ConvertRate,
PAV.PartName
FROM Attribute
INNER JOIN ProductAttributeValue PAV
ON Attribute.AttributeID = PAV.AttributeID
LEFT JOIN Unit
ON PAV.UnitID = Unit.UnitID
WHERE Attribute.AttributeGroupID = @AttributeGroupID
AND ProductAttributeValue.ProductID = @ProductID
ORDER BY Attribute.SortValue
" connection="Grocery" type="replace" use="raw">
<parameter name="ProductID" datatype="integer" direction="in"/>
<parameter name="AttributeGroupID" datatype="integer" direction="in"/>
</select>
</query>
<query id="SelectableAttributeValues" default="false">
<select name="SELECT ProductAttributeValue.ProductID,
Attribute.AttributeID,
Attribute.SortValue,
Attribute.Name As AttributeName ,
ProductAttributeValue.AttributeValue,
ProductAttributeValue.UnitID,
Unit.Name As UnitName,
Unit.ConvertRate
FROM Attribute
INNER JOIN SelectableAttributeInProdGroup
ON SelectableAttributeInProdGroup.AttributeID = Attribute.AttributeID
INNER JOIN ProductAttributeValue
ON ProductAttributeValue.AttributeID = SelectableAttributeInProdGroup.AttributeID
LEFT JOIN Unit
ON Unit.UnitID = ProductAttributeValue.UnitID
WHERE SelectableAttributeInProdGroup.ProductGroupID = @GroupID
AND ProductAttributeValue.ProductID = @ProductID
ORDER BY Attribute.SortValue
" connection="Grocery" type="replace" use="raw">
<parameter name="ProductID" datatype="integer" direction="in"/>
<parameter name="GroupID" datatype="integer" direction="in"/>
</select>
</query>
</datasource>
<properties>
<property name="ProductID" alias="ProductID" datatype="integer" nullable="false" pkey="true"/>
<property name="AttributeID" alias="AttributeID" datatype="integer" nullable="false" pkey="true"/>
<property name="SortValue" alias="SortValue" datatype="short" nullable="true" pkey="false"/>
<property name="AttributeName" alias="AttributeName" datatype="string" nullable="true" pkey="false"/>
<property name="AttributeValue" alias="AttributeValue" datatype="string" nullable="false" pkey="false"/>
<property name="UnitID" alias="UnitID" datatype="integer" nullable="true" pkey="false"/>
<property name="UnitName" alias="UnitName" datatype="string" nullable="true" pkey="false"/>
<property name="ConvertRate" alias="ConvertRate" datatype="float" nullable="true" pkey="false"/>
<property name="PartName" alias="PartName" datatype="string" nullable="true" pkey="false"/>
</properties>
</object>
<object name="ProductGroup">
<datasource>
<query id="ProductGroup" default="true">
<select name="SELECT ProductGroupID, Name FROM ProductGroup WHERE ProductGroupID = @ProductGroupID
" connection="Grocery" type="replace" use="raw">
<parameter name="ProductGroupID" datatype="integer" direction="in"/>
</select>
</query>
</datasource>
<properties>
<property name="ProductGroupID" alias="ProductGroupID" datatype="integer" nullable="false" pkey="true"/>
<property name="Name" alias="Name" datatype="string" nullable="true" pkey="false"/>
</properties>
<relationships>
<relationship name="SelectableAttributes" object="ProductAttribute" keyprop="none" collection="true" query="ProductGroupAttributes">
<key pkey="ProductGroupID" fkey="ProductGroupID" from="parent" to="child"/>
</relationship>
</relationships>
</object>
<object name="ProductOption">
<datasource>
<query id="ProductOptions" default="true">
<select name="SELECT DISTINCT ProductOption.ProductOptionID, ProductOption.Name, ProductOption.SortValue, @ProductID AS ProductID
FROM
ProductOptionValue
INNER JOIN ProductOption
ON ProductOptionValue.ProductOptionID = ProductOption.ProductOptionID
WHERE ProductID = @ProductID
ORDER BY ProductOption.SortValue
" connection="Grocery" type="replace" use="raw">
<parameter name="ProductID" datatype="integer" direction="in"/>
</select>
</query>
</datasource>
<properties>
<property name="ProductID" alias="ProductID" datatype="integer" nullable="true" pkey="false"/>
<property name="ProductOptionID" alias="ProductOptionID" datatype="integer" nullable="false" pkey="true"/>
<property name="Name" alias="Name" datatype="string" nullable="false" pkey="false"/>
<property name="SortValue" alias="SortValue" datatype="short" nullable="false" pkey="false"/>
</properties>
<relationships>
<relationship name="Values" object="ProductOptionValue" keyprop="none" collection="true" query="ProductOptionValues">
<key pkey="ProductID" fkey="ProductID" from="parent" to="child"/>
<key pkey="ProductOptionID" fkey="ProductOptionID" from="parent" to="child"/>
</relationship>
</relationships>
</object>
<object name="ProductOptionValue">
<datasource>
<query id="ProductOptionValues" default="true">
<select name="SELECT ProductID, ProductOptionID, SortValue, OptionValue, IsDefault
FROM ProductOptionValue
WHERE ProductID = @ProductID AND ProductOptionID = @ProductOptionID
ORDER BY SortValue
" connection="Grocery" type="replace" use="raw">
<parameter name="ProductID" datatype="integer" direction="in"/>
<parameter name="ProductOptionID" datatype="integer" direction="in"/>
</select>
</query>
</datasource>
<properties>
<property name="ProductID" alias="ProductID" datatype="integer" nullable="false" pkey="true"/>
<property name="ProductOptionID" alias="ProductOptionID" datatype="integer" nullable="false" pkey="true"/>
<property name="SortValue" alias="SortValue" datatype="short" nullable="false" pkey="true"/>
<property name="OptionValue" alias="OptionValue" datatype="string" nullable="false" pkey="false"/>
<property name="IsDefault" alias="IsDefault" datatype="boolean" nullable="false" pkey="false"/>
</properties>
</object>
<object name="Promo">
<datasource>
<query id="Promo" default="true">
<select name="SELECT
PromoID,
PromoType,
ImageID,
Description,
StartDate,
EndDate,
LoyaltyClubOnly,
IsOneTime
FROM Promo
WHERE PromoID=@PromoID
" connection="Grocery" type="replace" use="raw">
<parameter name="PromoID" datatype="integer" direction="in"/>
</select>
</query>
<query id="StoreBasketPromos" default="false">
<select name="SELECT DISTINCT
BasketItem.ItemNo,
Promo.PromoID,
PromoType,
Description,
LoyaltyClubOnly,
IsOneTime,
ProductInPromoSet.ProductID,
PromoSet.PromoSetID,
PromoSet.Quantity,
PromoSet.MaxQuantity,
PromoSet.LoyaltyPointsReward,
PromoSet.Reduction,
PromoSet.DiscountQuantity,
PromoSet.Discount,
PromoSet.CostThreshold,
PromoSet.CostMultiplier,
PromoSet.CostFrom,
PromoSet.CostTo,
PromoSet.CouponPromoID,
0 AS SetCount
FROM
Promo
INNER JOIN PromoInStore
ON PromoInStore.PromoID = Promo.PromoID
INNER JOIN PromoSet
ON PromoSet.PromoID = Promo.PromoID
LEFT JOIN ProductInPromoSet
ON ProductInPromoSet.PromoSetID = PromoSet.PromoSetID
INNER JOIN BasketItem
ON BasketItem.ProductID = ProductInPromoSet.ProductID
LEFT JOIN PromoSet AS AllSet
ON AllSet.PromoID = Promo.PromoID
WHERE
PromoInStore.StoreID = @StoreID
AND StartDate <= @IntroductionDate
AND EndDate > @IntroductionDate
AND BasketItem.CustomerID = @CustomerID
ORDER BY
Promo.PromoType,
Promo.PromoID,
PromoSet.PromoSetID" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="IntroductionDate" datatype="date" direction="in"/>
</select>
</query>
<query id="BasketPromos" default="false">
<select name="SELECT DISTINCT
BasketItem.ItemNo,
Promo.PromoID,
PromoType,
Description,
LoyaltyClubOnly,
IsOneTime,
ProductInPromoSet.ProductID,
PromoSet.PromoSetID,
PromoSet.Quantity,
PromoSet.MaxQuantity,
PromoSet.LoyaltyPointsReward,
PromoSet.Reduction,
PromoSet.DiscountQuantity,
PromoSet.Discount,
PromoSet.CostThreshold,
PromoSet.CostMultiplier,
PromoSet.CostFrom,
PromoSet.CostTo,
PromoSet.CouponPromoID,
0 AS SetCount
FROM
Promo
INNER JOIN PromoInStore
ON PromoInStore.PromoID = Promo.PromoID
INNER JOIN PromoSet
ON PromoSet.PromoID = Promo.PromoID
LEFT JOIN ProductInPromoSet
ON ProductInPromoSet.PromoSetID = PromoSet.PromoSetID
INNER JOIN BasketItem
ON BasketItem.ProductID = ProductInPromoSet.ProductID
LEFT JOIN PromoSet AS AllSet
ON AllSet.PromoID = Promo.PromoID
WHERE
PromoInStore.StoreID = @StoreID
AND StartDate <= @IntroductionDate
AND EndDate > @IntroductionDate
AND PromoType > 100
AND BasketItem.CustomerID = @CustomerID
ORDER BY
Promo.PromoType,
Promo.PromoID,
PromoSet.PromoSetID" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="IntroductionDate" datatype="date" direction="in"/>
</select>
</query>
<query id="CustomerStoreProductCoupons" default="false">
<select name="SELECT DISTINCT
Promo.PromoID,
ProductInPromoSet.ProductID
FROM
Coupon
INNER JOIN Promo
ON Promo.PromoID = Coupon.PromoID
INNER JOIN PromoInStore
ON PromoInStore.PromoID = Coupon.PromoID
INNER JOIN PromoSet
ON PromoSet.PromoID = Promo.PromoID
INNER JOIN ProductInPromoSet
ON ProductInPromoSet.PromoSetID = PromoSet.PromoSetID
WHERE
PromoInStore.StoreID = @StoreID
AND CustomerID = @CustomerID
AND StartDate <= @IntroductionDate
AND EndDate > @IntroductionDate
" connection="Grocery" type="replace" use="raw">
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="IntroductionDate" datatype="date" direction="in"/>
</select>
</query>
<query id="CustomerBasketCoupons" default="false">
<select name="SELECT DISTINCT
BasketItem.ItemNo,
Promo.PromoID,
PromoType,
Description,
LoyaltyClubOnly,
IsOneTime,
ProductInPromoSet.ProductID,
PromoSet.PromoSetID,
PromoSet.Quantity,
PromoSet.MaxQuantity,
PromoSet.LoyaltyPointsReward,
PromoSet.Reduction,
PromoSet.DiscountQuantity,
PromoSet.Discount,
PromoSet.CostThreshold,
PromoSet.CostMultiplier,
PromoSet.CostFrom,
PromoSet.CostTo,
PromoSet.CouponPromoID,
Coupon.CouponID,
0 AS SetCount
FROM
Promo
INNER JOIN Coupon
ON Coupon.PromoID = Promo.PromoID
INNER JOIN PromoSet
ON PromoSet.PromoID = Promo.PromoID
LEFT JOIN ProductInPromoSet
ON ProductInPromoSet.PromoSetID = PromoSet.PromoSetID
INNER JOIN BasketItem
ON BasketItem.ProductID = ProductInPromoSet.ProductID
LEFT JOIN PromoSet AS AllSet
ON AllSet.PromoID = Promo.PromoID
WHERE
Coupon.CustomerID = @CustomerID
AND StartDate <= @IntroductionDate
AND EndDate > @IntroductionDate
AND PromoType > 100
AND BasketItem.CustomerID = @CustomerID
ORDER BY
Promo.PromoType,
Promo.PromoID,
PromoSet.PromoSetID
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="IntroductionDate" datatype="date" direction="in"/>
</select>
</query>
<query id="CustomerProductCoupons" default="false">
<select name="SELECT DISTINCT
BasketItem.ItemNo,
Promo.PromoID,
PromoType,
Description,
LoyaltyClubOnly,
IsOneTime,
ProductInPromoSet.ProductID,
PromoSet.PromoSetID,
PromoSet.Quantity,
PromoSet.MaxQuantity,
PromoSet.LoyaltyPointsReward,
PromoSet.Reduction,
PromoSet.DiscountQuantity,
PromoSet.Discount,
PromoSet.CostThreshold,
PromoSet.CostMultiplier,
PromoSet.CostFrom,
PromoSet.CostTo,
PromoSet.CouponPromoID,
Coupon.CouponID,
0 AS SetCount
FROM
Promo
INNER JOIN Coupon
ON Coupon.PromoID = Promo.PromoID
INNER JOIN PromoSet
ON PromoSet.PromoID = Promo.PromoID
LEFT JOIN ProductInPromoSet
ON ProductInPromoSet.PromoSetID = PromoSet.PromoSetID
INNER JOIN BasketItem
ON BasketItem.ProductID = ProductInPromoSet.ProductID
LEFT JOIN PromoSet AS AllSet
ON AllSet.PromoID = Promo.PromoID
WHERE
Coupon.CustomerID = @CustomerID
AND StartDate <= @IntroductionDate
AND EndDate > @IntroductionDate
AND BasketItem.CustomerID = @CustomerID
ORDER BY
Promo.PromoType,
Promo.PromoID,
PromoSet.PromoSetID
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="IntroductionDate" datatype="date" direction="in"/>
</select>
</query>
<query id="CustomerAllCoupons" default="false">
<select name="SELECT
Promo.PromoID,
Description,
ImageID
FROM
Promo
INNER JOIN Coupon ON Coupon.PromoID = Promo.PromoID
WHERE
Coupon.CustomerID = @CustomerID
AND StartDate <= @IntroductionDate
AND EndDate > @IntroductionDate" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="IntroductionDate" datatype="date" direction="in"/>
</select>
</query>
<query id="StoreProductPromos" default="false">
<select name="SELECT DISTINCT
ProductInPromoSet.ProductID,
Promo.PromoID
FROM
Promo
INNER JOIN PromoInStore
ON PromoInStore.PromoID = Promo.PromoID
INNER JOIN PromoSet
ON PromoSet.PromoID = Promo.PromoID
INNER JOIN ProductInPromoSet
ON ProductInPromoSet.PromoSetID = PromoSet.PromoSetID
INNER JOIN ProductInStore
ON ProductInStore.ProductID = ProductInPromoSet.ProductID
WHERE
PromoInStore.StoreID = @StoreID
AND ProductInStore.StoreID = @StoreID
AND StartDate <= @IntroductionDate
AND EndDate > @IntroductionDate" connection="Grocery" type="replace" use="raw">
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="IntroductionDate" datatype="date" direction="in"/>
</select>
</query>
<query id="StoreAllPromos" default="false">
<select name="SELECT
Promo.PromoID,
Description,
ImageID
FROM
Promo
INNER JOIN PromoInStore ON PromoInStore.PromoID = Promo.PromoID
WHERE
PromoInStore.StoreID = @StoreID
AND StartDate <= @IntroductionDate
AND EndDate > @IntroductionDate
" connection="Grocery" type="replace" use="raw">
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="IntroductionDate" datatype="date" direction="in"/>
</select>
</query>
</datasource>
<properties>
<property name="PromoID" alias="PromoID" datatype="integer" nullable="false" pkey="false"/>
<property name="Description" alias="Description" datatype="string" nullable="true" pkey="false"/>
<property name="BasketItemNo" alias="BasketItemNo" datatype="integer" nullable="true" pkey="false"/>
<property name="PromoType" alias="PromoType" datatype="integer" nullable="true" pkey="false"/>
<property name="ImageID" alias="ImageID" datatype="integer" nullable="true" pkey="false"/>
<property name="ProductID" alias="ProductID" datatype="integer" nullable="true" pkey="false"/>
<property name="PromoSetID" alias="PromoSetID" datatype="integer" nullable="true" pkey="false"/>
<property name="Quantity" alias="Quantity" datatype="float" nullable="true" pkey="false"/>
<property name="MaxQuantity" alias="MaxQuantity" datatype="float" nullable="true" pkey="false"/>
<property name="Reduction" alias="Reduction" datatype="money" nullable="true" pkey="false"/>
<property name="DiscountQuantity" alias="DiscountQuantity" datatype="integer" nullable="true" pkey="false"/>
<property name="Discount" alias="Discount" datatype="float" nullable="true" pkey="false"/>
<property name="CostThreshold" alias="CostThreshold" datatype="money" nullable="true" pkey="false"/>
<property name="CostMultiplier" alias="CostMultiplier" datatype="money" nullable="true" pkey="false"/>
<property name="CostFrom" alias="CostFrom" datatype="money" nullable="true" pkey="false"/>
<property name="CostTo" alias="CostTo" datatype="money" nullable="true" pkey="false"/>
<property name="SetCount" alias="SetCount" datatype="integer" nullable="true" pkey="false"/>
<property name="LoyaltyClubOnly" alias="LoyaltyClubOnly" datatype="boolean" nullable="true" pkey="false"/>
<property name="IsOneTime" alias="IsOneTime" datatype="boolean" nullable="true" pkey="false"/>
<property name="ItemNo" alias="ItemNo" datatype="integer" nullable="true" pkey="false"/>
<property name="LoyaltyPointsCost" alias="LoyaltyPointsCost" datatype="money" nullable="true" pkey="false"/>
<property name="LoyaltyPointsReward" alias="LoyaltyPointsReward" datatype="money" nullable="true" pkey="false"/>
<property name="CouponPromoID" alias="CouponPromoID" datatype="integer" nullable="true" pkey="false"/>
<property name="CouponID" alias="CouponID" datatype="integer" nullable="true" pkey="false"/>
</properties>
<relationships>
<relationship name="Products" object="Product" keyprop="none" collection="true" query="StorePromoProducts">
<key pkey="PromoID" fkey="PromoID" from="parent" to="child"/>
<key pkey="StoreID" fkey="StoreID" from="parent" to="child"/>
</relationship>
<relationship name="PromoSets" object="PromoSet" keyprop="none" collection="true" query="PromoSets">
<key pkey="PromoID" fkey="PromoID" from="parent" to="child"/>
</relationship>
</relationships>
</object>
<object name="PromoSet">
<datasource>
<query id="PromoSets" default="false">
<select name="SELECT DISTINCT PromoSetID
FROM PromoSet
WHERE PromoID = @PromoID
" connection="Grocery" type="replace" use="raw">
<parameter name="PromoID" datatype="integer" direction="in"/>
</select>
</query>
</datasource>
<properties>
<property name="PromoID" alias="PromoID" datatype="integer" nullable="true" pkey="false"/>
<property name="PromoSetID" alias="PromoSetID" datatype="integer" nullable="true" pkey="false"/>
</properties>
</object>
<object name="Questionnaire">
<datasource>
<query id="Questionnaire" default="false">
<select name="SELECT
QuestionnaireQuestion.QuestionID,
QuestionnaireQuestion.Description,
QuestionnaireQuestion.Multichoice AS IsMultichoice,
QuestionnaireQuestion.Multiselect AS IsMultiselect,
QuestionnaireQuestion.Comment AS IsComment
FROM QuestionnaireQuestion
" connection="Grocery" type="replace" use="raw"/>
</query>
<query id="CustomerQuestionnaire" default="true">
<select name="SELECT
QuestionnaireQuestion.QuestionID,
QuestionnaireQuestion.Description,
QuestionnaireQuestion.Multichoice AS IsMultichoice,
QuestionnaireQuestion.Multiselect AS IsMultiselect,
QuestionnaireQuestion.Comment AS IsComment
FROM QuestionnaireQuestion
LEFT JOIN QuestionnaireResponse
ON QuestionnaireQuestion.QuestionID = QuestionnaireResponse.QuestionID
WHERE QuestionnaireResponse.CustomerID = NULL
AND QuestionnaireResponse.CustomerID = @CustomerID
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
</select>
<insert name="INSERT INTO
QuestionnaireResponse(CustomerID,QuestionID,AnswerID,Comment,CreateDate)
VALUES(@CustomerID, @QuestionID, @AnswerID, @Comment, GetDate())
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="QuestionID" datatype="integer" direction="in"/>
<parameter name="AnswerID" datatype="integer" direction="in"/>
<parameter name="Comment" datatype="string" direction="in"/>
</insert>
</query>
</datasource>
<properties>
<property name="QuestionID" alias="QuestionID" datatype="integer" nullable="false" pkey="true"/>
<property name="Description" alias="Description" datatype="string" nullable="false"/>
<property name="IsMultichoice" alias="IsMultichoice" datatype="boolean" nullable="false"/>
<property name="IsMultiselect" alias="IsMultiselect" datatype="boolean" nullable="false"/>
<property name="IsComment" alias="IsComment" datatype="boolean" nullable="false"/>
<property name="CustomerID" alias="CustomerID" datatype="integer" nullable="false" pkey="true"/>
<property name="AnswerID" alias="ResponseID" datatype="integer" nullable="false" pkey="true"/>
<property name="Comment" alias="Comment" datatype="string" nullable="false"/>
</properties>
<relationships>
<relationship name="QuestionnaireAnswers" object="QuestionnaireAnswer" keyprop="down" collection="true" query="QuestionnaireAnswers">
<key pkey="QuestionID" fkey="QuestionID" from="parent" to="child"/>
</relationship>
</relationships>
</object>
<object name="QuestionnaireAnswer">
<datasource>
<query id="QuestionnaireAnswers" default="true">
<select name="SELECT
QuestionnaireAnswer.QuestionID,
QuestionnaireAnswer.AnswerID,
QuestionnaireAnswer.Description
FROM QuestionnaireAnswer
INNER JOIN QuestionnaireQuestion
ON QuestionnaireAnswer.QuestionID = QuestionnaireQuestion.QuestionID
WHERE QuestionnaireQuestion.Comment = 0
AND QuestionnaireAnswer.QuestionID = @QuestionID
" connection="Grocery" type="replace" use="raw">
<parameter name="QuestionID" datatype="integer" direction="in"/>
</select>
</query>
</datasource>
<properties>
<property name="QuestionID" alias="QuestionID" datatype="integer" nullable="false" pkey="true"/>
<property name="AnswerID" alias="AnswerID" datatype="integer" nullable="false"/>
<property name="Description" alias="Description" datatype="string" nullable="false"/>
</properties>
</object>
<object name="Store">
<datasource>
<query id="Store" default="true">
<select name="SELECT
Store.StoreID,
Store.Name,
StoreInStoreGroup.StoreGroupID
FROM
Store
LEFT JOIN
StoreInStoreGroup
ON Store.StoreID = StoreInStoreGroup.StoreID
WHERE Store.StoreID = @StoreID
" connection="Grocery" type="replace" use="raw">
<parameter name="StoreID" datatype="integer" direction="in"/>
</select>
<update name="UPDATE Store
SET Name = @Name
WHERE StoreID = @StoreID
" connection="Grocery" type="replace" use="raw">
<parameter name="StoreID" datatype="integer" direction="in"/>
<parameter name="Name" datatype="string" direction="in"/>
</update>
</query>
<query id="SelectStoresInGroup" default="false">
<select name="SELECT
Store.StoreID,
Store.Name,
StoreInStoreGroup.StoreGroupID
FROM
Store
INNER JOIN StoreInStoreGroup
ON Store.StoreID = StoreInStoreGroup.StoreID
WHERE StoreInStoreGroup.StoreGroupID = @StoreGroupID
" connection="Grocery" type="replace" use="raw">
<parameter name="StoreGroupID" datatype="integer" direction="in"/>
</select>
</query>
</datasource>
<properties>
<property name="StoreID" alias="StoreID" datatype="integer" nullable="false" pkey="true"/>
<property name="Name" alias="Name" datatype="string" nullable="false"/>
<property name="StoreGroupID" alias="StoreGroupID" datatype="integer" nullable="true"/>
<property name="IntroductionDate" alias="IntroductionDate" datatype="date" nullable="true"/>
</properties>
<relationships>
<relationship name="Units" object="Unit" keyprop="none" collection="true" query="Units">
<key fkey="" pkey="" to="" from=""/>
</relationship>
<relationship name="Categories" object="Category" keyprop="none" collection="true" query="StoreCategories">
<key pkey="StoreID" fkey="StoreID" from="parent" to="child"/>
</relationship>
<relationship name="AdvancedSearchProductsWithAV" object="Product" keyprop="none" collection="true" query="AdvancedSearchStoreProductsWithAV">
<key pkey="StoreID" fkey="StoreID" from="parent" to="child"/>
<key pkey="TopLevelID" fkey="TopLevelID" from="parent" to="child"/>
<key pkey="AttributeID" fkey="AttributeID" from="parent" to="child"/>
<key pkey="SearchString" fkey="SearchString" from="parent" to="child"/>
<key pkey="IntroductionDate" fkey="IntroductionDate" from="parent" to="child"/>
</relationship>
<relationship name="AdvancedSearchProducts" object="Product" keyprop="none" collection="true" query="AdvancedSearchStoreProducts">
<key pkey="StoreID" fkey="StoreID" from="parent" to="child"/>
<key pkey="TopLevelID" fkey="TopLevelID" from="parent" to="child"/>
<key pkey="SearchString" fkey="SearchString" from="parent" to="child"/>
<key pkey="IntroductionDate" fkey="IntroductionDate" from="parent" to="child"/>
</relationship>
<relationship name="SearchProductsWithAV" object="Product" keyprop="none" collection="true" query="SearchStoreProductsWithAV">
<key pkey="StoreID" fkey="StoreID" from="parent" to="child"/>
<key pkey="AttributeID" fkey="AttributeID" from="parent" to="child"/>
<key pkey="SearchString" fkey="SearchString" from="parent" to="child"/>
<key pkey="IntroductionDate" fkey="IntroductionDate" from="parent" to="child"/>
</relationship>
<relationship name="SearchProducts" object="Product" keyprop="none" collection="true" query="SearchStoreProducts">
<key pkey="StoreID" fkey="StoreID" from="parent" to="child"/>
<key pkey="SearchString" fkey="SearchString" from="parent" to="child"/>
<key pkey="IntroductionDate" fkey="IntroductionDate" from="parent" to="child"/>
</relationship>
<relationship name="AdvancedSearchAttributes" object="ProductAttribute" keyprop="none" collection="true" query="AdvancedSearchStoreAttributes">
<key pkey="StoreID" fkey="StoreID" from="parent" to="child"/>
<key pkey="TopLevelID" fkey="TopLevelID" from="parent" to="child"/>
<key pkey="SearchString" fkey="SearchString" from="parent" to="child"/>
</relationship>
<relationship name="SearchAttributes" object="ProductAttribute" keyprop="none" collection="true" query="SearchStoreAttributes">
<key pkey="StoreID" fkey="StoreID" from="parent" to="child"/>
<key pkey="SearchString" fkey="SearchString" from="parent" to="child"/>
</relationship>
<relationship name="ProductPromos" object="Promo" keyprop="none" collection="true" query="StoreProductPromos">
<key pkey="StoreID" fkey="StoreID" from="parent" to="child"/>
<key pkey="IntroductionDate" fkey="IntroductionDate" from="parent" to="child"/>
</relationship>
<relationship name="Promos" object="Promo" keyprop="down" collection="true" query="StoreAllPromos">
<key pkey="StoreID" fkey="StoreID" from="parent" to="child"/>
<key pkey="IntroductionDate" fkey="IntroductionDate" from="parent" to="child"/>
</relationship>
<relationship name="DynamicProducts" object="Product" keyprop="none" collection="true" query="StoreDynamicProducts">
<key pkey="StoreID" fkey="StoreID" from="parent" to="child"/>
<key pkey="SearchString" fkey="SearchString" from="parent" to="child"/>
<key pkey="IntroductionDate" fkey="IntroductionDate" from="parent" to="child"/>
</relationship>
</relationships>
<methods>
<method name="FormatSearchClause" returntype="string" uuid="IcelandGrocery.Store" implname="FormatSearchClause">
<parameter name="sString" datatype="string" direction="in"/>
</method>
<method name="FormatDynamicClause" returntype="string" uuid="IcelandGrocery.Store" implname="FormatDynamicClause">
<parameter name="sString" datatype="string" direction="in"/>
</method>
</methods>
</object>
<object name="StoreGroup">
<datasource>
<query id="StoreGroup" default="true">
<select name="SELECT
StoreGroupID,
StoreGroupName,
ContentPath,
AllowProductNotes
FROM StoreGroup
WHERE StoreGroupID = @StoreGroupID
" connection="Grocery" type="replace" use="raw">
<parameter name="StoreGroupID" datatype="integer" direction="in"/>
</select>
</query>
</datasource>
<properties>
<property name="StoreGroupID" alias="StoreGroupID" datatype="integer" nullable="false" pkey="true"/>
<property name="StoreGroupName" alias="StoreGroupName" datatype="string" nullable="true"/>
<property name="ContentPath" alias="ContentPath" datatype="string" nullable="true"/>
<property name="AllowProductNotes" alias="AllowProductNotes" datatype="boolean" nullable="true"/>
</properties>
<relationships>
<relationship name="Stores" object="Store" keyprop="none" collection="true" query="SelectStoresInGroup">
<key fkey="StoreGroupID" pkey="StoreGroupID" from="parent" to="child"/>
</relationship>
</relationships>
</object>
<object name="Unit">
<datasource>
<query id="Units" default="true">
<select name="
SELECT
UnitID,
UnitGroupID,
Name,
ConvertRate,
IsInteger
FROM Unit" connection="Grocery" type="replace" use="raw"/>
</query>
</datasource>
<properties>
<property name="UnitID" alias="UnitID" datatype="integer" nullable="false" pkey="true"/>
<property name="UnitGroupID" alias="UnitGroupID" datatype="integer" nullable="false"/>
<property name="Name" alias="Name" datatype="string" nullable="false"/>
<property name="ConvertRate" alias="ConvertRate" datatype="float" nullable="false"/>
<property name="IsInteger" alias="IsInteger" datatype="boolean" nullable="false"/>
</properties>
<relationships/>
</object>
<object name="UsedOneTimePromo">
<datasource>
<query id="UsedOneTimePromo" default="true">
<select name="SELECT PromoID
FROM UsedOneTimePromo
WHERE CustomerID = @CustomerID AND PromoID = @PromoID
" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="PromoID" datatype="integer" direction="in"/>
</select>
<insert name="INSERT INTO UsedOneTimePromo(CustomerID, PromoID)
VALUES(@CustomerID, @PromoID)" connection="Grocery" type="replace" use="raw">
<parameter name="CustomerID" datatype="integer" direction="in"/>
<parameter name="PromoID" datatype="integer" direction="in"/>
</insert>
</query>
</datasource>
<properties>
<property name="CustomerID" alias="CustomerID" datatype="integer" nullable="false" pkey="true"/>
<property name="PromoID" alias="PromoID" datatype="integer" nullable="false" pkey="true"/>
</properties>
</object>
<object name="File">
<datasource>
<query id="WWWRoot" default="true">
<select name="" connection="WWWRoot" type="table" use="raw"/>
</query>
<query id="StoreContent" default="false">
<select name="" connection="StoreContent" type="table" use="raw"/>
</query>
</datasource>
<properties>
<property name="Name" alias="Name" datatype="string" nullable="false" pkey="true"/>
<property name="Size" alias="Size" datatype="integer" nullable="false"/>
<property name="Data" alias="Data" datatype="string" nullable="true"/>
<property name="Revision" alias="" datatype="long" nullable="true"/>
</properties>
<relationships>
<relationship name="WWWRoot" object="File" keyprop="down" collection="true" query="WWWRoot"/>
<relationship name="StoreContent" object="File" keyprop="down" collection="true" query="StoreContent"/>
</relationships>
</object>
</objects>
</model>
</models>