diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..2d4f90d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,12 @@
+[Oo]bj
+[Bb]in
+*.user
+*.suo
+*.[Cc]ache
+*.bak
+*.ncb
+*.log
+*.DS_Store
+[Tt]humbs.db
+_ReSharper.*
+*.svn
\ No newline at end of file
diff --git a/Administration/UpgrateDependencies.ps1 b/Administration/UpgrateDependencies.ps1
new file mode 100644
index 0000000..cc27c8f
Binary files /dev/null and b/Administration/UpgrateDependencies.ps1 differ
diff --git a/Build.bat b/Build.bat
new file mode 100644
index 0000000..05348ea
--- /dev/null
+++ b/Build.bat
@@ -0,0 +1,5 @@
+@echo off
+pushd Suteki.Shop
+nant\nant.exe
+popd
+pause
\ No newline at end of file
diff --git a/CompileViews.bat b/CompileViews.bat
new file mode 100644
index 0000000..87ccbf2
--- /dev/null
+++ b/CompileViews.bat
@@ -0,0 +1,5 @@
+@echo off
+pushd Suteki.Shop
+nant\nant.exe compile-views
+popd
+pause
\ No newline at end of file
diff --git a/Database/001_create_database.sql b/Database/001_create_database.sql
new file mode 100644
index 0000000..85ab92c
Binary files /dev/null and b/Database/001_create_database.sql differ
diff --git a/Database/002_insert_static_data.sql b/Database/002_insert_static_data.sql
new file mode 100644
index 0000000..0bb4856
--- /dev/null
+++ b/Database/002_insert_static_data.sql
@@ -0,0 +1,58 @@
+use SutekiShop
+
+
+insert [role] (RoleId, [Name]) values(1, 'Administrator')
+insert [role] (RoleId, [Name]) values(2, 'Order Processor')
+insert [role] (RoleId, [Name]) values(3, 'Customer')
+insert [role] (RoleId, [Name]) values(4, 'Guest')
+
+insert [user] (Email, [Password], RoleId, IsEnabled)
+ values('admin@sutekishop.co.uk', 'D033E22AE348AEB5660FC2140AEC35850C4DA997', 1, 1)
+
+set identity_insert category on
+insert category (CategoryId, [Name], ParentId, Position, IsActive) values(1, '- Root', null, 1, 1)
+set identity_insert category off
+
+insert CardType values(1, 'Visa / Delta / Electron', 0)
+insert CardType values(2, 'Master Card / Euro Card', 0)
+insert CardType values(3, 'American Express', 0)
+insert CardType values(4, 'Switch / Solo / Maestro', 1)
+
+insert OrderStatus values(1, 'Created')
+insert OrderStatus values(2, 'Dispatched')
+insert OrderStatus values(3, 'Rejected')
+
+insert ContentType values(1, 'Menu')
+insert ContentType values(2, 'Text')
+insert ContentType values(3, 'Action')
+insert ContentType values(4, 'Top')
+
+set identity_insert [content] on
+
+insert [content](contentId, parentContentId, contentTypeId, [name], UrlName, [text], controller, [action], position, isActive)
+values(1, null, 1, 'Main Menu', 'Main_menu', null, null, null, 1, 1)
+
+insert [content](contentId, parentContentId, contentTypeId, [name], UrlName, [text], controller, [action], position, isActive)
+values(2, 1, 4, 'Home', 'Home', 'Homepage Content', null, null, 2, 1)
+
+insert [content](contentId, parentContentId, contentTypeId, [name], UrlName, [text], controller, [action], position, isActive)
+values(3, 1, 3, 'Online Shop', 'Online_Shop', null, 'Home', 'Index', 3, 1)
+
+insert [content](contentId, parentContentId, contentTypeId, [name], UrlName, [text], controller, [action], position, isActive)
+values(4, null, 2, 'Shopfront', 'Shopfront', '
Wecome to our online shop
', null, null, 4, 1)
+
+set identity_insert [content] off
+
+set identity_insert PostZone on
+
+insert PostZone (PostZoneId, [Name], Multiplier, AskIfMaxWeight, Position, IsActive, FlatRate)
+values(1, 'United Kingdom', 1, 0, 1, 1, 10)
+
+set identity_insert PostZone off
+
+set identity_insert [Country] on
+
+insert [Country] (CountryId, [Name], Position, IsActive, PostZoneId)
+values(1, 'United Kingdom', 1, 1, 1)
+
+set identity_insert [Country] off
\ No newline at end of file
diff --git a/Database/003_Add_notes_to_order.sql b/Database/003_Add_notes_to_order.sql
new file mode 100644
index 0000000..d090bdd
--- /dev/null
+++ b/Database/003_Add_notes_to_order.sql
@@ -0,0 +1,3 @@
+use SutekiShop
+ALTER TABLE dbo.[Order]
+ADD Note nvarchar(1000) NULL
\ No newline at end of file
diff --git a/Database/004_Add_CategoryImage.sql b/Database/004_Add_CategoryImage.sql
new file mode 100644
index 0000000..de39a82
--- /dev/null
+++ b/Database/004_Add_CategoryImage.sql
@@ -0,0 +1,3 @@
+use SutekiShop
+alter table Category
+ ADD ImageId int
\ No newline at end of file
diff --git a/Database/005_Add_ContactMe_To_Order.sql b/Database/005_Add_ContactMe_To_Order.sql
new file mode 100644
index 0000000..fa57611
--- /dev/null
+++ b/Database/005_Add_ContactMe_To_Order.sql
@@ -0,0 +1,3 @@
+use SutekiShop
+ALTER TABLE dbo.[Order] ADD
+ ContactMe bit NOT NULL CONSTRAINT DF_Order_ContactMe DEFAULT 0
\ No newline at end of file
diff --git a/Database/006_Change_products_to_have_many_categories.sql b/Database/006_Change_products_to_have_many_categories.sql
new file mode 100644
index 0000000..17f88df
--- /dev/null
+++ b/Database/006_Change_products_to_have_many_categories.sql
@@ -0,0 +1,41 @@
+use SutekiShop
+create table ProductCategory (
+ Id int not null identity(1, 1),
+ ProductId int not null,
+ CategoryId int not null
+) ON [PRIMARY]
+
+ALTER TABLE ProductCategory ADD CONSTRAINT PK_ProductCategory PRIMARY KEY CLUSTERED (
+ Id
+) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
+
+insert into ProductCategory (ProductId, CategoryId)
+select ProductId, CategoryId from Product
+
+ALTER TABLE dbo.ProductCategory ADD CONSTRAINT
+ FK_ProductCategory_Category FOREIGN KEY
+ (
+ CategoryId
+ ) REFERENCES dbo.Category
+ (
+ CategoryId
+ ) ON UPDATE NO ACTION
+ ON DELETE NO ACTION
+
+
+ALTER TABLE dbo.ProductCategory ADD CONSTRAINT
+ FK_ProductCategory_Product FOREIGN KEY
+ (
+ ProductId
+ ) REFERENCES dbo.Product
+ (
+ ProductId
+ ) ON UPDATE NO ACTION
+ ON DELETE NO ACTION
+
+
+alter table Product
+ drop constraint FK_Product_Category
+
+alter table Product
+ drop column CategoryId
\ No newline at end of file
diff --git a/Database/007_Add_pending_status.sql b/Database/007_Add_pending_status.sql
new file mode 100644
index 0000000..ff3247c
--- /dev/null
+++ b/Database/007_Add_pending_status.sql
@@ -0,0 +1,3 @@
+use SutekiShop
+insert into OrderStatus (OrderStatusId, Name)
+VALUES (0, 'Pending')
\ No newline at end of file
diff --git a/Database/008_Add_Reviews.sql b/Database/008_Add_Reviews.sql
new file mode 100644
index 0000000..7fa4c4f
--- /dev/null
+++ b/Database/008_Add_Reviews.sql
@@ -0,0 +1,14 @@
+use SutekiShop
+CREATE TABLE dbo.Review (
+ Id int NOT NULL IDENTITY (1, 1),
+ ProductId int NOT NULL,
+ Approved bit NOT NULL,
+ [Text] nvarchar(MAX) NULL,
+ Reviewer nvarchar(250),
+ Rating int
+) ON [PRIMARY]
+TEXTIMAGE_ON [PRIMARY]
+
+ALTER TABLE dbo.Review ADD CONSTRAINT PK_Review PRIMARY KEY CLUSTERED (
+ Id
+) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
\ No newline at end of file
diff --git a/Database/009_Add_MailingListSubscriptions.sql b/Database/009_Add_MailingListSubscriptions.sql
new file mode 100644
index 0000000..70a3362
--- /dev/null
+++ b/Database/009_Add_MailingListSubscriptions.sql
@@ -0,0 +1,34 @@
+use SutekiShop
+GO
+CREATE TABLE dbo.MailingListSubscription
+(
+ Id int NOT NULL IDENTITY (1, 1),
+ ContactId int NOT NULL,
+ Email nvarchar(250) NOT NULL,
+ DateSubscribed datetime NOT NULL CONSTRAINT DF_MailingListSubscription_DateSubscribed DEFAULT getdate()
+) ON [PRIMARY]
+GO
+ALTER TABLE dbo.MailingListSubscription ADD CONSTRAINT
+ PK_MailingListSubscription PRIMARY KEY CLUSTERED
+ (
+ Id
+ ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
+
+GO
+
+ALTER TABLE dbo.MailingListSubscription ADD CONSTRAINT
+FK_MailingListSubscription_Contact FOREIGN KEY
+(
+ ContactId
+) REFERENCES dbo.Contact
+(
+ ContactId
+) ON UPDATE NO ACTION
+ON DELETE NO ACTION
+
+GO
+
+IF NOT EXISTS(select * from Content where Name = 'Mailing List')
+ INSERT INTO Content (ParentContentId, ContentTypeId, Name, UrlName, Controller, Action, IsActive, Position)
+ VALUES (1, 3, 'Mailing List', 'Mailing_List', 'MailingList', 'Index', 1, 20)
+GO
diff --git a/Database/010_Update_For_NH_changes.sql b/Database/010_Update_For_NH_changes.sql
new file mode 100644
index 0000000..0418406
--- /dev/null
+++ b/Database/010_Update_For_NH_changes.sql
@@ -0,0 +1,20 @@
+
+-- update db for NH changes
+use SutekiShop
+
+alter table [Content]
+ add ContentType varchar(50)
+go
+update [Content] set ContentType = 'Menu' where ContentTypeId = 1
+update [Content] set ContentType = 'TextContent' where ContentTypeId = 2
+update [Content] set ContentType = 'ActionContent' where ContentTypeId = 3
+update [Content] set ContentType = 'TopContent' where ContentTypeId = 4
+
+exec sp_rename 'ProductCategory.Id', 'ProductCategoryId'
+go
+exec sp_rename 'Review.Id', 'ReviewId'
+go
+exec sp_rename 'MailingListSubscription.Id', 'MailingListSubscriptionId'
+go
+
+
diff --git a/Database/011_Update_for_modified_order_processing.sql b/Database/011_Update_for_modified_order_processing.sql
new file mode 100644
index 0000000..2549957
Binary files /dev/null and b/Database/011_Update_for_modified_order_processing.sql differ
diff --git a/Database/012_Update_orderLines_with_productUrlName.sql b/Database/012_Update_orderLines_with_productUrlName.sql
new file mode 100644
index 0000000..6c95bc6
--- /dev/null
+++ b/Database/012_Update_orderLines_with_productUrlName.sql
@@ -0,0 +1,16 @@
+alter table OrderLine
+add ProductUrlName nvarchar(255) null
+
+update OrderLine set ProductUrlName = ''
+
+update OrderLine set ProductUrlName = p.UrlName
+from OrderLine l
+join Product p on SUBSTRING(l.ProductName, 0, CHARINDEX(' - ', l.ProductName, 0)) = p.Name
+
+update OrderLine set ProductUrlName = p.UrlName
+from OrderLine l
+join Product p on l.ProductName = p.Name
+
+update OrderLine set ProductUrlName = p.UrlName
+from OrderLine l
+join Product p on SUBSTRING(l.ProductName, 0, CHARINDEX(' - ', l.ProductName, CHARINDEX(' - ', l.ProductName, 0)+1)) = p.Name
diff --git a/Database/013_Update_for_new_review_and_order_adjustment_schema.sql b/Database/013_Update_for_new_review_and_order_adjustment_schema.sql
new file mode 100644
index 0000000..70877a7
Binary files /dev/null and b/Database/013_Update_for_new_review_and_order_adjustment_schema.sql differ
diff --git a/Database/014_Update_to_2.2.0.492.sql b/Database/014_Update_to_2.2.0.492.sql
new file mode 100644
index 0000000..7c5b571
--- /dev/null
+++ b/Database/014_Update_to_2.2.0.492.sql
@@ -0,0 +1,910 @@
+/*
+Upgrade Suteki Shop database to version 2.2.0.492
+
+Script created by SQL Compare version 9.0.0 from Red Gate Software Ltd at 20/02/2011 10:30:31
+Additional data tweeks by Mike Hadlow
+*/
+SET NUMERIC_ROUNDABORT OFF
+GO
+SET ANSI_PADDING, ANSI_WARNINGS, CONCAT_NULL_YIELDS_NULL, ARITHABORT, QUOTED_IDENTIFIER, ANSI_NULLS ON
+GO
+IF EXISTS (SELECT * FROM tempdb..sysobjects WHERE id=OBJECT_ID('tempdb..#tmpErrors')) DROP TABLE #tmpErrors
+GO
+CREATE TABLE #tmpErrors (Error int)
+GO
+SET XACT_ABORT ON
+GO
+SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
+GO
+BEGIN TRANSACTION
+GO
+PRINT N'Dropping foreign keys from [dbo].[Content]'
+GO
+ALTER TABLE [dbo].[Content] DROP
+CONSTRAINT [FK4FEDF4B6E53A5F80],
+CONSTRAINT [FK4FEDF4B6722A22C5]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping foreign keys from [dbo].[BasketItem]'
+GO
+ALTER TABLE [dbo].[BasketItem] DROP
+CONSTRAINT [FK729387BD8B64590B],
+CONSTRAINT [FK729387BD318371E4]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping foreign keys from [dbo].[Order]'
+GO
+ALTER TABLE [dbo].[Order] DROP
+CONSTRAINT [FK3117099BB1026BB4],
+CONSTRAINT [FK3117099B6BE90924],
+CONSTRAINT [FK3117099B9A379CC1],
+CONSTRAINT [FK3117099BD8D66880],
+CONSTRAINT [FK3117099B8703A8E0],
+CONSTRAINT [FK3117099BA708CB3A]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping foreign keys from [dbo].[ProductCategory]'
+GO
+ALTER TABLE [dbo].[ProductCategory] DROP
+CONSTRAINT [FK4022F9D7EEC058F7],
+CONSTRAINT [FK4022F9D7655B84E7]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping foreign keys from [dbo].[Category]'
+GO
+ALTER TABLE [dbo].[Category] DROP
+CONSTRAINT [FK6482F24565E1830],
+CONSTRAINT [FK6482F242EC1B23E]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping foreign keys from [dbo].[Comment]'
+GO
+ALTER TABLE [dbo].[Comment] DROP
+CONSTRAINT [FKE24667035273ED9D]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping foreign keys from [dbo].[MailingListSubscription]'
+GO
+ALTER TABLE [dbo].[MailingListSubscription] DROP
+CONSTRAINT [FK1CD411ADF3F5630]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping foreign keys from [dbo].[Contact]'
+GO
+ALTER TABLE [dbo].[Contact] DROP
+CONSTRAINT [FK4FF8F4B2350E3BF0]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping foreign keys from [dbo].[Basket]'
+GO
+ALTER TABLE [dbo].[Basket] DROP
+CONSTRAINT [FKD4474AC2350E3BF0],
+CONSTRAINT [FKD4474AC28703A8E0]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping foreign keys from [dbo].[Review]'
+GO
+ALTER TABLE [dbo].[Review] DROP
+CONSTRAINT [FKD28CAB635273ED9D],
+CONSTRAINT [FKD28CAB63655B84E7]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping foreign keys from [dbo].[ProductImage]'
+GO
+ALTER TABLE [dbo].[ProductImage] DROP
+CONSTRAINT [FKD8C46FDB2EC1B23E],
+CONSTRAINT [FKD8C46FDB655B84E7]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping foreign keys from [dbo].[OrderLine]'
+GO
+ALTER TABLE [dbo].[OrderLine] DROP
+CONSTRAINT [FK9D642A8F71931278]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping foreign keys from [dbo].[OrderAdjustment]'
+GO
+ALTER TABLE [dbo].[OrderAdjustment] DROP
+CONSTRAINT [FKF3A9DF3A71931278]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping foreign keys from [dbo].[Country]'
+GO
+ALTER TABLE [dbo].[Country] DROP
+CONSTRAINT [FK2ABF29C369941CDB]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping foreign keys from [dbo].[Size]'
+GO
+ALTER TABLE [dbo].[Size] DROP
+CONSTRAINT [FKF1577525655B84E7]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping foreign keys from [dbo].[User]'
+GO
+ALTER TABLE [dbo].[User] DROP
+CONSTRAINT [FK7185C17CEF538E9E]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping constraints from [dbo].[Basket]'
+GO
+ALTER TABLE [dbo].[Basket] DROP CONSTRAINT [PK__Basket__8FDA77B50EA330E9]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping constraints from [dbo].[BasketItem]'
+GO
+ALTER TABLE [dbo].[BasketItem] DROP CONSTRAINT [PK__BasketIt__6051AA0B403A8C7D]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping constraints from [dbo].[Card]'
+GO
+ALTER TABLE [dbo].[Card] DROP CONSTRAINT [PK__Card__55FECDAE4F7CD00D]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping constraints from [dbo].[Category]'
+GO
+ALTER TABLE [dbo].[Category] DROP CONSTRAINT [PK__Category__19093A0B07020F21]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping constraints from [dbo].[Comment]'
+GO
+ALTER TABLE [dbo].[Comment] DROP CONSTRAINT [PK__Comment__9A61929130F848ED]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping constraints from [dbo].[Contact]'
+GO
+ALTER TABLE [dbo].[Contact] DROP CONSTRAINT [PK__Contact__5C66259B03317E3D]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping constraints from [dbo].[Content]'
+GO
+ALTER TABLE [dbo].[Content] DROP CONSTRAINT [PK__Content__2907A81E1A14E395]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping constraints from [dbo].[Country]'
+GO
+ALTER TABLE [dbo].[Country] DROP CONSTRAINT [PK__Country__10D1609F47DBAE45]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping constraints from [dbo].[IComment]'
+GO
+ALTER TABLE [dbo].[IComment] DROP CONSTRAINT [PK__IComment__5ADFDE572D27B809]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping constraints from [dbo].[Image]'
+GO
+ALTER TABLE [dbo].[Image] DROP CONSTRAINT [PK__Image__7516F70C164452B1]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping constraints from [dbo].[MailingListSubscription]'
+GO
+ALTER TABLE [dbo].[MailingListSubscription] DROP CONSTRAINT [PK__MailingL__75B998BF5AEE82B9]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping constraints from [dbo].[Order]'
+GO
+ALTER TABLE [dbo].[Order] DROP CONSTRAINT [PK__Order__C3905BCF534D60F1]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping constraints from [dbo].[OrderAdjustment]'
+GO
+ALTER TABLE [dbo].[OrderAdjustment] DROP CONSTRAINT [PK__OrderAdj__CDB07B715EBF139D]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping constraints from [dbo].[OrderLine]'
+GO
+ALTER TABLE [dbo].[OrderLine] DROP CONSTRAINT [PK__OrderLin__29068A107F60ED59]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping constraints from [dbo].[OrderStatus]'
+GO
+ALTER TABLE [dbo].[OrderStatus] DROP CONSTRAINT [PK__OrderSta__BC674CA129572725]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping constraints from [dbo].[Postage]'
+GO
+ALTER TABLE [dbo].[Postage] DROP CONSTRAINT [PK__Postage__203F354A3C69FB99]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping constraints from [dbo].[PostZone]'
+GO
+ALTER TABLE [dbo].[PostZone] DROP CONSTRAINT [PK__PostZone__F5DC874238996AB5]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping constraints from [dbo].[Product]'
+GO
+ALTER TABLE [dbo].[Product] DROP CONSTRAINT [PK__Product__B40CC6CD1273C1CD]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping constraints from [dbo].[ProductCategory]'
+GO
+ALTER TABLE [dbo].[ProductCategory] DROP CONSTRAINT [PK__ProductC__3224ECCE25869641]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping constraints from [dbo].[ProductImage]'
+GO
+ALTER TABLE [dbo].[ProductImage] DROP CONSTRAINT [PK__ProductI__07B2B1B8571DF1D5]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping constraints from [dbo].[Review]'
+GO
+ALTER TABLE [dbo].[Review] DROP CONSTRAINT [PK__Review__9A61929134C8D9D1]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping constraints from [dbo].[Role]'
+GO
+ALTER TABLE [dbo].[Role] DROP CONSTRAINT [PK__Role__8AFACE1A1DE57479]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping constraints from [dbo].[Size]'
+GO
+ALTER TABLE [dbo].[Size] DROP CONSTRAINT [PK__Size__83BD097A4BAC3F29]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping constraints from [dbo].[User]'
+GO
+ALTER TABLE [dbo].[User] DROP CONSTRAINT [PK__User__1788CC4C21B6055D]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping constraints from [dbo].[ContentType]'
+GO
+ALTER TABLE [dbo].[ContentType] DROP CONSTRAINT [PK__ContentT__2026064A440B1D61]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Dropping [dbo].[ContentType]'
+GO
+DROP TABLE [dbo].[ContentType]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Altering [dbo].[OrderLine]'
+GO
+ALTER TABLE [dbo].[OrderLine] ADD
+[ProductId] [int] NULL,
+[SizeName] [nvarchar] (255) COLLATE Latin1_General_CI_AS NULL
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating primary key [PK__OrderLin__29068A1034C8D9D1] on [dbo].[OrderLine]'
+GO
+ALTER TABLE [dbo].[OrderLine] ADD CONSTRAINT [PK__OrderLin__29068A1034C8D9D1] PRIMARY KEY CLUSTERED ([OrderLineId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating [dbo].[StockItem]'
+GO
+CREATE TABLE [dbo].[StockItem]
+(
+[StockItemId] [int] NOT NULL IDENTITY(1, 1),
+[Level] [int] NULL,
+[IsActive] [bit] NULL,
+[ProductName] [nvarchar] (255) COLLATE Latin1_General_CI_AS NULL,
+[SizeName] [nvarchar] (255) COLLATE Latin1_General_CI_AS NULL
+)
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating primary key [PK__StockIte__454484BC628FA481] on [dbo].[StockItem]'
+GO
+ALTER TABLE [dbo].[StockItem] ADD CONSTRAINT [PK__StockIte__454484BC628FA481] PRIMARY KEY CLUSTERED ([StockItemId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating [dbo].[StockItemHistoryBase]'
+GO
+CREATE TABLE [dbo].[StockItemHistoryBase]
+(
+[StockItemHistoryBaseId] [int] NOT NULL IDENTITY(1, 1),
+[StockItemHistoryType] [nvarchar] (255) COLLATE Latin1_General_CI_AS NOT NULL,
+[DateTime] [datetime] NULL,
+[User] [nvarchar] (255) COLLATE Latin1_General_CI_AS NULL,
+[Level] [int] NULL,
+[Comment] [nvarchar] (255) COLLATE Latin1_General_CI_AS NULL,
+[StockItemId] [int] NULL,
+[NumberOfItemsDispatched] [int] NULL,
+[OrderNumber] [int] NULL,
+[NumberOfItemsRecieved] [int] NULL,
+[NewLevel] [int] NULL,
+[OldProductName] [nvarchar] (255) COLLATE Latin1_General_CI_AS NULL,
+[NewProductName] [nvarchar] (255) COLLATE Latin1_General_CI_AS NULL
+)
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating primary key [PK__StockIte__D0EE2EF65EBF139D] on [dbo].[StockItemHistoryBase]'
+GO
+ALTER TABLE [dbo].[StockItemHistoryBase] ADD CONSTRAINT [PK__StockIte__D0EE2EF65EBF139D] PRIMARY KEY CLUSTERED ([StockItemHistoryBaseId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Altering [dbo].[Content]'
+GO
+ALTER TABLE [dbo].[Content] DROP
+COLUMN [ContentTypeId]
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating primary key [PK__Content__2907A81E21B6055D] on [dbo].[Content]'
+GO
+ALTER TABLE [dbo].[Content] ADD CONSTRAINT [PK__Content__2907A81E21B6055D] PRIMARY KEY CLUSTERED ([ContentId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating primary key [PK__Basket__8FDA77B503317E3D] on [dbo].[Basket]'
+GO
+ALTER TABLE [dbo].[Basket] ADD CONSTRAINT [PK__Basket__8FDA77B503317E3D] PRIMARY KEY CLUSTERED ([BasketId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating primary key [PK__BasketIt__6051AA0B7F60ED59] on [dbo].[BasketItem]'
+GO
+ALTER TABLE [dbo].[BasketItem] ADD CONSTRAINT [PK__BasketIt__6051AA0B7F60ED59] PRIMARY KEY CLUSTERED ([BasketItemId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating primary key [PK__Card__55FECDAE07020F21] on [dbo].[Card]'
+GO
+ALTER TABLE [dbo].[Card] ADD CONSTRAINT [PK__Card__55FECDAE07020F21] PRIMARY KEY CLUSTERED ([CardId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating primary key [PK__Category__19093A0B0EA330E9] on [dbo].[Category]'
+GO
+ALTER TABLE [dbo].[Category] ADD CONSTRAINT [PK__Category__19093A0B0EA330E9] PRIMARY KEY CLUSTERED ([CategoryId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating primary key [PK__Comment__9A619291164452B1] on [dbo].[Comment]'
+GO
+ALTER TABLE [dbo].[Comment] ADD CONSTRAINT [PK__Comment__9A619291164452B1] PRIMARY KEY CLUSTERED ([ObjectId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating primary key [PK__Contact__5C66259B1DE57479] on [dbo].[Contact]'
+GO
+ALTER TABLE [dbo].[Contact] ADD CONSTRAINT [PK__Contact__5C66259B1DE57479] PRIMARY KEY CLUSTERED ([ContactId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating primary key [PK__Country__10D1609F25869641] on [dbo].[Country]'
+GO
+ALTER TABLE [dbo].[Country] ADD CONSTRAINT [PK__Country__10D1609F25869641] PRIMARY KEY CLUSTERED ([CountryId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating primary key [PK__IComment__5ADFDE571273C1CD] on [dbo].[IComment]'
+GO
+ALTER TABLE [dbo].[IComment] ADD CONSTRAINT [PK__IComment__5ADFDE571273C1CD] PRIMARY KEY CLUSTERED ([ICommentId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating primary key [PK__Image__7516F70C29572725] on [dbo].[Image]'
+GO
+ALTER TABLE [dbo].[Image] ADD CONSTRAINT [PK__Image__7516F70C29572725] PRIMARY KEY CLUSTERED ([ImageId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating primary key [PK__MailingL__75B998BF2D27B809] on [dbo].[MailingListSubscription]'
+GO
+ALTER TABLE [dbo].[MailingListSubscription] ADD CONSTRAINT [PK__MailingL__75B998BF2D27B809] PRIMARY KEY CLUSTERED ([MailingListSubscriptionId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating primary key [PK__Order__C3905BCF38996AB5] on [dbo].[Order]'
+GO
+ALTER TABLE [dbo].[Order] ADD CONSTRAINT [PK__Order__C3905BCF38996AB5] PRIMARY KEY CLUSTERED ([OrderId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating primary key [PK__OrderAdj__CDB07B7130F848ED] on [dbo].[OrderAdjustment]'
+GO
+ALTER TABLE [dbo].[OrderAdjustment] ADD CONSTRAINT [PK__OrderAdj__CDB07B7130F848ED] PRIMARY KEY CLUSTERED ([OrderAdjustmentId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating primary key [PK__OrderSta__BC674CA13C69FB99] on [dbo].[OrderStatus]'
+GO
+ALTER TABLE [dbo].[OrderStatus] ADD CONSTRAINT [PK__OrderSta__BC674CA13C69FB99] PRIMARY KEY CLUSTERED ([OrderStatusId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating primary key [PK__Postage__203F354A403A8C7D] on [dbo].[Postage]'
+GO
+ALTER TABLE [dbo].[Postage] ADD CONSTRAINT [PK__Postage__203F354A403A8C7D] PRIMARY KEY CLUSTERED ([PostageId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating primary key [PK__PostZone__F5DC8742440B1D61] on [dbo].[PostZone]'
+GO
+ALTER TABLE [dbo].[PostZone] ADD CONSTRAINT [PK__PostZone__F5DC8742440B1D61] PRIMARY KEY CLUSTERED ([PostZoneId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating primary key [PK__Product__B40CC6CD4F7CD00D] on [dbo].[Product]'
+GO
+ALTER TABLE [dbo].[Product] ADD CONSTRAINT [PK__Product__B40CC6CD4F7CD00D] PRIMARY KEY CLUSTERED ([ProductId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating primary key [PK__ProductC__3224ECCE47DBAE45] on [dbo].[ProductCategory]'
+GO
+ALTER TABLE [dbo].[ProductCategory] ADD CONSTRAINT [PK__ProductC__3224ECCE47DBAE45] PRIMARY KEY CLUSTERED ([ProductCategoryId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating primary key [PK__ProductI__07B2B1B84BAC3F29] on [dbo].[ProductImage]'
+GO
+ALTER TABLE [dbo].[ProductImage] ADD CONSTRAINT [PK__ProductI__07B2B1B84BAC3F29] PRIMARY KEY CLUSTERED ([ProductImageId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating primary key [PK__Review__9A6192911A14E395] on [dbo].[Review]'
+GO
+ALTER TABLE [dbo].[Review] ADD CONSTRAINT [PK__Review__9A6192911A14E395] PRIMARY KEY CLUSTERED ([ObjectId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating primary key [PK__Role__8AFACE1A534D60F1] on [dbo].[Role]'
+GO
+ALTER TABLE [dbo].[Role] ADD CONSTRAINT [PK__Role__8AFACE1A534D60F1] PRIMARY KEY CLUSTERED ([RoleId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating primary key [PK__Size__83BD097A571DF1D5] on [dbo].[Size]'
+GO
+ALTER TABLE [dbo].[Size] ADD CONSTRAINT [PK__Size__83BD097A571DF1D5] PRIMARY KEY CLUSTERED ([SizeId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Creating primary key [PK__User__1788CC4C5AEE82B9] on [dbo].[User]'
+GO
+ALTER TABLE [dbo].[User] ADD CONSTRAINT [PK__User__1788CC4C5AEE82B9] PRIMARY KEY CLUSTERED ([UserId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Adding foreign keys to [dbo].[Content]'
+GO
+ALTER TABLE [dbo].[Content] ADD
+CONSTRAINT [FK4FEDF4B6B6D51D18] FOREIGN KEY ([ParentContentId]) REFERENCES [dbo].[Content] ([ContentId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Adding foreign keys to [dbo].[StockItemHistoryBase]'
+GO
+ALTER TABLE [dbo].[StockItemHistoryBase] ADD
+CONSTRAINT [FKBAB29AA9D1E5AA7A] FOREIGN KEY ([StockItemId]) REFERENCES [dbo].[StockItem] ([StockItemId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Adding foreign keys to [dbo].[BasketItem]'
+GO
+ALTER TABLE [dbo].[BasketItem] ADD
+CONSTRAINT [FK729387BD8B64590B] FOREIGN KEY ([BasketId]) REFERENCES [dbo].[Basket] ([BasketId]),
+CONSTRAINT [FK729387BD318371E4] FOREIGN KEY ([SizeId]) REFERENCES [dbo].[Size] ([SizeId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Adding foreign keys to [dbo].[Order]'
+GO
+ALTER TABLE [dbo].[Order] ADD
+CONSTRAINT [FK3117099BB1026BB4] FOREIGN KEY ([CardId]) REFERENCES [dbo].[Card] ([CardId]),
+CONSTRAINT [FK3117099B6BE90924] FOREIGN KEY ([DeliveryContactId]) REFERENCES [dbo].[Contact] ([ContactId]),
+CONSTRAINT [FK3117099B9A379CC1] FOREIGN KEY ([CardContactId]) REFERENCES [dbo].[Contact] ([ContactId]),
+CONSTRAINT [FK3117099BD8D66880] FOREIGN KEY ([OrderStatusId]) REFERENCES [dbo].[OrderStatus] ([OrderStatusId]),
+CONSTRAINT [FK3117099B8703A8E0] FOREIGN KEY ([UserId]) REFERENCES [dbo].[User] ([UserId]),
+CONSTRAINT [FK3117099BA708CB3A] FOREIGN KEY ([ModifiedById]) REFERENCES [dbo].[User] ([UserId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Adding foreign keys to [dbo].[ProductCategory]'
+GO
+ALTER TABLE [dbo].[ProductCategory] ADD
+CONSTRAINT [FK4022F9D7EEC058F7] FOREIGN KEY ([CategoryId]) REFERENCES [dbo].[Category] ([CategoryId]),
+CONSTRAINT [FK4022F9D7655B84E7] FOREIGN KEY ([ProductId]) REFERENCES [dbo].[Product] ([ProductId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Adding foreign keys to [dbo].[Category]'
+GO
+ALTER TABLE [dbo].[Category] ADD
+CONSTRAINT [FK6482F24565E1830] FOREIGN KEY ([ParentId]) REFERENCES [dbo].[Category] ([CategoryId]),
+CONSTRAINT [FK6482F242EC1B23E] FOREIGN KEY ([ImageId]) REFERENCES [dbo].[Image] ([ImageId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Adding foreign keys to [dbo].[Comment]'
+GO
+ALTER TABLE [dbo].[Comment] ADD
+CONSTRAINT [FKE24667035273ED9D] FOREIGN KEY ([ObjectId]) REFERENCES [dbo].[IComment] ([ICommentId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Adding foreign keys to [dbo].[MailingListSubscription]'
+GO
+ALTER TABLE [dbo].[MailingListSubscription] ADD
+CONSTRAINT [FK1CD411ADF3F5630] FOREIGN KEY ([ContactId]) REFERENCES [dbo].[Contact] ([ContactId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Adding foreign keys to [dbo].[Contact]'
+GO
+ALTER TABLE [dbo].[Contact] ADD
+CONSTRAINT [FK4FF8F4B2350E3BF0] FOREIGN KEY ([CountryId]) REFERENCES [dbo].[Country] ([CountryId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Adding foreign keys to [dbo].[Basket]'
+GO
+ALTER TABLE [dbo].[Basket] ADD
+CONSTRAINT [FKD4474AC2350E3BF0] FOREIGN KEY ([CountryId]) REFERENCES [dbo].[Country] ([CountryId]),
+CONSTRAINT [FKD4474AC28703A8E0] FOREIGN KEY ([UserId]) REFERENCES [dbo].[User] ([UserId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Adding foreign keys to [dbo].[Review]'
+GO
+ALTER TABLE [dbo].[Review] ADD
+CONSTRAINT [FKD28CAB635273ED9D] FOREIGN KEY ([ObjectId]) REFERENCES [dbo].[IComment] ([ICommentId]),
+CONSTRAINT [FKD28CAB63655B84E7] FOREIGN KEY ([ProductId]) REFERENCES [dbo].[Product] ([ProductId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Adding foreign keys to [dbo].[ProductImage]'
+GO
+ALTER TABLE [dbo].[ProductImage] ADD
+CONSTRAINT [FKD8C46FDB2EC1B23E] FOREIGN KEY ([ImageId]) REFERENCES [dbo].[Image] ([ImageId]),
+CONSTRAINT [FKD8C46FDB655B84E7] FOREIGN KEY ([ProductId]) REFERENCES [dbo].[Product] ([ProductId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Adding foreign keys to [dbo].[OrderLine]'
+GO
+ALTER TABLE [dbo].[OrderLine] ADD
+CONSTRAINT [FK9D642A8F71931278] FOREIGN KEY ([OrderId]) REFERENCES [dbo].[Order] ([OrderId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Adding foreign keys to [dbo].[OrderAdjustment]'
+GO
+ALTER TABLE [dbo].[OrderAdjustment] ADD
+CONSTRAINT [FKF3A9DF3A71931278] FOREIGN KEY ([OrderId]) REFERENCES [dbo].[Order] ([OrderId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Adding foreign keys to [dbo].[Country]'
+GO
+ALTER TABLE [dbo].[Country] ADD
+CONSTRAINT [FK2ABF29C369941CDB] FOREIGN KEY ([PostZoneId]) REFERENCES [dbo].[PostZone] ([PostZoneId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Adding foreign keys to [dbo].[Size]'
+GO
+ALTER TABLE [dbo].[Size] ADD
+CONSTRAINT [FKF1577525655B84E7] FOREIGN KEY ([ProductId]) REFERENCES [dbo].[Product] ([ProductId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+PRINT N'Adding foreign keys to [dbo].[User]'
+GO
+ALTER TABLE [dbo].[User] ADD
+CONSTRAINT [FK7185C17CEF538E9E] FOREIGN KEY ([RoleId]) REFERENCES [dbo].[Role] ([RoleId])
+GO
+IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
+GO
+IF EXISTS (SELECT * FROM #tmpErrors) ROLLBACK TRANSACTION
+GO
+IF @@TRANCOUNT>0 BEGIN
+PRINT 'The database update succeeded'
+COMMIT TRANSACTION
+END
+ELSE PRINT 'The database update failed'
+GO
+DROP TABLE #tmpErrors
+GO
+
+-- insert StockItems with initial history
+insert StockItem ([Level], IsActive, ProductName, SizeName)
+select
+ 0,
+ s.IsActive,
+ p.UrlName as ProductName,
+ s.Name as SizeName
+from Size s
+join Product p on s.ProductId = p.ProductId
+
+insert StockItemHistoryBase (
+ StockItemHistoryType,
+ [DateTime],
+ [User],
+ [Level],
+ StockItemId
+)
+select
+ 'StockItemCreated',
+ GETDATE(),
+ 'stock control upgrade script',
+ 0,
+ StockItemId
+from StockItem
+
+GO
+
+-- add IsInStock column
+alter table StockItem
+add IsInStock bit default 1
+
+GO
+
+-- update is in stock
+update StockItem set IsInStock = s.IsInStock
+from StockItem
+join (select
+ Size.Name as SizeName,
+ Product.UrlName as ProductName,
+ Size.IsInStock as IsInStock
+ from Size
+ join Product on Size.ProductId = Product.ProductId
+ where ((Size.IsActive = 1 and Product.IsActive = 1) or Size.Name = '-')) s
+ on s.SizeName = StockItem.SizeName and s.ProductName = StockItem.ProductName
+
+GO
+
+-- update old order lines
+update OrderLine set ProductId = OrderLineNew.ProductId, SizeName = OrderLineNew.NewSizeName
+from OrderLine
+join (
+ select
+ OrderLineId,
+ Product.ProductId,
+ Product.UrlName,
+ NewSizeName = CASE SUBSTRING(ProductName, len(Product.Name)+4, LEN(ProductName))
+ WHEN '' THEN '-'
+ ELSE SUBSTRING(ProductName, len(Product.Name)+4, LEN(ProductName))
+ END
+ from OrderLine
+ join Product on OrderLine.ProductUrlName = Product.UrlName
+ where OrderLine.SizeName is null
+ ) AS OrderLineNew on OrderLineNew.OrderLineId = OrderLine.OrderLineId
+left join Size on OrderLineNew.ProductId = Size.ProductId AND ltrim(rtrim(Size.Name)) = ltrim(rtrim(NewSizeName)) AND Size.IsActive = 1
+where Size.Name is not null
+GO
+
+-- update orders for default sizes AND any old orders with inactive sizes.
+update OrderLine set ProductId = OrderLineNew.ProductId, SizeName = OrderLineNew.NewSizeName
+from OrderLine
+join (
+ select
+ OrderLineId,
+ Product.ProductId,
+ Product.UrlName,
+ NewSizeName = CASE SUBSTRING(ProductName, len(Product.Name)+4, LEN(ProductName))
+ WHEN '' THEN '-'
+ ELSE SUBSTRING(ProductName, len(Product.Name)+4, LEN(ProductName))
+ END
+ from OrderLine
+ join Product on OrderLine.ProductUrlName = Product.UrlName
+ where OrderLine.SizeName is null
+ ) AS OrderLineNew on OrderLineNew.OrderLineId = OrderLine.OrderLineId
+left join Size on OrderLineNew.ProductId = Size.ProductId AND ltrim(rtrim(Size.Name)) = ltrim(rtrim(NewSizeName))
+where Size.Name is not null
+GO
\ No newline at end of file
diff --git a/Database/015_Update_for_answers_on_comments_2.2.0.507.sql b/Database/015_Update_for_answers_on_comments_2.2.0.507.sql
new file mode 100644
index 0000000..0387fb5
--- /dev/null
+++ b/Database/015_Update_for_answers_on_comments_2.2.0.507.sql
@@ -0,0 +1,2 @@
+alter table IComment
+ add Answer nvarchar(max) null
\ No newline at end of file
diff --git a/Design/favicon.design b/Design/favicon.design
new file mode 100644
index 0000000..0bc42f0
Binary files /dev/null and b/Design/favicon.design differ
diff --git a/Design/logo.design b/Design/logo.design
new file mode 100644
index 0000000..d10f9d4
Binary files /dev/null and b/Design/logo.design differ
diff --git a/Design/logo.png b/Design/logo.png
new file mode 100644
index 0000000..715199a
Binary files /dev/null and b/Design/logo.png differ
diff --git a/Design/logo_white.pdn b/Design/logo_white.pdn
new file mode 100644
index 0000000..7c039da
Binary files /dev/null and b/Design/logo_white.pdn differ
diff --git a/Design/logo_white.png b/Design/logo_white.png
new file mode 100644
index 0000000..2b1867f
Binary files /dev/null and b/Design/logo_white.png differ
diff --git a/Selenium_test_scripts/Add_Surprise_to_Offers b/Selenium_test_scripts/Add_Surprise_to_Offers
new file mode 100644
index 0000000..9913c30
--- /dev/null
+++ b/Selenium_test_scripts/Add_Surprise_to_Offers
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+Add_Surprise_to_Offers
+
+
+
+
+Add_Surprise_to_Offers |
+
+
+ open |
+ /shop/Category |
+ |
+
+
+ clickAndWait |
+ link=Online Shop |
+ |
+
+
+ clickAndWait |
+ link=Frigates |
+ |
+
+
+ clickAndWait |
+ //div[@id='mainContent']/div/div[2]/div/img |
+ |
+
+
+ clickAndWait |
+ link=Edit |
+ |
+
+
+ addSelection |
+ categories |
+ label=Offers |
+
+
+ clickAndWait |
+ //input[@value='Save Changes'] |
+ |
+
+
+ verifyTextPresent |
+ Product successfully saved |
+ |
+
+
+ clickAndWait |
+ link=Offers |
+ |
+
+
+ verifyTextPresent |
+ Surprise |
+ |
+
+
+
+
+
diff --git a/Selenium_test_scripts/Add_new_admin_user b/Selenium_test_scripts/Add_new_admin_user
new file mode 100644
index 0000000..a9d3629
--- /dev/null
+++ b/Selenium_test_scripts/Add_new_admin_user
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+Add_new_admin_user
+
+
+
+
+Add_new_admin_user |
+
+
+ open |
+ /shop |
+ |
+
+
+ verifyTextPresent |
+ admin@sutekishop.co.uk |
+ |
+
+
+ assertText |
+ link=Logout |
+ Logout |
+
+
+ clickAndWait |
+ link=Users |
+ |
+
+
+ assertTitle |
+ Suteki Shop - User |
+ |
+
+
+ clickAndWait |
+ link=New User |
+ |
+
+
+ type |
+ User_Email |
+ mike@mike.com |
+
+
+ type |
+ password |
+ mike |
+
+
+ clickAndWait |
+ //input[@value='Save'] |
+ |
+
+
+ assertText |
+ link=mike@mike.com |
+ mike@mike.com |
+
+
+
+
+
diff --git a/Selenium_test_scripts/Attempt_to_order_out_of_stock_Surprise b/Selenium_test_scripts/Attempt_to_order_out_of_stock_Surprise
new file mode 100644
index 0000000..1c8327a
--- /dev/null
+++ b/Selenium_test_scripts/Attempt_to_order_out_of_stock_Surprise
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+Attempt_to_order_out_of_stock_Surprise
+
+
+
+
+Attempt_to_order_out_of_stock_Surprise |
+
+
+ open |
+ /cms/Home |
+ |
+
+
+ clickAndWait |
+ link=Online Shop |
+ |
+
+
+ clickAndWait |
+ link=Frigates |
+ |
+
+
+ clickAndWait |
+ //div[@id='mainContent']/div/div[2]/div/img |
+ |
+
+
+ select |
+ basketItem_size_Id |
+ label=20cm Out of Stock |
+
+
+ clickAndWait |
+ addToBasket |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Surprise |
+ |
+
+
+ verifyTextPresent |
+ Sorry, Surprise, Size 20cm is out of stock |
+ |
+
+
+
+
+
diff --git a/Selenium_test_scripts/Basket_Add_Surprise b/Selenium_test_scripts/Basket_Add_Surprise
new file mode 100644
index 0000000..81c230c
--- /dev/null
+++ b/Selenium_test_scripts/Basket_Add_Surprise
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+Basket_Add_Surprise
+
+
+
+
+Basket_Add_Surprise |
+
+
+ open |
+ /shop |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Home |
+ |
+
+
+ clickAndWait |
+ link=Frigates |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Frigates |
+ |
+
+
+ clickAndWait |
+ //div[@id='mainContent']/div/div[2]/div/img |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Surprise |
+ |
+
+
+ select |
+ basketItem_size_Id |
+ label=30cm |
+
+
+ select |
+ basketItem_Quantity |
+ label=3 |
+
+
+ clickAndWait |
+ addToBasket |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Basket |
+ |
+
+
+ assertText |
+ link=Surprise |
+ Surprise |
+
+
+ assertText |
+ //form[@id='basketForm']/table/tbody/tr[2]/td[4] |
+ £150.00 |
+
+
+ assertText |
+ //form[@id='basketForm']/table/tbody/tr[2]/td[5] |
+ £450.00 |
+
+
+
+
+
diff --git a/Selenium_test_scripts/Basket_Add_Victory b/Selenium_test_scripts/Basket_Add_Victory
new file mode 100644
index 0000000..88104d4
--- /dev/null
+++ b/Selenium_test_scripts/Basket_Add_Victory
@@ -0,0 +1,97 @@
+
+
+
+
+
+
+Basket_Add_Victory
+
+
+
+
+Basket_Add_Victory |
+
+
+ open |
+ /shop |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Home |
+ |
+
+
+ clickAndWait |
+ link=Ships of the line |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Ships of the line |
+ |
+
+
+ clickAndWait |
+ //div[@id='mainContent']/div/div[2]/div/img |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Victory |
+ |
+
+
+ select |
+ basketItem_size_Id |
+ label=20cm |
+
+
+ select |
+ basketItem_Quantity |
+ label=2 |
+
+
+ clickAndWait |
+ addToBasket |
+ |
+
+
+ assertText |
+ //form[@id='basketForm']/table/tbody/tr[3]/td[2] |
+ 20cm |
+
+
+ assertText |
+ //form[@id='basketForm']/table/tbody/tr[3]/td[3] |
+ 2 |
+
+
+ assertText |
+ //form[@id='basketForm']/table/tbody/tr[3]/td[4] |
+ £300.00 |
+
+
+ assertText |
+ //form[@id='basketForm']/table/tbody/tr[3]/td[5] |
+ £600.00 |
+
+
+ assertText |
+ //form[@id='basketForm']/table/tbody/tr[4]/td[5] |
+ £1050.00 |
+
+
+ assertText |
+ //form[@id='basketForm']/table/tbody/tr[5]/td[5] |
+ £10.00 |
+
+
+ assertText |
+ //form[@id='basketForm']/table/tbody/tr[7]/td[5] |
+ £1060.00 |
+
+
+
+
+
diff --git a/Selenium_test_scripts/Basket_Remove_Victory b/Selenium_test_scripts/Basket_Remove_Victory
new file mode 100644
index 0000000..561504a
--- /dev/null
+++ b/Selenium_test_scripts/Basket_Remove_Victory
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+Basket_Remove_Victory
+
+
+
+
+Basket_Remove_Victory |
+
+
+ open |
+ /shop |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Home |
+ |
+
+
+ clickAndWait |
+ link=Basket |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Basket |
+ |
+
+
+ assertText |
+ link=Victory |
+ Victory |
+
+
+ clickAndWait |
+ //form[@id='basketForm']/table/tbody/tr[3]/td[6]/a |
+ |
+
+
+ assertText |
+ //form[@id='basketForm']/table/tbody/tr[3]/td[5] |
+ £450.00 |
+
+
+
+
+
diff --git a/Selenium_test_scripts/Category_Add_Offers b/Selenium_test_scripts/Category_Add_Offers
new file mode 100644
index 0000000..e4fd54b
--- /dev/null
+++ b/Selenium_test_scripts/Category_Add_Offers
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+Category_Add_Offers
+
+
+
+
+Category_Add_Offers |
+
+
+ open |
+ /shop |
+ |
+
+
+ clickAndWait |
+ link=Categories |
+ |
+
+
+ clickAndWait |
+ link=New Category |
+ |
+
+
+ type |
+ Category_Name |
+ Offers |
+
+
+ click |
+ Category_IsActive |
+ |
+
+
+ clickAndWait |
+ //input[@type='submit'] |
+ |
+
+
+ verifyTextPresent |
+ New category has been added |
+ |
+
+
+
+
+
diff --git a/Selenium_test_scripts/Category_Add_Two b/Selenium_test_scripts/Category_Add_Two
new file mode 100644
index 0000000..17aa70c
--- /dev/null
+++ b/Selenium_test_scripts/Category_Add_Two
@@ -0,0 +1,107 @@
+
+
+
+
+
+
+Category_Add_Two
+
+
+
+
+Category_Add_Two |
+
+
+ open |
+ /shop |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Home |
+ |
+
+
+ clickAndWait |
+ link=Categories |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Category |
+ |
+
+
+ clickAndWait |
+ link=New Category |
+ |
+
+
+ type |
+ Category_Name |
+ Frigates |
+
+
+ click |
+ Category_IsActive |
+ |
+
+
+ clickAndWait |
+ //input[@type='submit'] |
+ |
+
+
+ verifyTextPresent |
+ New category has been added |
+ |
+
+
+ assertText |
+ //div[@id='mainContent']/div/div[2]/div[2]/ul/li/a[1] |
+ Frigates |
+
+
+ clickAndWait |
+ link=New Category |
+ |
+
+
+ type |
+ Category_Name |
+ Ships of the line |
+
+
+ click |
+ Category_IsActive |
+ |
+
+
+ clickAndWait |
+ //input[@type='submit'] |
+ |
+
+
+ verifyTextPresent |
+ New category has been added |
+ |
+
+
+ assertText |
+ //div[@id='mainContent']/div/div[2]/div[2]/ul/li[2]/a[1] |
+ Ships of the line |
+
+
+ assertText |
+ link=Frigates |
+ Frigates |
+
+
+ assertText |
+ link=Ships of the line |
+ Ships of the line |
+
+
+
+
+
diff --git a/Selenium_test_scripts/Category_Move_up_and_down b/Selenium_test_scripts/Category_Move_up_and_down
new file mode 100644
index 0000000..a89e25c
--- /dev/null
+++ b/Selenium_test_scripts/Category_Move_up_and_down
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+Category_Move_up_and_down
+
+
+
+
+Category_Move_up_and_down |
+
+
+ open |
+ /shop/Category |
+ |
+
+
+ clickAndWait |
+ //div[@id='mainContent']/div/div[2]/div/ul/li[2]/a[3]/img |
+ |
+
+
+ assertText |
+ //div[@id='mainContent']/div/div[2]/div/ul/li[1]/a[1] |
+ Ships of the line |
+
+
+ assertText |
+ //div[@id='mainContent']/div/div[2]/div/ul/li[2]/a[1] |
+ Frigates |
+
+
+ clickAndWait |
+ //img[@alt='Move Down'] |
+ |
+
+
+ assertText |
+ //div[@id='mainContent']/div/div[2]/div/ul/li[1]/a[1] |
+ Frigates |
+
+
+ assertText |
+ //div[@id='mainContent']/div/div[2]/div/ul/li[2]/a[1] |
+ Ships of the line |
+
+
+
+
+
diff --git a/Selenium_test_scripts/Checkout_complete b/Selenium_test_scripts/Checkout_complete
new file mode 100644
index 0000000..543a3cf
--- /dev/null
+++ b/Selenium_test_scripts/Checkout_complete
@@ -0,0 +1,237 @@
+
+
+
+
+
+
+Checkout_complete
+
+
+
+
+Checkout_complete |
+
+
+ open |
+ /shop |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Home |
+ |
+
+
+ clickAndWait |
+ link=Basket |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Basket |
+ |
+
+
+ assertText |
+ //form[@id='basketForm']/table/tbody/tr[6]/td[5] |
+ £460.00 |
+
+
+ clickAndWait |
+ //input[@value='Checkout'] |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Checkout |
+ |
+
+
+ assertText |
+ //div[@id='mainContent']/div[1]/div[2]/table/tbody/tr[6]/td[5] |
+ £460.00 |
+
+
+ type |
+ CardContactFirstName |
+ Mike |
+
+
+ type |
+ CardContactLastName |
+ Hadlow |
+
+
+ type |
+ CardContactAddress1 |
+ 5 Lovely Street |
+
+
+ type |
+ CardContactTown |
+ Hove |
+
+
+ type |
+ CardContactCounty |
+ East Sussex |
+
+
+ type |
+ CardContactPostcode |
+ BN3 6BB |
+
+
+ type |
+ CardContactTelephone |
+ 01273123456 |
+
+
+ type |
+ Email |
+ mike@mike.com |
+
+
+ type |
+ EmailConfirm |
+ mike@mike.com |
+
+
+ type |
+ AdditionalInformation |
+ Can I have the Captain Aubery figure as well for free? |
+
+
+ type |
+ CardHolder |
+ Mr Mike Hadlow |
+
+
+ type |
+ CardNumber |
+ 1111111111111117 |
+
+
+ select |
+ CardExpiryMonth |
+ label=06 |
+
+
+ select |
+ CardExpiryYear |
+ label=2011 |
+
+
+ select |
+ CardStartMonth |
+ label=01 |
+
+
+ select |
+ CardStartYear |
+ label=2007 |
+
+
+ type |
+ CardSecurityCode |
+ 123 |
+
+
+ click |
+ ContactMe |
+ |
+
+
+ clickAndWait |
+ submitButton |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Checkout |
+ |
+
+
+ verifyTextPresent |
+ £460.00 |
+ |
+
+
+ verifyTextPresent |
+ Can I have the Captain Aubery figure as well for free? |
+ |
+
+
+ clickAndWait |
+ //input[@value='Place Order'] |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Order |
+ |
+
+
+ verifyTextPresent |
+ Order Confirmation |
+ |
+
+
+ verifyTextPresent |
+ £460.00 |
+ |
+
+
+ verifyTextPresent |
+ Hadlow |
+ |
+
+
+ verifyTextPresent |
+ 5 Lovely Street |
+ |
+
+
+ verifyTextPresent |
+ Hove |
+ |
+
+
+ verifyTextPresent |
+ East Sussex |
+ |
+
+
+ verifyTextPresent |
+ BN3 6BB |
+ |
+
+
+ verifyTextPresent |
+ United Kingdom |
+ |
+
+
+ verifyTextPresent |
+ 01273123456 |
+ |
+
+
+ assertText |
+ link=mike@mike.com |
+ mike@mike.com |
+
+
+ verifyTextPresent |
+ Yes |
+ |
+
+
+ verifyTextPresent |
+ Can I have the Captain Aubery figure as well for free? |
+ |
+
+
+
+
+
diff --git a/Selenium_test_scripts/Country_Add b/Selenium_test_scripts/Country_Add
new file mode 100644
index 0000000..703031f
--- /dev/null
+++ b/Selenium_test_scripts/Country_Add
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+Country_Add
+
+
+
+
+Country_Add |
+
+
+ open |
+ /shop |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Home |
+ |
+
+
+ clickAndWait |
+ link=Countries |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Country |
+ |
+
+
+ clickAndWait |
+ link=New Country |
+ |
+
+
+ type |
+ Item_Name |
+ France |
+
+
+ click |
+ Item_IsActive |
+ |
+
+
+ select |
+ Item_PostZone_Id |
+ label=Europe |
+
+
+ clickAndWait |
+ //input[@value='Save'] |
+ |
+
+
+ assertText |
+ link=France |
+ France |
+
+
+
+
+
diff --git a/Selenium_test_scripts/Create_Help_Menu b/Selenium_test_scripts/Create_Help_Menu
new file mode 100644
index 0000000..9b21577
--- /dev/null
+++ b/Selenium_test_scripts/Create_Help_Menu
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+Create_Help_Menu
+
+
+
+
+Create_Help_Menu |
+
+
+ open |
+ /cms/Home |
+ |
+
+
+ clickAndWait |
+ link=Edit this menu |
+ |
+
+
+ clickAndWait |
+ link=New Menu |
+ |
+
+
+ type |
+ Content_Name |
+ Help |
+
+
+ clickAndWait |
+ //input[@value='Save Changes'] |
+ |
+
+
+ verifyTextPresent |
+ Help |
+ |
+
+
+
+
+
diff --git a/Selenium_test_scripts/Dispatch_Order b/Selenium_test_scripts/Dispatch_Order
new file mode 100644
index 0000000..6cf4dab
--- /dev/null
+++ b/Selenium_test_scripts/Dispatch_Order
@@ -0,0 +1,97 @@
+
+
+
+
+
+
+Dispatch_Order
+
+
+
+
+Dispatch_Order |
+
+
+ open |
+ /shop |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Home |
+ |
+
+
+ clickAndWait |
+ link=Orders |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Order |
+ |
+
+
+ clickAndWait |
+ link=1 |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Order |
+ |
+
+
+ verifyTextPresent |
+ Mike |
+ |
+
+
+ verifyTextPresent |
+ Can I have the Captain Aubery figure as well for free? |
+ |
+
+
+ clickAndWait |
+ //input[@value='Dispatch'] |
+ |
+
+
+ verifyTextPresent |
+ Dispatched |
+ |
+
+
+ verifyTextPresent |
+ Hadlow |
+ |
+
+
+ verifyTextPresent |
+ 5 Lovely Street |
+ |
+
+
+ verifyTextPresent |
+ Hove |
+ |
+
+
+ verifyTextPresent |
+ East Sussex |
+ |
+
+
+ verifyTextPresent |
+ BN3 6BB |
+ |
+
+
+ verifyTextPresent |
+ United Kingdom |
+ |
+
+
+
+
+
diff --git a/Selenium_test_scripts/Images/frigate_category.jpg b/Selenium_test_scripts/Images/frigate_category.jpg
new file mode 100644
index 0000000..a5a44ad
Binary files /dev/null and b/Selenium_test_scripts/Images/frigate_category.jpg differ
diff --git a/Selenium_test_scripts/Images/sohpie2.jpg b/Selenium_test_scripts/Images/sohpie2.jpg
new file mode 100644
index 0000000..fbcbe6d
Binary files /dev/null and b/Selenium_test_scripts/Images/sohpie2.jpg differ
diff --git a/Selenium_test_scripts/Images/sophie1.jpg b/Selenium_test_scripts/Images/sophie1.jpg
new file mode 100644
index 0000000..7fd0530
Binary files /dev/null and b/Selenium_test_scripts/Images/sophie1.jpg differ
diff --git a/Selenium_test_scripts/Images/sophie3.jpg b/Selenium_test_scripts/Images/sophie3.jpg
new file mode 100644
index 0000000..842db87
Binary files /dev/null and b/Selenium_test_scripts/Images/sophie3.jpg differ
diff --git a/Selenium_test_scripts/Images/surprise1.jpg b/Selenium_test_scripts/Images/surprise1.jpg
new file mode 100644
index 0000000..0df3561
Binary files /dev/null and b/Selenium_test_scripts/Images/surprise1.jpg differ
diff --git a/Selenium_test_scripts/Images/surprise2.jpg b/Selenium_test_scripts/Images/surprise2.jpg
new file mode 100644
index 0000000..288e4a2
Binary files /dev/null and b/Selenium_test_scripts/Images/surprise2.jpg differ
diff --git a/Selenium_test_scripts/Images/surprise3.jpg b/Selenium_test_scripts/Images/surprise3.jpg
new file mode 100644
index 0000000..ca5bd28
Binary files /dev/null and b/Selenium_test_scripts/Images/surprise3.jpg differ
diff --git a/Selenium_test_scripts/Images/victory1.jpg b/Selenium_test_scripts/Images/victory1.jpg
new file mode 100644
index 0000000..1cf5d21
Binary files /dev/null and b/Selenium_test_scripts/Images/victory1.jpg differ
diff --git a/Selenium_test_scripts/Images/victory2.jpg b/Selenium_test_scripts/Images/victory2.jpg
new file mode 100644
index 0000000..3acfddf
Binary files /dev/null and b/Selenium_test_scripts/Images/victory2.jpg differ
diff --git a/Selenium_test_scripts/Images/victory3.jpg b/Selenium_test_scripts/Images/victory3.jpg
new file mode 100644
index 0000000..862dcac
Binary files /dev/null and b/Selenium_test_scripts/Images/victory3.jpg differ
diff --git a/Selenium_test_scripts/Login b/Selenium_test_scripts/Login
new file mode 100644
index 0000000..45cb8d3
--- /dev/null
+++ b/Selenium_test_scripts/Login
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+Login
+
+
+
+
+Login |
+
+
+ open |
+ /shop |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Home |
+ |
+
+
+ clickAndWait |
+ link=Login |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Login |
+ |
+
+
+ type |
+ email |
+ admin@sutekishop.co.uk |
+
+
+ type |
+ password |
+ admin |
+
+
+ clickAndWait |
+ //input[@type='submit'] |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Home |
+ |
+
+
+ verifyTextPresent |
+ admin@sutekishop.co.uk |
+ |
+
+
+
+
diff --git a/Selenium_test_scripts/Logout b/Selenium_test_scripts/Logout
new file mode 100644
index 0000000..42f9db5
--- /dev/null
+++ b/Selenium_test_scripts/Logout
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+Logout
+
+
+
+
+Logout |
+
+
+ open |
+ /shop |
+ |
+
+
+ verifyTextPresent |
+ admin@sutekishop.co.uk |
+ |
+
+
+ clickAndWait |
+ link=Logout |
+ |
+
+
+ verifyTextPresent |
+ Guest |
+ |
+
+
+ assertText |
+ link=Login |
+ Login |
+
+
+
+
+
diff --git a/Selenium_test_scripts/Page_Add b/Selenium_test_scripts/Page_Add
new file mode 100644
index 0000000..f77061b
--- /dev/null
+++ b/Selenium_test_scripts/Page_Add
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+Page_Add
+
+
+
+
+Page_Add |
+
+
+ open |
+ /shop/Menu/List/1 |
+ |
+
+
+ clickAndWait |
+ link=Help |
+ |
+
+
+ clickAndWait |
+ //div[@id='mainContent']/div[2]/div[1]/div/div/ul/li/a |
+ |
+
+
+ clickAndWait |
+ link=New Page |
+ |
+
+
+ type |
+ Content_Name |
+ Choosing your ship |
+
+
+ clickAndWait |
+ //input[@value='Save Changes'] |
+ |
+
+
+ verifyTextPresent |
+ Choosing your ship |
+ |
+
+
+ clickAndWait |
+ //div[@id='mainContent']/div[2]/div[2]/table/tbody/tr/td[2]/a |
+ |
+
+
+ clickAndWait |
+ link=Home |
+ |
+
+
+
+
+
diff --git a/Selenium_test_scripts/Page_Edit b/Selenium_test_scripts/Page_Edit
new file mode 100644
index 0000000..74f07bb
--- /dev/null
+++ b/Selenium_test_scripts/Page_Edit
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+Page_Edit
+
+
+
+
+Page_Edit |
+
+
+ open |
+ /cms/Home |
+ |
+
+
+ clickAndWait |
+ link=Help |
+ |
+
+
+ clickAndWait |
+ link=Edit |
+ |
+
+
+ selectFrame |
+ Content_Text_ifr |
+ |
+
+
+ focus |
+ tinymce |
+ |
+
+
+ type |
+ tinymce |
+ Add some text |
+
+
+ selectFrame |
+ relative=parent |
+ |
+
+
+ clickAndWait |
+ //input[@value='Save Changes'] |
+ |
+
+
+ clickAndWait |
+ //div[@id='mainContent']/div[2]/div[2]/table/tbody/tr/td[2]/a |
+ |
+
+
+ verifyTextPresent |
+ Add some text |
+ |
+
+
+
+
+
diff --git a/Selenium_test_scripts/PostZone_Add b/Selenium_test_scripts/PostZone_Add
new file mode 100644
index 0000000..e92511d
--- /dev/null
+++ b/Selenium_test_scripts/PostZone_Add
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+PostZone_Add
+
+
+
+
+PostZone_Add |
+
+
+ open |
+ /shop |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Home |
+ |
+
+
+ clickAndWait |
+ link=Postage Zones |
+ |
+
+
+ assertTitle |
+ Suteki Shop - PostZone |
+ |
+
+
+ clickAndWait |
+ link=New Postage Zone |
+ |
+
+
+ assertTitle |
+ Suteki Shop - PostZone |
+ |
+
+
+ type |
+ Item_Name |
+ Europe |
+
+
+ type |
+ Item_Multiplier |
+ 1.5 |
+
+
+ type |
+ Item_FlatRate |
+ 10.00 |
+
+
+ click |
+ Item_IsActive |
+ |
+
+
+ clickAndWait |
+ //input[@value='Save'] |
+ |
+
+
+ assertText |
+ link=Europe |
+ Europe |
+
+
+
+
+
diff --git a/Selenium_test_scripts/PostageBand_Add_A b/Selenium_test_scripts/PostageBand_Add_A
new file mode 100644
index 0000000..dc153b7
--- /dev/null
+++ b/Selenium_test_scripts/PostageBand_Add_A
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+PostageBand_Add_A
+
+
+
+
+PostageBand_Add_A |
+
+
+ open |
+ /shop |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Home |
+ |
+
+
+ clickAndWait |
+ link=Postage Bands |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Postage |
+ |
+
+
+ clickAndWait |
+ link=New Postage Band |
+ |
+
+
+ type |
+ Item_Name |
+ A |
+
+
+ type |
+ Item_MaxWeight |
+ 100 |
+
+
+ type |
+ Item_Price |
+ 1.00 |
+
+
+ click |
+ Item_IsActive |
+ |
+
+
+ clickAndWait |
+ //input[@value='Save Changes'] |
+ |
+
+
+ assertText |
+ link=A |
+ A |
+
+
+ verifyTextPresent |
+ 100 |
+ |
+
+
+ verifyTextPresent |
+ £1.00 |
+ |
+
+
+
+
+
diff --git a/Selenium_test_scripts/PostageBand_Add_B b/Selenium_test_scripts/PostageBand_Add_B
new file mode 100644
index 0000000..a06cca5
--- /dev/null
+++ b/Selenium_test_scripts/PostageBand_Add_B
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+PostageBand_Add_B
+
+
+
+
+PostageBand_Add_B |
+
+
+ open |
+ /shop/Postage |
+ |
+
+
+ clickAndWait |
+ link=New Postage Band |
+ |
+
+
+ type |
+ Item_Name |
+ B |
+
+
+ type |
+ Item_MaxWeight |
+ 500 |
+
+
+ type |
+ Item_Price |
+ 3.00 |
+
+
+ click |
+ Item_IsActive |
+ |
+
+
+ clickAndWait |
+ //input[@value='Save Changes'] |
+ |
+
+
+ assertText |
+ link=B |
+ B |
+
+
+ verifyTextPresent |
+ 500 |
+ |
+
+
+ verifyTextPresent |
+ £3.00 |
+ |
+
+
+
+
+
diff --git a/Selenium_test_scripts/PostageBand_Move_up_and_down b/Selenium_test_scripts/PostageBand_Move_up_and_down
new file mode 100644
index 0000000..9cb3a7d
--- /dev/null
+++ b/Selenium_test_scripts/PostageBand_Move_up_and_down
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+PostageBand_Move_up_and_down
+
+
+
+
+PostageBand_Move_up_and_down |
+
+
+ open |
+ /shop/Postage |
+ |
+
+
+ clickAndWait |
+ //div[@id='mainContent']/div/div[2]/table/tbody/tr[2]/td[5]/a/img |
+ |
+
+
+ clickAndWait |
+ //img[@alt='Move Down'] |
+ |
+
+
+
+
+
diff --git a/Selenium_test_scripts/Product_Add_Surprise b/Selenium_test_scripts/Product_Add_Surprise
new file mode 100644
index 0000000..0f84b1c
--- /dev/null
+++ b/Selenium_test_scripts/Product_Add_Surprise
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+Product_Add_Surprise
+
+
+
+
+Product_Add_Surprise |
+
+
+ open |
+ /shop |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Home |
+ |
+
+
+ clickAndWait |
+ link=Frigates |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Frigates |
+ |
+
+
+ clickAndWait |
+ link=New Product |
+ |
+
+
+ selectFrame |
+ Description_ifr |
+ |
+
+
+ focus |
+ tinymce |
+ |
+
+
+ type |
+ tinymce |
+ The Frigate Surprise was made famous by Patrick O'Brien's Master and Commander series |
+
+
+ selectFrame |
+ relative=parent |
+ |
+
+
+ type |
+ Name |
+ Surprise |
+
+
+ type |
+ Weight |
+ 250 |
+
+
+ type |
+ Price |
+ 150.00 |
+
+
+ click |
+ IsActive |
+ |
+
+
+ type |
+ Sizes_0_ |
+ 10cm |
+
+
+ type |
+ Sizes_1_ |
+ 20cm |
+
+
+ type |
+ Sizes_2_ |
+ 30cm |
+
+
+ clickAndWait |
+ //input[@value='Save Changes'] |
+ |
+
+
+ verifyValue |
+ Name |
+ Surprise |
+
+
+ clickAndWait |
+ link=Preview |
+ |
+
+
+ assertText |
+ //div[@id='mainContent']/div/div[2]/h1 |
+ Surprise £150.00 |
+
+
+ clickAndWait |
+ link=Home |
+ |
+
+
+
+
diff --git a/Selenium_test_scripts/Product_Add_Victory b/Selenium_test_scripts/Product_Add_Victory
new file mode 100644
index 0000000..e461dd4
--- /dev/null
+++ b/Selenium_test_scripts/Product_Add_Victory
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+Product_Add_Victory
+
+
+
+
+Product_Add_Victory |
+
+
+ open |
+ /shop |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Home |
+ |
+
+
+ clickAndWait |
+ link=Ships of the line |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Ships of the line |
+ |
+
+
+ clickAndWait |
+ link=New Product |
+ |
+
+
+ type |
+ Name |
+ Victory |
+
+
+ type |
+ Weight |
+ 450 |
+
+
+ type |
+ Price |
+ 300.00 |
+
+
+ click |
+ IsActive |
+ |
+
+
+ selectFrame |
+ Description_ifr |
+ |
+
+
+ focus |
+ tinymce |
+ |
+
+
+ type |
+ tinymce |
+ HMS Victory was Nelson's flagship at the battle of Trafalguar |
+
+
+ selectFrame |
+ relative=parent |
+ |
+
+
+ type |
+ Sizes_0_ |
+ 10cm |
+
+
+ type |
+ Sizes_1_ |
+ 20cm |
+
+
+ type |
+ Sizes_2_ |
+ 30cm |
+
+
+ clickAndWait |
+ //input[@value='Save Changes'] |
+ |
+
+
+ verifyValue |
+ Name |
+ Victory |
+
+
+ clickAndWait |
+ link=Preview |
+ |
+
+
+ assertText |
+ //div[@id='mainContent']/div/div[2]/h1 |
+ Victory £300.00 |
+
+
+ assertText |
+ basketItem_size_Id |
+ 10cm 20cm 30cm |
+
+
+ assertText |
+ basketItem_Quantity |
+ 1 2 3 4 5 6 7 8 9 10 |
+
+
+
+
diff --git a/Selenium_test_scripts/Product_Edit_Surprise_Add_Images b/Selenium_test_scripts/Product_Edit_Surprise_Add_Images
new file mode 100644
index 0000000..89a3d74
--- /dev/null
+++ b/Selenium_test_scripts/Product_Edit_Surprise_Add_Images
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+Product_Edit_Surprise_Add_Images
+
+
+
+
+Product_Edit_Surprise_Add_Images |
+
+
+ open |
+ /shop |
+ |
+
+
+ clickAndWait |
+ link=Frigates |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Frigates |
+ |
+
+
+ clickAndWait |
+ //div[@onclick="location.href='/product/Surprise'"] |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Surprise |
+ |
+
+
+ clickAndWait |
+ link=Edit |
+ |
+
+
+ type |
+ image_0 |
+ ${projectDir}\Images\surprise1.jpg |
+
+
+ type |
+ image_1 |
+ ${projectDir}\Images\surprise2.jpg |
+
+
+ type |
+ image_2 |
+ ${projectDir}\Images\surprise3.jpg |
+
+
+ clickAndWait |
+ //input[@value='Save Changes'] |
+ |
+
+
+ clickAndWait |
+ link=Preview |
+ |
+
+
+ click |
+ //img[@onclick='onThumbnailClick(this)'] |
+ |
+
+
+ click |
+ //div[@id='mainContent']/div/div[2]/div[2]/div[2]/img[2] |
+ |
+
+
+ click |
+ //div[@id='mainContent']/div/div[2]/div[2]/div[2]/img[3] |
+ |
+
+
+
+
diff --git a/Selenium_test_scripts/Product_Edit_Victory_Add_Images b/Selenium_test_scripts/Product_Edit_Victory_Add_Images
new file mode 100644
index 0000000..6474570
--- /dev/null
+++ b/Selenium_test_scripts/Product_Edit_Victory_Add_Images
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+Product_Edit_Victory_Add_Images
+
+
+
+
+Product_Edit_Victory_Add_Images |
+
+
+ open |
+ /shop |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Home |
+ |
+
+
+ clickAndWait |
+ link=Ships of the line |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Ships of the line |
+ |
+
+
+ clickAndWait |
+ //div[@onclick="location.href='/product/Victory'"] |
+ |
+
+
+ assertTitle |
+ Suteki Shop - Victory |
+ |
+
+
+ clickAndWait |
+ link=Edit |
+ |
+
+
+ type |
+ image_0 |
+ ${projectDir}\Images\victory1.jpg |
+
+
+ type |
+ image_1 |
+ ${projectDir}\Images\victory2.jpg |
+
+
+ type |
+ image_2 |
+ ${projectDir}\Images\victory3.jpg |
+
+
+ clickAndWait |
+ //input[@value='Save Changes'] |
+ |
+
+
+ clickAndWait |
+ link=Preview |
+ |
+
+
+ click |
+ //img[@onclick='onThumbnailClick(this)'] |
+ |
+
+
+ click |
+ //div[@id='mainContent']/div/div[2]/div[2]/div[2]/img[2] |
+ |
+
+
+ click |
+ //div[@id='mainContent']/div/div[2]/div[2]/div[2]/img[3] |
+ |
+
+
+
+
diff --git a/Selenium_test_scripts/Set_20cm_Surprise_out_of_stock b/Selenium_test_scripts/Set_20cm_Surprise_out_of_stock
new file mode 100644
index 0000000..4a0a2fa
--- /dev/null
+++ b/Selenium_test_scripts/Set_20cm_Surprise_out_of_stock
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+Set_20cm_Surprise_out_of_stock
+
+
+
+
+Set_20cm_Surprise_out_of_stock |
+
+
+ open |
+ /cms/Home |
+ |
+
+
+ clickAndWait |
+ link=Online Shop |
+ |
+
+
+ clickAndWait |
+ link=Stock |
+ |
+
+
+ click |
+ //div[@id='mainContent']/div/div[2]/div/form/div[5]/div[3]/input[1] |
+ |
+
+
+ clickAndWait |
+ //input[@type='submit'] |
+ |
+
+
+ clickAndWait |
+ link=Offers |
+ |
+
+
+ clickAndWait |
+ //div[@id='mainContent']/div/div[2]/div/img |
+ |
+
+
+ verifyTextPresent |
+ 20cm Out of Stock |
+ |
+
+
+ clickAndWait |
+ link=Frigates |
+ |
+
+
+ clickAndWait |
+ //div[@id='mainContent']/div/div[2]/div/img |
+ |
+
+
+ verifyTextPresent |
+ 20cm Out of Stock |
+ |
+
+
+
+
+
diff --git a/Selenium_test_scripts/Set_Project_Directory b/Selenium_test_scripts/Set_Project_Directory
new file mode 100644
index 0000000..1774db3
--- /dev/null
+++ b/Selenium_test_scripts/Set_Project_Directory
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+Set_Project_Directory
+
+
+
+
+Set_Project_Directory |
+
+
+ storeEval |
+ editor.suiteTreeView.currentTestCase.file.path.replace(/[^\\]*$/, '') |
+ projectDir |
+
+
+
+
+
diff --git a/Selenium_test_scripts/SutekiShop_test_suite.html b/Selenium_test_scripts/SutekiShop_test_suite.html
new file mode 100644
index 0000000..41d3af5
--- /dev/null
+++ b/Selenium_test_scripts/SutekiShop_test_suite.html
@@ -0,0 +1,35 @@
+
+
+
+
+
+ Test Suite
+
+
+
+
+
diff --git a/Selenium_test_scripts/User_modify b/Selenium_test_scripts/User_modify
new file mode 100644
index 0000000..cf7eecc
--- /dev/null
+++ b/Selenium_test_scripts/User_modify
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+User_modify
+
+
+
+
+User_modify |
+
+
+ open |
+ /shop |
+ |
+
+
+ clickAndWait |
+ link=Users |
+ |
+
+
+ assertTitle |
+ Suteki Shop - User |
+ |
+
+
+ clickAndWait |
+ link=mike@mike.com |
+ |
+
+
+ type |
+ password |
+ mike1 |
+
+
+ click |
+ User_IsEnabled |
+ |
+
+
+ clickAndWait |
+ //input[@value='Save'] |
+ |
+
+
+ verifyTextPresent |
+ Changes have been saved |
+ |
+
+
+ clickAndWait |
+ link=Users |
+ |
+
+
+
+
+
diff --git a/Suteki.Shop/Dependencies.mvc3/CookComputing.XmlRpcV2.dll b/Suteki.Shop/Dependencies.mvc3/CookComputing.XmlRpcV2.dll
new file mode 100644
index 0000000..0d2bf18
Binary files /dev/null and b/Suteki.Shop/Dependencies.mvc3/CookComputing.XmlRpcV2.dll differ
diff --git a/Suteki.Shop/Dependencies.mvc3/HibernatingRhinos.Profiler.Appender.dll b/Suteki.Shop/Dependencies.mvc3/HibernatingRhinos.Profiler.Appender.dll
new file mode 100644
index 0000000..3ede7f3
Binary files /dev/null and b/Suteki.Shop/Dependencies.mvc3/HibernatingRhinos.Profiler.Appender.dll differ
diff --git a/Suteki.Shop/Dependencies.mvc3/Microsoft.ServiceModel.Samples.XmlRpc.dll b/Suteki.Shop/Dependencies.mvc3/Microsoft.ServiceModel.Samples.XmlRpc.dll
new file mode 100644
index 0000000..fe66063
Binary files /dev/null and b/Suteki.Shop/Dependencies.mvc3/Microsoft.ServiceModel.Samples.XmlRpc.dll differ
diff --git a/Suteki.Shop/Dependencies.mvc3/Microsoft.Web.Infrastructure.dll b/Suteki.Shop/Dependencies.mvc3/Microsoft.Web.Infrastructure.dll
new file mode 100644
index 0000000..85f1138
Binary files /dev/null and b/Suteki.Shop/Dependencies.mvc3/Microsoft.Web.Infrastructure.dll differ
diff --git a/Suteki.Shop/Dependencies.mvc3/System.Data.SQLite.DLL b/Suteki.Shop/Dependencies.mvc3/System.Data.SQLite.DLL
new file mode 100644
index 0000000..aa398bb
Binary files /dev/null and b/Suteki.Shop/Dependencies.mvc3/System.Data.SQLite.DLL differ
diff --git a/Suteki.Shop/Dependencies.mvc3/System.Web.Mvc.dll b/Suteki.Shop/Dependencies.mvc3/System.Web.Mvc.dll
new file mode 100644
index 0000000..eed0d99
Binary files /dev/null and b/Suteki.Shop/Dependencies.mvc3/System.Web.Mvc.dll differ
diff --git a/Suteki.Shop/Dependencies.mvc3/System.Web.Razor.dll b/Suteki.Shop/Dependencies.mvc3/System.Web.Razor.dll
new file mode 100644
index 0000000..cd950e6
Binary files /dev/null and b/Suteki.Shop/Dependencies.mvc3/System.Web.Razor.dll differ
diff --git a/Suteki.Shop/Dependencies.mvc3/System.Web.WebPages.Deployment.dll b/Suteki.Shop/Dependencies.mvc3/System.Web.WebPages.Deployment.dll
new file mode 100644
index 0000000..2e09c48
Binary files /dev/null and b/Suteki.Shop/Dependencies.mvc3/System.Web.WebPages.Deployment.dll differ
diff --git a/Suteki.Shop/Dependencies.mvc3/System.Web.WebPages.Razor.dll b/Suteki.Shop/Dependencies.mvc3/System.Web.WebPages.Razor.dll
new file mode 100644
index 0000000..9846dd3
Binary files /dev/null and b/Suteki.Shop/Dependencies.mvc3/System.Web.WebPages.Razor.dll differ
diff --git a/Suteki.Shop/Dependencies.mvc3/System.Web.WebPages.dll b/Suteki.Shop/Dependencies.mvc3/System.Web.WebPages.dll
new file mode 100644
index 0000000..9fea012
Binary files /dev/null and b/Suteki.Shop/Dependencies.mvc3/System.Web.WebPages.dll differ
diff --git a/Suteki.Shop/Design/Buttons/SSL_Secured.design b/Suteki.Shop/Design/Buttons/SSL_Secured.design
new file mode 100644
index 0000000..159e1e9
Binary files /dev/null and b/Suteki.Shop/Design/Buttons/SSL_Secured.design differ
diff --git a/Suteki.Shop/Suteki.Common.Tests/App.config b/Suteki.Shop/Suteki.Common.Tests/App.config
new file mode 100644
index 0000000..9fd381c
--- /dev/null
+++ b/Suteki.Shop/Suteki.Common.Tests/App.config
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Suteki.Shop/Suteki.Common.Tests/Binders/BindUsingAttributeTester.cs b/Suteki.Shop/Suteki.Common.Tests/Binders/BindUsingAttributeTester.cs
new file mode 100644
index 0000000..f966b44
--- /dev/null
+++ b/Suteki.Shop/Suteki.Common.Tests/Binders/BindUsingAttributeTester.cs
@@ -0,0 +1,69 @@
+using System;
+using System.Web.Mvc;
+using NUnit.Framework;
+using Suteki.Common.Binders;
+using Suteki.Common.Windsor;
+
+namespace Suteki.Common.Tests.Binders
+{
+ [TestFixture]
+ public class BindUsingAttributeTester
+ {
+ [SetUp]
+ public void Setup()
+ {
+ IocContainer.SetResolveFunction(Activator.CreateInstance);
+ }
+
+ [TearDown]
+ public void Teardown()
+ {
+ IocContainer.Reset();
+ }
+
+ [Test]
+ public void Should_delegate_to_inner_binder()
+ {
+ var attribute = new BindUsingAttribute(typeof(TestBinder));
+ attribute.GetBinder().ShouldBe();
+ }
+
+ [Test]
+ public void Should_throw_if_type_is_not_IModelBinder()
+ {
+ typeof(InvalidOperationException).ShouldBeThrownBy(() => new BindUsingAttribute(typeof(IDisposable)));
+ }
+
+ [Test]
+ public void Binder_should_Accept_attribute()
+ {
+ var attribute = new BindUsingAttribute(typeof(TestBinder2));
+ var binder = attribute.GetBinder() as TestBinder2;
+ binder.Attribute.ShouldNotBeNull();
+ }
+
+ private class TestBinder2 : IModelBinder, IAcceptsAttribute
+ {
+ public BindUsingAttribute Attribute;
+
+ public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
+ {
+ return null;
+ }
+
+
+ public void Accept(Attribute attribute)
+ {
+ this.Attribute = (BindUsingAttribute) attribute;
+ }
+ }
+
+ private class TestBinder : IModelBinder
+ {
+ public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
+ {
+ return null;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Suteki.Shop/Suteki.Common.Tests/Binders/DefaultModelBinderSpike.cs b/Suteki.Shop/Suteki.Common.Tests/Binders/DefaultModelBinderSpike.cs
new file mode 100644
index 0000000..8a952d9
--- /dev/null
+++ b/Suteki.Shop/Suteki.Common.Tests/Binders/DefaultModelBinderSpike.cs
@@ -0,0 +1,252 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.ComponentModel.DataAnnotations;
+using System.Globalization;
+using System.Web;
+using System.Web.Mvc;
+using NUnit.Framework;
+using Rhino.Mocks;
+
+namespace Suteki.Common.Tests.Binders
+{
+ [TestFixture, Explicit]
+ public class DefaultModelBinderSpike
+ {
+ private DefaultModelBinder binder;
+ ControllerContext controllerContext;
+ HttpRequestBase request;
+
+ [SetUp]
+ public void SetUp()
+ {
+ binder = new DefaultModelBinder();
+ controllerContext = new ControllerContext
+ {
+ HttpContext = MockRepository.GenerateStub()
+ };
+ request = MockRepository.GenerateStub();
+ controllerContext.HttpContext.Stub(x => x.Request).Return(request);
+ }
+
+ [Test]
+ public void Lets_see_how_it_works()
+ {
+ var bindingContext = new ModelBindingContext
+ {
+ ModelMetadata = GetModelMetadata(null),
+ ValueProvider = new FakeValueProvider()
+ };
+
+ var entity = binder.BindModel(controllerContext, bindingContext) as BindableEntity;
+
+ PrintEntity(entity);
+ PrintErrors(bindingContext.ModelState);
+ }
+
+ [Test]
+ public void Provide_some_data()
+ {
+ var values = new NameValueCollection
+ {
+ { "Id", "10" },
+ { "Name", "The Bound Thing" },
+ { "Date", "30/1/2010" },
+ { "Reference", "41b16710-1f27-4bb3-8231-f8bba148396c" },
+ { "Price", "123.45" }
+ };
+
+ var bindingContext = new ModelBindingContext
+ {
+ ModelMetadata = GetModelMetadata(null),
+ ValueProvider = new NameValueCollectionValueProvider(values, CultureInfo.GetCultureInfo("EN-GB"))
+ };
+
+ var entity = binder.BindModel(controllerContext, bindingContext) as BindableEntity;
+
+ PrintEntity(entity);
+ PrintErrors(bindingContext.ModelState);
+ }
+
+ [Test]
+ public void Is_it_case_sensitive()
+ {
+ var values = new NameValueCollection
+ {
+ { "id", "10" },
+ { "name", "The Bound Thing" },
+ { "date", "30/1/2010" },
+ { "reference", "41b16710-1f27-4bb3-8231-f8bba148396c" },
+ { "price", "123.45" }
+ };
+
+ var bindingContext = new ModelBindingContext
+ {
+ ModelMetadata = GetModelMetadata(null),
+ ValueProvider = new NameValueCollectionValueProvider(values, CultureInfo.GetCultureInfo("EN-GB"))
+ };
+
+ var entity = binder.BindModel(controllerContext, bindingContext) as BindableEntity;
+
+ PrintEntity(entity);
+ PrintErrors(bindingContext.ModelState);
+ }
+
+ [Test]
+ public void Use_a_prefix()
+ {
+ var values = new NameValueCollection
+ {
+ { "foo.Id", "10" },
+ { "foo.Name", "The Bound Thing" },
+ { "foo.Date", "30/1/2010" },
+ { "foo.Reference", "41b16710-1f27-4bb3-8231-f8bba148396c" },
+ { "foo.Price", "123.45" }
+ };
+
+ var bindingContext = new ModelBindingContext
+ {
+ ModelName = "foo",
+ ModelMetadata = GetModelMetadata(null),
+ ValueProvider = new NameValueCollectionValueProvider(values, CultureInfo.GetCultureInfo("EN-GB"))
+ };
+
+ var entity = binder.BindModel(controllerContext, bindingContext) as BindableEntity;
+
+ PrintEntity(entity);
+ PrintErrors(bindingContext.ModelState);
+ }
+
+ [Test]
+ public void Include_child_entity_value()
+ {
+ var values = new NameValueCollection
+ {
+ { "Id", "10" },
+ { "Name", "The Bound Thing" },
+ { "Date", "30/1/2010" },
+ { "Reference", "41b16710-1f27-4bb3-8231-f8bba148396c" },
+ { "Price", "123.45" },
+ { "ChildEntity.Name", "The Child Thing"}
+ };
+
+ var bindingContext = new ModelBindingContext
+ {
+ ModelMetadata = GetModelMetadata(null),
+ ValueProvider = new NameValueCollectionValueProvider(values, CultureInfo.GetCultureInfo("EN-GB"))
+ };
+
+ var entity = binder.BindModel(controllerContext, bindingContext) as BindableEntity;
+
+ PrintEntity(entity);
+ PrintErrors(bindingContext.ModelState);
+ }
+
+ [Test]
+ public void Providing_a_model_means_it_gets_updated()
+ {
+ var providedEntity = new BindableEntity
+ {
+ Id = 4,
+ Name = "The Original Name",
+ Date = new DateTime(1900, 1, 1),
+ Reference = Guid.NewGuid(),
+ Price = 111.11M,
+ ChildEntity = new ChildEntity
+ {
+ Name = "The Orginal Child"
+ }
+ };
+
+ var values = new NameValueCollection
+ {
+ { "Id", "10" },
+ { "Name", "The Bound Thing" },
+ { "Date", "30/1/2010" },
+ { "Reference", "41b16710-1f27-4bb3-8231-f8bba148396c" },
+ { "Price", "123.45" },
+ { "ChildEntity.Name", "The Child Thing"}
+ };
+
+ var bindingContext = new ModelBindingContext
+ {
+ ModelMetadata = GetModelMetadata(() => providedEntity),
+ ValueProvider = new NameValueCollectionValueProvider(values, CultureInfo.GetCultureInfo("EN-GB"))
+ };
+
+ var entity = binder.BindModel(controllerContext, bindingContext) as BindableEntity;
+
+ PrintEntity(entity);
+ PrintErrors(bindingContext.ModelState);
+ }
+
+ private static ModelMetadata GetModelMetadata(Func