You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ibatis.apache.org by gb...@apache.org on 2005/06/19 16:45:25 UTC
svn commit: r191346 [10/16] - in /ibatis/trunk/cs/npetshop2: ./
External-bin/ NPetshop.Domain/ NPetshop.Domain/Accounts/
NPetshop.Domain/Billing/ NPetshop.Domain/Catalog/ NPetshop.Domain/Shopping/
NPetshop.Persistence/ NPetshop.Persistence/Ddl/ NPetsho...
Added: ibatis/trunk/cs/npetshop2/NPetshop.Presentation/ShoppingController.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Presentation/ShoppingController.cs?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Presentation/ShoppingController.cs (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Presentation/ShoppingController.cs Sun Jun 19 07:45:17 2005
@@ -0,0 +1,76 @@
+using System;
+using NPetshop.Domain.Shopping;
+using NPetshop.Service.Interfaces;
+
+namespace NPetshop.Presentation
+{
+ /// <summary>
+ /// Summary description for ShoppingController.
+ /// </summary>
+ public class ShoppingController : NPetshopController
+ {
+ private ICatalogService _catalogService = null;
+
+ public ShoppingController(ICatalogService catalogService)
+ {
+ _catalogService = catalogService;
+ }
+
+ public void AddItemToCart(string itemId)
+ {
+ if (this.NState.CurrentShoppingCart != null)
+ {
+ this.NState.CurrentShoppingCart.Add(_catalogService.GetItem(itemId));
+ }
+ else
+ {
+ this.NState.Command = "signIn";
+ }
+ this.Navigate();
+ }
+
+ public void RemoveItemFromCart(string itemId)
+ {
+ if (this.NState.CurrentShoppingCart != null)
+ {
+ this.NState.CurrentShoppingCart.RemoveLine(_catalogService.GetItem(itemId));
+ this.NState.Command = "showCart";
+ }
+ else
+ {
+ this.NState.Command = "signIn";
+ }
+ this.Navigate();
+ }
+
+ public void ShowShoppingCart()
+ {
+ if (this.NState.CurrentShoppingCart != null)
+ {
+ this.NState.Command = "showCart";
+ }
+ else
+ {
+ this.NState.Command = "signIn";
+ }
+ this.Navigate();
+ }
+
+ public void UpdateQuantityByItemId(string itemId, int quantity)
+ {
+ ShoppingCartLine cartLine = this.NState.CurrentShoppingCart.FindLine(_catalogService.GetItem(itemId));
+ cartLine.Quantity = quantity;
+ this.NState.Save();
+ }
+
+ public void ProceedCheckout()
+ {
+ this.Navigate();
+ }
+
+ public void ContinueCheckout()
+ {
+ this.Navigate();
+ }
+ }
+}
Added: ibatis/trunk/cs/npetshop2/NPetshop.Service/AssemblyInfo.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Service/AssemblyInfo.cs?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Service/AssemblyInfo.cs (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Service/AssemblyInfo.cs Sun Jun 19 07:45:17 2005
@@ -0,0 +1,58 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+//
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+//
+[assembly: AssemblyTitle("")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion("1.0.*")]
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing.
+//
+// Notes:
+// (*) If no key is specified, the assembly is not signed.
+// (*) KeyName refers to a key that has been installed in the Crypto Service
+// Provider (CSP) on your machine. KeyFile refers to a file which contains
+// a key.
+// (*) If the KeyFile and the KeyName values are both specified, the
+// following processing occurs:
+// (1) If the KeyName can be found in the CSP, that key is used.
+// (2) If the KeyName does not exist and the KeyFile does exist, the key
+// in the KeyFile is installed into the CSP and used.
+// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
+// When specifying the KeyFile, the location of the KeyFile should be
+// relative to the project output directory which is
+// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
+// located in the project directory, you would specify the AssemblyKeyFile
+// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
+// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+// documentation for more information on this.
+//
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("")]
+[assembly: AssemblyKeyName("")]
Added: ibatis/trunk/cs/npetshop2/NPetshop.Service/Impl/AccountService.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Service/Impl/AccountService.cs?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Service/Impl/AccountService.cs (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Service/Impl/AccountService.cs Sun Jun 19 07:45:17 2005
@@ -0,0 +1,83 @@
+
+
+using System.Collections;
+using NPetshop.Domain.Accounts;
+using NPetshop.Persistence.Interfaces.Accounts;
+using NPetshop.Service.Interfaces;
+
+namespace NPetshop.Service.Impl
+{
+ /// <summary>
+ /// Summary description for AccountService.
+ /// </summary>
+ public class AccountService : BaseService, IAccountService
+ {
+ #region Private Fields
+ private IAccountDao _accountDao = null;
+ #endregion
+
+ #region Constructor
+ public AccountService():base()
+ {
+ _accountDao = _daoManager.GetDao( typeof(IAccountDao) ) as IAccountDao;
+ }
+ #endregion
+
+ #region Public methods
+
+ public Account GetAccount(string username)
+ {
+ Account account = null;
+
+ account = _accountDao.GetAccount(username);
+
+ return account;
+ }
+
+ public Account GetAccount(string login, string password)
+ {
+ Account account = null;
+
+ account = _accountDao.GetAccount(login, password);
+
+ return account;
+ }
+
+ public void InsertAccount(Account account)
+ {
+ _daoManager.BeginTransaction();
+ try
+ {
+ _accountDao.InsertAccount(account);
+ _daoManager.CommitTransaction();
+ }
+ catch
+ {
+ _daoManager.RollBackTransaction();
+ throw;
+ }
+ }
+
+ public void UpdateAccount(Account account)
+ {
+ _daoManager.BeginTransaction();
+ try
+ {
+ _accountDao.UpdateAccount(account);
+ _daoManager.CommitTransaction();
+ }
+ catch
+ {
+ _daoManager.RollBackTransaction();
+ throw;
+ }
+ }
+
+ public IList GetUsernameList()
+ {
+ return _accountDao.GetUsernameList();
+ }
+ #endregion
+
+ }
+}
Added: ibatis/trunk/cs/npetshop2/NPetshop.Service/Impl/BaseService.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Service/Impl/BaseService.cs?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Service/Impl/BaseService.cs (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Service/Impl/BaseService.cs Sun Jun 19 07:45:17 2005
@@ -0,0 +1,18 @@
+using System;
+using IBatisNet.DataAccess;
+
+namespace NPetshop.Service.Impl
+{
+ /// <summary>
+ /// Summary description for BaseService.
+ /// </summary>
+ public abstract class BaseService
+ {
+ protected DaoManager _daoManager = null;
+
+ public BaseService()
+ {
+ _daoManager = ServiceConfig.GetInstance(false).DaoManager;
+ }
+ }
+}
Added: ibatis/trunk/cs/npetshop2/NPetshop.Service/Impl/BillingService.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Service/Impl/BillingService.cs?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Service/Impl/BillingService.cs (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Service/Impl/BillingService.cs Sun Jun 19 07:45:17 2005
@@ -0,0 +1,89 @@
+
+
+using IBatisNet.Common.Pagination;
+using IBatisNet.DataAccess;
+using NPetshop.Domain.Billing;
+using NPetshop.Persistence.Interfaces;
+using NPetshop.Persistence.Interfaces.Billing;
+using NPetshop.Persistence.Interfaces.Catalog;
+using NPetshop.Service.Interfaces;
+
+namespace NPetshop.Service.Impl
+{
+ /// <summary>
+ /// Summary description for OrderService.
+ /// </summary>
+ public class BillingService : BaseService, IBillingService
+ {
+ #region Private Fields
+ private IOrderDao _orderDao = null;
+ private IItemDao _itemDao = null;
+ private ISequenceDao _sequenceDao = null;
+ #endregion
+
+ #region Constructor
+ public BillingService():base()
+ {
+ _itemDao = _daoManager[typeof(IItemDao)] as IItemDao;
+ _orderDao = _daoManager[typeof(IOrderDao)] as IOrderDao;
+ _sequenceDao = _daoManager[typeof(ISequenceDao)] as ISequenceDao;
+
+ }
+ #endregion
+
+ #region Public methods
+
+
+ #region Order
+
+ public void InsertOrder(Order order)
+ {
+ // Get the next id within a separate transaction
+ order.Id = GetNextId("OrderNum");
+
+ _daoManager.BeginTransaction();
+ try
+ {
+ _itemDao.UpdateQuantity(order);
+ _orderDao.InsertOrder(order);
+
+ _daoManager.CommitTransaction();
+ }
+ catch
+ {
+ _daoManager.RollBackTransaction();
+ throw;
+ }
+ }
+
+ public IPaginatedList GetOrdersByUsername(string userName)
+ {
+ return _orderDao.GetOrdersByUsername(userName);
+ }
+
+ #endregion
+
+ #region Sequence
+ public int GetNextId(string key)
+ {
+ int id = -1;
+
+ _daoManager.BeginTransaction();
+ try
+ {
+ id = _sequenceDao.GetNextId(key);
+ _daoManager.CommitTransaction();
+ }
+ catch
+ {
+ _daoManager.RollBackTransaction();
+ throw;
+ }
+
+ return id;
+ }
+ #endregion
+
+ #endregion
+ }
+}
Added: ibatis/trunk/cs/npetshop2/NPetshop.Service/Impl/CatalogService.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Service/Impl/CatalogService.cs?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Service/Impl/CatalogService.cs (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Service/Impl/CatalogService.cs Sun Jun 19 07:45:17 2005
@@ -0,0 +1,111 @@
+
+
+using System.Collections;
+using IBatisNet.Common.Pagination;
+using IBatisNet.DataAccess;
+using NPetshop.Domain.Catalog;
+using NPetshop.Persistence.Interfaces.Catalog;
+using NPetshop.Service.Interfaces;
+
+namespace NPetshop.Service.Impl
+{
+ /// <summary>
+ /// Summary description for CatalogService.
+ /// </summary>
+ public class CatalogService : BaseService, ICatalogService
+ {
+ #region Private Fields
+ private IItemDao _itemDao = null;
+ private IProductDao _productDao = null;
+ private ICategoryDao _categoryDao = null;
+ #endregion
+
+ #region Constructor
+ public CatalogService():base()
+ {
+ _categoryDao = _daoManager[typeof(ICategoryDao)] as ICategoryDao;
+ _productDao = _daoManager[typeof(IProductDao)] as IProductDao;
+ _itemDao = _daoManager[typeof(IItemDao)] as IItemDao;
+ }
+ #endregion
+
+ #region Public methods
+
+ #region Item
+ public IPaginatedList GetItemListByProduct(Product product)
+ {
+ IPaginatedList itemList = null;
+
+ itemList = _itemDao.GetItemListByProduct(product.Id);
+ foreach(Item item in itemList)
+ {
+ item.Product = product;
+ }
+
+ return itemList;
+ }
+
+ public Item GetItem(string itemId)
+ {
+ Item item = null;
+
+ item = _itemDao.GetItem(itemId);
+
+ return item;
+ }
+
+ public bool IsItemInStock(string itemId)
+ {
+ return _itemDao.IsItemInStock(itemId);
+ }
+ #endregion
+
+ #region Product
+ public Product GetProduct(string productId)
+ {
+ Product product = null;
+
+ product = _productDao.GetProduct(productId);
+
+ return product;
+ }
+
+ public IPaginatedList GetProductListByCategory(string categoryId)
+ {
+ IPaginatedList productList = null;
+
+ productList = _productDao.GetProductListByCategory(categoryId);
+
+ return productList;
+ }
+
+ public IPaginatedList SearchProductList(string keywords)
+ {
+ IPaginatedList productList = null;
+
+ productList = _productDao.SearchProductList(keywords);
+
+ return productList;
+ }
+ #endregion
+
+ #region Category
+ public IList GetCategoryList()
+ {
+ return _categoryDao.GetCategoryList();
+ }
+
+ public Category GetCategory(string categoryId)
+ {
+ Category category = null;
+
+ category = _categoryDao.GetCategory(categoryId);
+
+ return category;
+ }
+ #endregion
+
+ #endregion
+
+ }
+}
Added: ibatis/trunk/cs/npetshop2/NPetshop.Service/Impl/ShoppingService.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Service/Impl/ShoppingService.cs?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Service/Impl/ShoppingService.cs (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Service/Impl/ShoppingService.cs Sun Jun 19 07:45:17 2005
@@ -0,0 +1,26 @@
+
+
+using NPetshop.Domain.Shopping;
+using NPetshop.Service.Interfaces;
+
+namespace NPetshop.Service.Impl
+{
+ /// <summary>
+ /// Summary description for ShoppingService.
+ /// </summary>
+ public class ShoppingService : IShoppingService
+ {
+
+ public ShoppingService()
+ {
+ }
+
+ #region Public methods
+
+ public ShoppingCart CreateNewShoppingCart()
+ {
+ return new ShoppingCart();
+ }
+ #endregion
+ }
+}
Added: ibatis/trunk/cs/npetshop2/NPetshop.Service/Interfaces/IAccountService.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Service/Interfaces/IAccountService.cs?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Service/Interfaces/IAccountService.cs (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Service/Interfaces/IAccountService.cs Sun Jun 19 07:45:17 2005
@@ -0,0 +1,14 @@
+using System.Collections;
+using NPetshop.Domain.Accounts;
+
+namespace NPetshop.Service.Interfaces
+{
+ public interface IAccountService
+ {
+ Account GetAccount(string username);
+ Account GetAccount(string login, string password);
+ void InsertAccount(Account account);
+ void UpdateAccount(Account account);
+ IList GetUsernameList();
+ }
+}
\ No newline at end of file
Added: ibatis/trunk/cs/npetshop2/NPetshop.Service/Interfaces/IBillingService.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Service/Interfaces/IBillingService.cs?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Service/Interfaces/IBillingService.cs (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Service/Interfaces/IBillingService.cs Sun Jun 19 07:45:17 2005
@@ -0,0 +1,12 @@
+using IBatisNet.Common.Pagination;
+using NPetshop.Domain.Billing;
+
+namespace NPetshop.Service.Interfaces
+{
+ public interface IBillingService
+ {
+ void InsertOrder(Order order);
+ IPaginatedList GetOrdersByUsername(string userName);
+ int GetNextId(string key);
+ }
+}
\ No newline at end of file
Added: ibatis/trunk/cs/npetshop2/NPetshop.Service/Interfaces/ICatalogService.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Service/Interfaces/ICatalogService.cs?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Service/Interfaces/ICatalogService.cs (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Service/Interfaces/ICatalogService.cs Sun Jun 19 07:45:17 2005
@@ -0,0 +1,18 @@
+using System.Collections;
+using IBatisNet.Common.Pagination;
+using NPetshop.Domain.Catalog;
+
+namespace NPetshop.Service.Interfaces
+{
+ public interface ICatalogService
+ {
+ IPaginatedList GetItemListByProduct(Product product);
+ Item GetItem(string itemId);
+ bool IsItemInStock(string itemId);
+ Product GetProduct(string productId);
+ IPaginatedList GetProductListByCategory(string categoryId);
+ IPaginatedList SearchProductList(string keywords);
+ IList GetCategoryList();
+ Category GetCategory(string categoryId);
+ }
+}
\ No newline at end of file
Added: ibatis/trunk/cs/npetshop2/NPetshop.Service/Interfaces/IShoppingService.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Service/Interfaces/IShoppingService.cs?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Service/Interfaces/IShoppingService.cs (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Service/Interfaces/IShoppingService.cs Sun Jun 19 07:45:17 2005
@@ -0,0 +1,9 @@
+using NPetshop.Domain.Shopping;
+
+namespace NPetshop.Service.Interfaces
+{
+ public interface IShoppingService
+ {
+ ShoppingCart CreateNewShoppingCart();
+ }
+}
\ No newline at end of file
Added: ibatis/trunk/cs/npetshop2/NPetshop.Service/NPetshop.Service.csproj
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Service/NPetshop.Service.csproj?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Service/NPetshop.Service.csproj (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Service/NPetshop.Service.csproj Sun Jun 19 07:45:17 2005
@@ -0,0 +1,165 @@
+<VisualStudioProject>
+ <CSHARP
+ ProjectType = "Local"
+ ProductVersion = "7.10.3077"
+ SchemaVersion = "2.0"
+ ProjectGuid = "{AFD8E8A6-C647-4107-B069-DE24C617CFA7}"
+ >
+ <Build>
+ <Settings
+ ApplicationIcon = ""
+ AssemblyKeyContainerName = ""
+ AssemblyName = "NPetshop.Service"
+ AssemblyOriginatorKeyFile = ""
+ DefaultClientScript = "JScript"
+ DefaultHTMLPageLayout = "Grid"
+ DefaultTargetSchema = "IE50"
+ DelaySign = "false"
+ OutputType = "Library"
+ PreBuildEvent = ""
+ PostBuildEvent = ""
+ RootNamespace = "NPetshop.Service"
+ RunPostBuildEvent = "OnBuildSuccess"
+ StartupObject = ""
+ >
+ <Config
+ Name = "Debug"
+ AllowUnsafeBlocks = "false"
+ BaseAddress = "285212672"
+ CheckForOverflowUnderflow = "false"
+ ConfigurationOverrideFile = ""
+ DefineConstants = "DEBUG;TRACE"
+ DocumentationFile = ""
+ DebugSymbols = "true"
+ FileAlignment = "4096"
+ IncrementalBuild = "false"
+ NoStdLib = "false"
+ NoWarn = ""
+ Optimize = "false"
+ OutputPath = "bin\Debug\"
+ RegisterForComInterop = "false"
+ RemoveIntegerChecks = "false"
+ TreatWarningsAsErrors = "false"
+ WarningLevel = "4"
+ />
+ <Config
+ Name = "Release"
+ AllowUnsafeBlocks = "false"
+ BaseAddress = "285212672"
+ CheckForOverflowUnderflow = "false"
+ ConfigurationOverrideFile = ""
+ DefineConstants = "TRACE"
+ DocumentationFile = ""
+ DebugSymbols = "false"
+ FileAlignment = "4096"
+ IncrementalBuild = "false"
+ NoStdLib = "false"
+ NoWarn = ""
+ Optimize = "true"
+ OutputPath = "bin\Release\"
+ RegisterForComInterop = "false"
+ RemoveIntegerChecks = "false"
+ TreatWarningsAsErrors = "false"
+ WarningLevel = "4"
+ />
+ </Settings>
+ <References>
+ <Reference
+ Name = "System"
+ AssemblyName = "System"
+ HintPath = "D:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.dll"
+ />
+ <Reference
+ Name = "System.Data"
+ AssemblyName = "System.Data"
+ HintPath = "D:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
+ />
+ <Reference
+ Name = "System.XML"
+ AssemblyName = "System.Xml"
+ HintPath = "D:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.XML.dll"
+ />
+ <Reference
+ Name = "NPetshop.Domain"
+ Project = "{7D1DA776-6341-43C8-B9C7-8FA344996665}"
+ Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
+ />
+ <Reference
+ Name = "NPetshop.Persistence"
+ Project = "{CD60B882-160E-4BC9-A580-3A8079A60499}"
+ Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
+ />
+ <Reference
+ Name = "IBatisNet.DataAccess"
+ AssemblyName = "IBatisNet.DataAccess"
+ HintPath = "..\External-bin\IBatisNet.DataAccess.dll"
+ />
+ <Reference
+ Name = "IBatisNet.Common"
+ AssemblyName = "IBatisNet.Common"
+ HintPath = "..\External-bin\IBatisNet.Common.dll"
+ />
+ </References>
+ </Build>
+ <Files>
+ <Include>
+ <File
+ RelPath = "AssemblyInfo.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "ServiceConfig.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Impl\AccountService.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Impl\BaseService.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Impl\BillingService.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Impl\CatalogService.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Impl\ShoppingService.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Interfaces\IAccountService.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Interfaces\IBillingService.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Interfaces\ICatalogService.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Interfaces\IShoppingService.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ </Include>
+ </Files>
+ </CSHARP>
+</VisualStudioProject>
+
Added: ibatis/trunk/cs/npetshop2/NPetshop.Service/NPetshop.Service.csproj.user
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Service/NPetshop.Service.csproj.user?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Service/NPetshop.Service.csproj.user (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Service/NPetshop.Service.csproj.user Sun Jun 19 07:45:17 2005
@@ -0,0 +1,48 @@
+<VisualStudioProject>
+ <CSHARP LastOpenVersion = "7.10.3077" >
+ <Build>
+ <Settings ReferencePath = "H:\iBATIS\trunk\cs\npetshop2\External-bin\;E:\Projet\iBatis\trunk\cs\npetshop2\External-bin\" >
+ <Config
+ Name = "Debug"
+ EnableASPDebugging = "false"
+ EnableASPXDebugging = "false"
+ EnableUnmanagedDebugging = "false"
+ EnableSQLServerDebugging = "false"
+ RemoteDebugEnabled = "false"
+ RemoteDebugMachine = ""
+ StartAction = "Project"
+ StartArguments = ""
+ StartPage = ""
+ StartProgram = ""
+ StartURL = ""
+ StartWorkingDirectory = ""
+ StartWithIE = "false"
+ />
+ <Config
+ Name = "Release"
+ EnableASPDebugging = "false"
+ EnableASPXDebugging = "false"
+ EnableUnmanagedDebugging = "false"
+ EnableSQLServerDebugging = "false"
+ RemoteDebugEnabled = "false"
+ RemoteDebugMachine = ""
+ StartAction = "Project"
+ StartArguments = ""
+ StartPage = ""
+ StartProgram = ""
+ StartURL = ""
+ StartWorkingDirectory = ""
+ StartWithIE = "false"
+ />
+ </Settings>
+ </Build>
+ <OtherProjectSettings
+ CopyProjectDestinationFolder = ""
+ CopyProjectUncPath = ""
+ CopyProjectOption = "0"
+ ProjectView = "ProjectFiles"
+ ProjectTrust = "0"
+ />
+ </CSHARP>
+</VisualStudioProject>
+
Added: ibatis/trunk/cs/npetshop2/NPetshop.Service/ServiceConfig.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Service/ServiceConfig.cs?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Service/ServiceConfig.cs (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Service/ServiceConfig.cs Sun Jun 19 07:45:17 2005
@@ -0,0 +1,75 @@
+
+using System;
+
+using IBatisNet.Common.Utilities;
+using IBatisNet.DataAccess;
+using IBatisNet.DataAccess.Configuration;
+
+namespace NPetshop.Service
+{
+ /// <summary>
+ /// Summary description for ServiceConfig.
+ /// </summary>
+ public class ServiceConfig
+ {
+ static private object _synRoot = new Object();
+ static private ServiceConfig _instance;
+
+ private DaoManager _daoManager = null;
+
+ /// <summary>
+ /// Remove public constructor. prevent instantiation.
+ /// </summary>
+ private ServiceConfig(){}
+
+ static public ServiceConfig GetInstance(bool test)
+ {
+ if (_instance==null)
+ {
+ lock(_synRoot)
+ {
+ if (_instance==null)
+ {
+ DomDaoManagerBuilder builder = new DomDaoManagerBuilder();
+ ConfigureHandler handler = new ConfigureHandler( ServiceConfig.Reset );
+ if (test)
+ {
+ builder.Configure(@"..\..\..\NPetshop.Persistence\dao.config");
+ }
+ else
+ {
+ builder.Configure(@"..\NPetshop.Persistence\dao.config");
+ }
+
+ _instance = new ServiceConfig();
+ _instance._daoManager = DaoManager.GetInstance("SqlMapDao");
+ }
+ }
+ }
+ return _instance;
+ }
+
+
+ /// <summary>
+ /// Reset the singleton
+ /// </summary>
+ /// <remarks>
+ /// Must verify ConfigureHandler signature.
+ /// </remarks>
+ /// <param name="obj">
+ /// </param>
+ static public void Reset(object obj)
+ {
+ _instance =null;
+ }
+
+ public DaoManager DaoManager
+ {
+ get
+ {
+ return _daoManager;
+ }
+ }
+
+ }
+}
Added: ibatis/trunk/cs/npetshop2/NPetshop.Test/AssemblyInfo.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Test/AssemblyInfo.cs?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Test/AssemblyInfo.cs (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Test/AssemblyInfo.cs Sun Jun 19 07:45:17 2005
@@ -0,0 +1,58 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+//
+// Les informations générales relatives à un assembly dépendent de
+// l'ensemble d'attributs suivant. Pour modifier les informations
+// associées à un assembly, changez les valeurs de ces attributs.
+//
+[assembly: AssemblyTitle("")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//
+// Les informations de version pour un assembly se composent des quatre valeurs suivantes :
+//
+// Version principale
+// Version secondaire
+// Numéro de build
+// Révision
+//
+// Vous pouvez spécifier toutes les valeurs ou indiquer des numéros de révision et de build par défaut
+// en utilisant '*', comme ci-dessous :
+
+[assembly: AssemblyVersion("1.0.*")]
+
+//
+// Pour signer votre assembly, vous devez spécifier la clé à utiliser. Consultez
+// la documentation Microsoft .NET Framework pour plus d'informations sur la signature d'un assembly.
+//
+// Utilisez les attributs ci-dessous pour contrôler la clé utilisée lors de la signature.
+//
+// Remarques :
+// (*) Si aucune clé n'est spécifiée, l'assembly n'est pas signé.
+// (*) KeyName fait référence à une clé installée dans le fournisseur de
+// services cryptographiques (CSP) de votre ordinateur. KeyFile fait référence à un fichier qui contient
+// une clé.
+// (*) Si les valeurs de KeyFile et de KeyName sont spécifiées, le
+// traitement suivant se produit :
+// (1) Si KeyName se trouve dans le CSP, la clé est utilisée.
+// (2) Si KeyName n'existe pas mais que KeyFile existe, la clé
+// de KeyFile est installée dans le CSP et utilisée.
+// (*) Pour créer KeyFile, vous pouvez utiliser l'utilitaire sn.exe (Strong Name, Nom fort).
+// Lors de la spécification de KeyFile, son emplacement doit être
+// relatif au répertoire de sortie du projet qui est
+// %Project Directory%\obj\<configuration>. Par exemple, si votre KeyFile se trouve
+// dans le répertoire du projet, vous devez spécifier l'attribut
+// AssemblyKeyFile sous la forme [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
+// (*) DelaySign (signature différée) est une option avancée. Pour plus d'informations, consultez la
+// documentation Microsoft .NET Framework.
+//
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("")]
+[assembly: AssemblyKeyName("")]
Added: ibatis/trunk/cs/npetshop2/NPetshop.Test/NPetshop.Test.csproj
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Test/NPetshop.Test.csproj?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Test/NPetshop.Test.csproj (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Test/NPetshop.Test.csproj Sun Jun 19 07:45:17 2005
@@ -0,0 +1,184 @@
+<VisualStudioProject>
+ <CSHARP
+ ProjectType = "Local"
+ ProductVersion = "7.10.3077"
+ SchemaVersion = "2.0"
+ ProjectGuid = "{BD25CBA1-38E2-4BD1-A32B-6632B55C938B}"
+ >
+ <Build>
+ <Settings
+ ApplicationIcon = ""
+ AssemblyKeyContainerName = ""
+ AssemblyName = "NPetshop.Test"
+ AssemblyOriginatorKeyFile = ""
+ DefaultClientScript = "JScript"
+ DefaultHTMLPageLayout = "Grid"
+ DefaultTargetSchema = "IE50"
+ DelaySign = "false"
+ OutputType = "Library"
+ PreBuildEvent = ""
+ PostBuildEvent = ""
+ RootNamespace = "NPetshop.Test"
+ RunPostBuildEvent = "OnBuildSuccess"
+ StartupObject = ""
+ >
+ <Config
+ Name = "Debug"
+ AllowUnsafeBlocks = "false"
+ BaseAddress = "285212672"
+ CheckForOverflowUnderflow = "false"
+ ConfigurationOverrideFile = ""
+ DefineConstants = "DEBUG;TRACE"
+ DocumentationFile = ""
+ DebugSymbols = "true"
+ FileAlignment = "4096"
+ IncrementalBuild = "false"
+ NoStdLib = "false"
+ NoWarn = ""
+ Optimize = "false"
+ OutputPath = "bin\Debug\"
+ RegisterForComInterop = "false"
+ RemoveIntegerChecks = "false"
+ TreatWarningsAsErrors = "false"
+ WarningLevel = "4"
+ />
+ <Config
+ Name = "Release"
+ AllowUnsafeBlocks = "false"
+ BaseAddress = "285212672"
+ CheckForOverflowUnderflow = "false"
+ ConfigurationOverrideFile = ""
+ DefineConstants = "TRACE"
+ DocumentationFile = ""
+ DebugSymbols = "false"
+ FileAlignment = "4096"
+ IncrementalBuild = "false"
+ NoStdLib = "false"
+ NoWarn = ""
+ Optimize = "true"
+ OutputPath = "bin\Release\"
+ RegisterForComInterop = "false"
+ RemoveIntegerChecks = "false"
+ TreatWarningsAsErrors = "false"
+ WarningLevel = "4"
+ />
+ </Settings>
+ <References>
+ <Reference
+ Name = "System"
+ AssemblyName = "System"
+ HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
+ />
+ <Reference
+ Name = "System.Data"
+ AssemblyName = "System.Data"
+ HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
+ />
+ <Reference
+ Name = "System.XML"
+ AssemblyName = "System.Xml"
+ HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll"
+ />
+ <Reference
+ Name = "NPetshop.Persistence"
+ Project = "{CD60B882-160E-4BC9-A580-3A8079A60499}"
+ Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
+ />
+ <Reference
+ Name = "NPetshop.Domain"
+ Project = "{7D1DA776-6341-43C8-B9C7-8FA344996665}"
+ Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
+ />
+ <Reference
+ Name = "nunit.framework"
+ AssemblyName = "nunit.framework"
+ HintPath = "D:\Program Files\NUnit 2.2\bin\nunit.framework.dll"
+ AssemblyFolderKey = "hklm\dn\nunit.framework"
+ />
+ <Reference
+ Name = "log4net"
+ AssemblyName = "log4net"
+ HintPath = "..\External-bin\log4net.dll"
+ />
+ <Reference
+ Name = "IBatisNet.DataAccess"
+ AssemblyName = "IBatisNet.DataAccess"
+ HintPath = "..\External-bin\IBatisNet.DataAccess.dll"
+ />
+ <Reference
+ Name = "NPetshop.Presentation"
+ Project = "{182B5E6F-CAFA-42A6-B0EA-8782F2F3A48A}"
+ Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
+ />
+ <Reference
+ Name = "Castle.Windsor"
+ AssemblyName = "Castle.Windsor"
+ HintPath = "..\External-bin\Castle.Windsor.dll"
+ />
+ <Reference
+ Name = "IBatisNet.Common"
+ AssemblyName = "IBatisNet.Common"
+ HintPath = "..\External-bin\IBatisNet.Common.dll"
+ />
+ <Reference
+ Name = "NPetshop.Service"
+ Project = "{AFD8E8A6-C647-4107-B069-DE24C617CFA7}"
+ Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
+ />
+ <Reference
+ Name = "NUnitAsp"
+ AssemblyName = "NUnitAsp"
+ HintPath = "..\External-bin\NUnitAsp.dll"
+ />
+ <Reference
+ Name = "Castle.MVC"
+ AssemblyName = "Castle.MVC"
+ HintPath = "..\External-bin\Castle.MVC.dll"
+ />
+ </References>
+ </Build>
+ <Files>
+ <Include>
+ <File
+ RelPath = "AssemblyInfo.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "readme.txt"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "bin\Debug\NPetshop.Test.dll.config"
+ BuildAction = "None"
+ />
+ <File
+ RelPath = "bin\Debug\properties.config"
+ BuildAction = "None"
+ />
+ <File
+ RelPath = "Persistence\BaseTest.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Persistence\DaoTest.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Presentation\ControllerTest.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <Folder RelPath = "Service\" />
+ <File
+ RelPath = "Web\WebFormTest.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ </Include>
+ </Files>
+ </CSHARP>
+</VisualStudioProject>
+
Added: ibatis/trunk/cs/npetshop2/NPetshop.Test/NPetshop.Test.csproj.user
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Test/NPetshop.Test.csproj.user?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Test/NPetshop.Test.csproj.user (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Test/NPetshop.Test.csproj.user Sun Jun 19 07:45:17 2005
@@ -0,0 +1,48 @@
+<VisualStudioProject>
+ <CSHARP LastOpenVersion = "7.10.3077" >
+ <Build>
+ <Settings ReferencePath = "E:\Projet\iBatis\trunk\cs\npetshop2\External-bin\;H:\iBATIS\trunk\cs\npetshop2\External-bin\" >
+ <Config
+ Name = "Debug"
+ EnableASPDebugging = "false"
+ EnableASPXDebugging = "false"
+ EnableUnmanagedDebugging = "false"
+ EnableSQLServerDebugging = "false"
+ RemoteDebugEnabled = "false"
+ RemoteDebugMachine = ""
+ StartAction = "Project"
+ StartArguments = ""
+ StartPage = ""
+ StartProgram = ""
+ StartURL = ""
+ StartWorkingDirectory = ""
+ StartWithIE = "true"
+ />
+ <Config
+ Name = "Release"
+ EnableASPDebugging = "false"
+ EnableASPXDebugging = "false"
+ EnableUnmanagedDebugging = "false"
+ EnableSQLServerDebugging = "false"
+ RemoteDebugEnabled = "false"
+ RemoteDebugMachine = ""
+ StartAction = "Project"
+ StartArguments = ""
+ StartPage = ""
+ StartProgram = ""
+ StartURL = ""
+ StartWorkingDirectory = ""
+ StartWithIE = "true"
+ />
+ </Settings>
+ </Build>
+ <OtherProjectSettings
+ CopyProjectDestinationFolder = ""
+ CopyProjectUncPath = ""
+ CopyProjectOption = "0"
+ ProjectView = "ProjectFiles"
+ ProjectTrust = "0"
+ />
+ </CSHARP>
+</VisualStudioProject>
+
Added: ibatis/trunk/cs/npetshop2/NPetshop.Test/Persistence/BaseTest.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Test/Persistence/BaseTest.cs?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Test/Persistence/BaseTest.cs (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Test/Persistence/BaseTest.cs Sun Jun 19 07:45:17 2005
@@ -0,0 +1,30 @@
+using IBatisNet.DataAccess;
+using IBatisNet.DataAccess.Configuration;
+using log4net;
+using log4net.Config;
+using NUnit.Framework;
+
+[assembly : DOMConfigurator(Watch=true)]
+
+namespace NPetshop.Test.Persistence
+{
+ /// <summary>
+ /// Description résumée de BaseTest.
+ /// </summary>
+ [TestFixture]
+ public abstract class BaseTest
+ {
+ protected DaoManager daoManager = null;
+ protected readonly ILog _logger = LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod().DeclaringType );
+
+ [SetUp]
+ public void SetUp()
+ {
+ DomDaoManagerBuilder builder = new DomDaoManagerBuilder();
+ builder.Configure(@"..\..\..\NPetshop.Persistence\dao.config");
+
+ daoManager = DaoManager.GetInstance("SqlMapDao");
+ }
+
+ }
+}
Added: ibatis/trunk/cs/npetshop2/NPetshop.Test/Persistence/DaoTest.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Test/Persistence/DaoTest.cs?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Test/Persistence/DaoTest.cs (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Test/Persistence/DaoTest.cs Sun Jun 19 07:45:17 2005
@@ -0,0 +1,25 @@
+using System;
+using NPetshop.Persistence.Interfaces.Accounts;
+using NUnit.Framework;
+
+
+namespace NPetshop.Test.Persistence
+{
+ /// <summary>
+ /// Description résumée de DaoTest.
+ /// </summary>
+ public class DaoTest : BaseTest
+ {
+
+ [Test]
+ public void TestGetDao()
+ {
+ Type type = typeof(IAccountDao);
+
+ IAccountDao accountDao = (IAccountDao)daoManager[typeof(IAccountDao)];
+
+ Assert.IsNotNull(accountDao);
+ Assert.IsTrue(type.IsInstanceOfType(accountDao));
+ }
+ }
+}
Added: ibatis/trunk/cs/npetshop2/NPetshop.Test/Presentation/ControllerTest.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Test/Presentation/ControllerTest.cs?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Test/Presentation/ControllerTest.cs (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Test/Presentation/ControllerTest.cs Sun Jun 19 07:45:17 2005
@@ -0,0 +1,80 @@
+using System;
+using NUnit.Framework;
+using NPetshop.Presentation;
+using NPetshop.Service;
+
+namespace NPetshop.Test.Presentation
+{
+ /// <summary>
+ /// Summary description for ControllerTest.
+ /// </summary>
+ [TestFixture]
+ public class ControllerTest
+ {
+ private NPetshopContainer _container;
+ private CatalogController _catalogController = null;
+ private NPetshopState _state = null;
+
+ #region SetUp & TearDown
+
+ /// <summary>
+ /// SetUp
+ /// </summary>
+ [SetUp]
+ public void SetUp()
+ {
+ _container = null;
+ _catalogController = null;
+ _state = null;
+
+ _container = new NPetshopContainer(true);
+
+ ServiceConfig config = ServiceConfig.GetInstance(true);
+
+ _catalogController = _container[typeof(CatalogController)] as CatalogController;
+ _state = _catalogController.State as NPetshopState;
+ }
+
+
+
+ /// <summary>
+ /// TearDown
+ /// </summary>
+ [TearDown]
+ public void Dispose()
+ {
+ _container.Dispose();
+ }
+
+ #endregion
+
+ #region Test Controller
+
+ /// <summary>
+ /// Test Container
+ /// </summary>
+ [Test]
+ public void TestContainer()
+ {
+ object controller = _container.Resolve("BillingController");
+ Assert.IsTrue(controller.GetType()==typeof(BillingController));
+ }
+
+ /// <summary>
+ /// Test catalog browsing
+ /// </summary>
+ [Test]
+ public void TestCatalogController()
+ {
+ _state.CurrentView = "no-case";
+ _state.Command = "showCategory";
+ _catalogController.ShowProductsByCategory("FISH");
+
+ Assert.IsTrue(_state.PreviousView=="no-case");
+ Assert.IsTrue(_state.CurrentView=="Category");
+ Assert.IsTrue(_state.CurrentList.Count==4);
+ }
+
+ #endregion
+ }
+}
Added: ibatis/trunk/cs/npetshop2/NPetshop.Test/Web/WebFormTest.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Test/Web/WebFormTest.cs?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Test/Web/WebFormTest.cs (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Test/Web/WebFormTest.cs Sun Jun 19 07:45:17 2005
@@ -0,0 +1,35 @@
+using NUnit.Extensions.Asp;
+using NUnit.Extensions.Asp.AspTester;
+using NUnit.Framework;
+
+namespace NPetshop.Test.Web
+{
+ /// <summary>
+ /// Description résumée de WebFormTest.
+ /// </summary>
+ [TestFixture]
+ public class WebFormTest : WebFormTestCase
+ {
+ [Test]
+ public void TestGotToCatalog()
+ {
+ // First, instantiate "Tester" objects:
+ UserControlTester ucStartUp = new UserControlTester("StartUp", CurrentWebForm);
+ UserControlTester ucSideBar = new UserControlTester("SideBar", ucStartUp);
+ LinkButtonTester linkbuttonFish = new LinkButtonTester("LinkbuttonFish", ucSideBar);
+
+ UserControlTester ucCategory= new UserControlTester("Category", CurrentWebForm);
+ LabelTester labelCategory = new LabelTester("LabelCategory",ucCategory);
+
+ // Second, visit the page being tested:
+ Browser.GetPage("http://localhost/NPetshop.Web/Views/default.aspx");
+ string homePage = this.Browser.CurrentUrl.AbsoluteUri.ToString();
+ linkbuttonFish.Click();
+
+ // First, test
+ string catalogPage = this.Browser.CurrentUrl.AbsoluteUri.ToString();
+ Assert(catalogPage, homePage != catalogPage);
+ AssertEquals("Fish", labelCategory.Text);
+ }
+ }
+}
Added: ibatis/trunk/cs/npetshop2/NPetshop.Test/readme.txt
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Test/readme.txt?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Test/readme.txt (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Test/readme.txt Sun Jun 19 07:45:17 2005
@@ -0,0 +1,2 @@
+
+- In order to run the test, you must puts NunitAsp.dll in the External-bin directory
\ No newline at end of file
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/@css/styles.css
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/%40css/styles.css?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Web/@css/styles.css (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Web/@css/styles.css Sun Jun 19 07:45:17 2005
@@ -0,0 +1,211 @@
+b, #categoryMenu a, #splashMenu a, .gridHead td, .label, .title
+{
+ color: #023030;
+ font-weight: bold;
+}
+
+body
+{
+ background-color: #ffffff;
+ color: #000000;
+ margin: 0px;
+}
+
+.pageHeader
+{
+ font-family: Verdana;
+ color: #003300;
+ font-size: 16pt;
+}
+
+.header
+{
+ font-family: Verdana, Arial;
+ color: #003300;
+ font-size: 9pt;
+ font-weight: bold;
+}
+
+.fieldHeader
+{
+ font-family: Verdana, Arial;
+ color: #003300;
+ font-size: 9pt;
+ font-weight: bold;
+}
+
+.errText
+{
+ font-family: Verdana, Arial;
+ color: #990000;
+ font-size: 9pt;
+}
+
+.text
+{
+ font-family: Verdana, Arial;
+ color: #000000;
+ font-size: 9pt;
+}
+A.text
+{
+ font-family: Verdana, Arial;
+ color: #000000;
+ font-size: 9pt;
+ text-decoration: none;
+}
+A.text:hover
+{
+ color: #003399;
+ text-decoration: underline;
+}
+
+.tableHeader
+{
+ font-weight: bold;
+ font-size: 10pt;
+ color: #003300;
+ font-style: italic;
+ font-family: Arial;
+}
+
+.menuOrange
+{
+ font-weight: bold;
+ font-size: 8pt;
+ color: #fe9901;
+ font-family: Arial;
+ text-decoration: none;
+}
+A.menuOrange
+{
+ font-weight: bold;
+ font-size: 8pt;
+ color: #fe9901;
+ font-family: Arial;
+ text-decoration: none;
+}
+A.webServiceTestLabel
+{
+ font-weight: bold;
+ font-size: 12pt;
+ color: #fe9901;
+ font-family: Arial;
+ text-decoration: none;
+}
+A.webServiceTestLabel:hover
+{
+ text-decoration: underline;
+}
+A.menuOrange:hover
+{
+ text-decoration: underline;
+}
+
+.menuBlack
+{
+ font-weight: bold;
+ font-size: 9pt;
+ color: #333333;
+ font-family: Arial;
+ text-decoration: none;
+}
+A.menuBlack
+{
+ font-weight: bold;
+ font-size: 9pt;
+ color: #333333;
+ font-family: Arial;
+ text-decoration: none;
+}
+A.menuBlack:hover
+{
+ text-decoration: underline;
+}
+
+A.catLink
+{
+ font-family: Arial;
+ font-size: 14pt;
+ color: #003300;
+ font-style: italic;
+ text-decoration: none;
+}
+A.catLink:hover
+{
+ text-decoration: underline;
+}
+.gridHead td
+{
+ border-bottom: solid 2px black;
+}
+
+.gridItem td, .gridFoot td
+{
+ border-bottom: 1px solid black;
+ height: 25px;
+}
+
+.gridHead td, .gridItem td, .gridFoot td
+{
+ padding-left: 10px;
+ padding-right: 10px;
+}
+
+.gridFoot
+{
+ background: gainsboro;
+}
+
+.gridNav
+{
+ padding-top: 10px;
+}
+
+.label
+{
+ padding-right: 5px;
+ text-align: right;
+}
+
+.num
+{
+ text-align: right;
+}
+
+.numFooter
+{
+ background: gainsboro;
+ text-align: right;
+}
+
+.textBox{
+ background-color: transparent;
+ padding: 3px;
+ line-height: normal !important;
+ border-style: none;
+ border-bottom: 1px solid #8E959E;
+ color: #023030
+}
+
+.textBox-on {
+ background-color: transparent;
+ padding: 3px;
+ line-height: normal !important;
+ border-style: none;
+ border-bottom: 1px solid #f30;
+ color: #333
+}
+.select {
+ background-color: #EDF7FF;
+ border: 1px inset;
+ font-family: tahoma,arial,geneva,verdana,lucida,helvetica,sans-serif;
+ font-size: 12px;
+ font-weight: normal;
+ padding: 2px;
+ color: #023030
+}
+.btnImage {cursor: pointer; cursor: hand;margin:1px 2px}
+
+
+
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/bird1.jpg
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/%40images/Pets/bird1.jpg?rev=191346&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/bird1.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/bird2.jpg
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/%40images/Pets/bird2.jpg?rev=191346&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/bird2.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/cat1.jpg
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/%40images/Pets/cat1.jpg?rev=191346&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/cat1.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/cat2.jpg
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/%40images/Pets/cat2.jpg?rev=191346&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/cat2.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/dog1.jpg
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/%40images/Pets/dog1.jpg?rev=191346&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/dog1.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/dog2.jpg
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/%40images/Pets/dog2.jpg?rev=191346&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/dog2.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/dog3.jpg
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/%40images/Pets/dog3.jpg?rev=191346&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/dog3.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/dog4.jpg
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/%40images/Pets/dog4.jpg?rev=191346&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/dog4.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/dog5.jpg
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/%40images/Pets/dog5.jpg?rev=191346&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/dog5.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/dog6.jpg
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/%40images/Pets/dog6.jpg?rev=191346&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/dog6.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/fish1.jpg
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/%40images/Pets/fish1.jpg?rev=191346&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/fish1.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/fish2.jpg
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/%40images/Pets/fish2.jpg?rev=191346&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/fish2.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/fish3.jpg
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/%40images/Pets/fish3.jpg?rev=191346&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/fish3.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/fish4.jpg
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/%40images/Pets/fish4.jpg?rev=191346&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/fish4.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/reptile1.jpg
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/%40images/Pets/reptile1.jpg?rev=191346&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/reptile1.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/reptile2.jpg
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/%40images/Pets/reptile2.jpg?rev=191346&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/Pets/reptile2.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/cart.gif
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/%40images/cart.gif?rev=191346&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/cart.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/iconCritical.gif
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/%40images/iconCritical.gif?rev=191346&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/iconCritical.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/space.gif
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/%40images/space.gif?rev=191346&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/space.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/splash.jpg
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/%40images/splash.jpg?rev=191346&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/splash.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/title.gif
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/%40images/title.gif?rev=191346&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/title.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/top_stripe1.gif
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/%40images/top_stripe1.gif?rev=191346&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/top_stripe1.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/top_stripe2.gif
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/%40images/top_stripe2.gif?rev=191346&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/top_stripe2.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/top_stripe3.gif
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/%40images/top_stripe3.gif?rev=191346&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/cs/npetshop2/NPetshop.Web/@images/top_stripe3.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/AssemblyInfo.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/AssemblyInfo.cs?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Web/AssemblyInfo.cs (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Web/AssemblyInfo.cs Sun Jun 19 07:45:17 2005
@@ -0,0 +1,62 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+//
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+//
+[assembly: AssemblyTitle("NPetShop")]
+[assembly: AssemblyDescription("Fully functional web application based on iBATIS.NET")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("Gilles Bayon")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion("1.0.0.*")]
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing.
+//
+// Notes:
+// (*) If no key is specified, the assembly is not signed.
+// (*) KeyName refers to a key that has been installed in the Crypto Service
+// Provider (CSP) on your machine. KeyFile refers to a file which contains
+// a key.
+// (*) If the KeyFile and the KeyName values are both specified, the
+// following processing occurs:
+// (1) If the KeyName can be found in the CSP, that key is used.
+// (2) If the KeyName does not exist and the KeyFile does exist, the key
+// in the KeyFile is installed into the CSP and used.
+// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
+// When specifying the KeyFile, the location of the KeyFile should be
+// relative to the "project output directory". The location of the project output
+// directory is dependent on whether you are working with a local or web project.
+// For local projects, the project output directory is defined as
+// <Project Directory>\obj\<Configuration>. For example, if your KeyFile is
+// located in the project directory, you would specify the AssemblyKeyFile
+// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
+// For web projects, the project output directory is defined as
+// %HOMEPATH%\VSWebCache\<Machine Name>\<Project Directory>\obj\<Configuration>.
+// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+// documentation for more information on this.
+//
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("")]
+[assembly: AssemblyKeyName("")]
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/ChangeLog.txt
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/ChangeLog.txt?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Web/ChangeLog.txt (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Web/ChangeLog.txt Sun Jun 19 07:45:17 2005
@@ -0,0 +1,5 @@
+
+- Full MVC with Castle.MVC (see web.config to see web flow)
+- IOC integration with Castle.Winstor (inject service, controller, ...) but Dao is always by iBATIS
+( an next version will also inject the Dao in Service)
+- Addes unit test for Dao, Presentation, Web (vias NunitAsp), Service layers
\ No newline at end of file
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/Controls/ExtendedRepeater.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/Controls/ExtendedRepeater.cs?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Web/Controls/ExtendedRepeater.cs (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Web/Controls/ExtendedRepeater.cs Sun Jun 19 07:45:17 2005
@@ -0,0 +1,40 @@
+using System;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace NPetshop.Web.Controls
+{
+ /// <summary>
+ /// Summary description for ExtendedRepeater.
+ /// </summary>
+ public class ExtendedRepeater: Repeater
+ {
+
+ private ITemplate _noDataTemplate = null;
+
+ public ITemplate NoDataTemplate
+ {
+ get
+ {
+ return _noDataTemplate;
+ }
+ set
+ {
+ _noDataTemplate = value;
+ }
+ }
+
+
+ protected override void OnPreRender(System.EventArgs e)
+ {
+ base.OnDataBinding (e);
+
+ if(this.Items.Count == 0)
+ {
+ NoDataTemplate.InstantiateIn(this);
+ }
+
+ }
+ }
+}
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/Default.aspx
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/Default.aspx?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Web/Default.aspx (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Web/Default.aspx Sun Jun 19 07:45:17 2005
@@ -0,0 +1,27 @@
+<%@ Register TagPrefix="uc1" TagName="Header" Src="UserControls/Header.ascx" %>
+<%@ Register TagPrefix="uc1" TagName="Footer" Src="UserControls/Footer.ascx" %>
+<%@ Register TagPrefix="cc1" Namespace="NPetshop.Presentation.Controls" Assembly="NPetshop.Presentation" %>
+<%@ Page language="c#" Codebehind="Default.aspx.cs" AutoEventWireup="false" Inherits="NPetshop.Web.Default" %>
+<%@ Register TagPrefix="uc1" TagName="SideBar" Src="UserControls/SideBar.ascx" %>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
+<HTML>
+ <HEAD>
+ <title>NPetShop</title>
+ <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
+ <meta name="CODE_LANGUAGE" Content="C#">
+ <meta name="vs_defaultClientScript" content="JavaScript">
+ <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
+ <LINK href="@css/Styles.css" type="text/css" rel="stylesheet">
+ </HEAD>
+ <body MS_POSITIONING="FlowLayout">
+ <form id="Form1" method="post" runat="server">
+ <uc1:Header id="Header" runat="server"></uc1:Header>
+ <div style="HEIGHT:500px">
+ <asp:PlaceHolder ID="placeholder" Runat="server"></asp:PlaceHolder>
+ <asp:ValidationSummary id="ValidationSummary1" runat="server" EnableViewState="False"></asp:ValidationSummary>
+ </div>
+ <asp:Label id="LabelStatus" runat="server" EnableViewState="False"></asp:Label>
+ <uc1:Footer id="Footer" runat="server"></uc1:Footer>
+ </form>
+ </body>
+</HTML>
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/Default.aspx.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/Default.aspx.cs?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Web/Default.aspx.cs (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Web/Default.aspx.cs Sun Jun 19 07:45:17 2005
@@ -0,0 +1,168 @@
+using System;
+using System.Collections;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Web;
+using System.Web.SessionState;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using System.Web.UI.HtmlControls;
+
+using NPetshop.Presentation;
+using NPetshop.Presentation.UserActions;
+
+using NUserControls = NPetshop.Presentation;
+
+
+namespace NPetshop.Web
+{
+ /// <summary>
+ /// Act as a router for incoming request
+ /// </summary>
+ public class Default : System.Web.UI.Page, IController
+ {
+ protected System.Web.UI.WebControls.PlaceHolder placeholder;
+ protected string currentView = string.Empty;
+ protected System.Web.UI.WebControls.Label LabelStatus;
+ protected System.Web.UI.WebControls.ValidationSummary ValidationSummary1;
+ protected string nextView = string.Empty;
+
+ #region IController
+ public string CurrentView
+ {
+ get
+ {
+ return this.currentView;
+ }
+ set
+ {
+ this.currentView=value;
+ }
+ }
+
+ public string NextView
+ {
+ get
+ {
+ return this.nextView;
+ }
+ set
+ {
+ this.nextView=value;
+ }
+ }
+
+ #endregion
+
+ private void Page_Load(object sender, System.EventArgs e)
+ {
+ if ( ViewState["CurrentView"]!=null )
+ {
+ currentView = (string)ViewState["CurrentView"];
+ Context.Items.Add("currentView",currentView);
+ nextView = (string)ViewState["NextView"];
+ Context.Items.Add("nextView",nextView);
+ }
+ else
+ {
+ // Go to Home)
+ currentView = WebViews.STARTUP;
+ nextView=null;
+ }
+
+ if (Request.QueryString["action"] != null)
+ {
+ currentView = Request.QueryString["action"];
+ nextView=null;
+ }
+
+ // Make the right control visible
+ NUserControls.UserControl userControl = (NUserControls.UserControl) LoadControl("UserControls/"+currentView+".ascx");
+ userControl.ID = "ID_" + currentView;
+//
+// if (currentView == "Error")
+// {
+// LabelStatus.Controls.Add(userControl);
+// }
+// else
+// {
+ placeholder.Controls.Add(userControl);
+// }
+
+ userControl.CurrentController = this;
+ }
+
+ protected override void OnError(EventArgs e)
+ {
+ System.Exception oops = Server.GetLastError();
+
+ Context.Items.Add("stackTrace",Server.GetLastError().StackTrace);
+ Context.Items.Add("messageError",Server.GetLastError().Message);
+ if (Server.GetLastError().InnerException!=null)
+ {
+ Context.Items.Add("innerMessageError",Server.GetLastError().InnerException.Message);
+ }
+ else
+ {
+ Context.Items.Add("innerMessageError", string.Empty);
+ }
+ Context.Items.Add("sourceError",Server.GetLastError().Source);
+ Context.Items.Add("errorView",this.currentView.ToString());
+ Server.ClearError();
+ Server.Transfer("default.aspx?action=Error");
+ }
+
+ protected override void OnPreRender(System.EventArgs e)
+ {
+ if ( nextView==null )
+ {
+ return;
+ }
+ if ( currentView!=nextView )
+ {
+ // Show the next view
+ NUserControls.UserControl nextControl = (NUserControls.UserControl) LoadControl("UserControls/"+nextView+".ascx");
+ nextControl.ID = "ID_" + nextView;
+ placeholder.Controls.Add(nextControl);
+ nextControl.CurrentController = this;
+ nextControl.DataBind();
+
+ // Delete last view
+ NUserControls.UserControl lastControl = (NUserControls.UserControl) placeholder.FindControl("ID_"+currentView);
+ placeholder.Controls.Remove(lastControl);
+ currentView = nextView;
+ }
+ else
+ {
+ Control currentControl = placeholder.FindControl("ID_"+currentView);
+ currentControl.DataBind();
+ }
+ ViewState["CurrentView"]= currentView;
+ ViewState["NextView"] = nextView;
+ }
+
+
+
+ #region Web Form Designer generated code
+ override protected void OnInit(EventArgs e)
+ {
+ //
+ // CODEGEN: This call is required by the ASP.NET Web Form Designer.
+ //
+ InitializeComponent();
+ base.OnInit(e);
+ }
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.Load += new System.EventHandler(this.Page_Load);
+
+ }
+ #endregion
+ }
+}
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/Default.aspx.resx
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/Default.aspx.resx?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Web/Default.aspx.resx (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Web/Default.aspx.resx Sun Jun 19 07:45:17 2005
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 1.3
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">1.3</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1">this is my long string</data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ [base64 mime encoded serialized .NET Framework object]
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ [base64 mime encoded string representing a byte array form of the .NET Framework object]
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used forserialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>1.3</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <data name="$this.TrayAutoArrange" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </data>
+ <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>Private</value>
+ </data>
+ <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>False</value>
+ </data>
+</root>
\ No newline at end of file
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/Global.asax
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/Global.asax?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Web/Global.asax (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Web/Global.asax Sun Jun 19 07:45:17 2005
@@ -0,0 +1 @@
+<%@ Application Codebehind="Global.asax.cs" Inherits="NPetshop.Web.Global" %>
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/Global.asax.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/Global.asax.cs?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Web/Global.asax.cs (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Web/Global.asax.cs Sun Jun 19 07:45:17 2005
@@ -0,0 +1,94 @@
+using System;
+using System.Collections;
+using System.ComponentModel;
+using System.Web;
+using System.Web.SessionState;
+
+using Castle.Windsor;
+
+using NPetshop.Presentation;
+
+namespace NPetshop.Web
+{
+ /// <summary>
+ /// Summary description for Global.
+ /// </summary>
+ public class Global : System.Web.HttpApplication, IContainerAccessor
+ {
+ private static WindsorContainer _container;
+
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ #region IContainerAccessor Members
+
+ public IWindsorContainer Container
+ {
+ get
+ {
+ return _container;
+ }
+ }
+
+ #endregion
+
+ public Global()
+ {
+ InitializeComponent();
+ }
+
+ protected void Application_Start(Object sender, EventArgs e)
+ {
+ _container = new NPetshopContainer(false);
+ }
+
+ protected void Session_Start(Object sender, EventArgs e)
+ {
+
+ }
+
+ protected void Application_BeginRequest(Object sender, EventArgs e)
+ {
+ }
+
+ protected void Application_EndRequest(Object sender, EventArgs e)
+ {
+
+ }
+
+ protected void Application_AuthenticateRequest(Object sender, EventArgs e)
+ {
+
+ }
+
+ protected void Application_Error(Object sender, EventArgs e)
+ {
+
+ }
+
+ protected void Session_End(Object sender, EventArgs e)
+ {
+
+ }
+
+ protected void Application_End(Object sender, EventArgs e)
+ {
+ _container.Dispose();
+ }
+
+ #region Web Form Designer generated code
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ }
+ #endregion
+
+ }
+}
+
Added: ibatis/trunk/cs/npetshop2/NPetshop.Web/Global.asax.resx
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/npetshop2/NPetshop.Web/Global.asax.resx?rev=191346&view=auto
==============================================================================
--- ibatis/trunk/cs/npetshop2/NPetshop.Web/Global.asax.resx (added)
+++ ibatis/trunk/cs/npetshop2/NPetshop.Web/Global.asax.resx Sun Jun 19 07:45:17 2005
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<root>
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="ResMimeType">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="Version">
+ <value>1.0.0.0</value>
+ </resheader>
+ <resheader name="Reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="Writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>