From: <all...@us...> - 2010-01-13 21:45:32
|
Revision: 7 http://cronoscontrol.svn.sourceforge.net/cronoscontrol/?rev=7&view=rev Author: allancascante Date: 2010-01-13 21:45:19 +0000 (Wed, 13 Jan 2010) Log Message: ----------- Ticket #1: Added MVC project for presentation, added a demo view to show the interaction with all the pieces. Added business methods to the business classes to list entities, the implementation of each method is missing only Project list was added to support the demo page. Modified Paths: -------------- source/trunk/CronosControl/CronosControl.sln source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Business.cs source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Calendars.cs source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Clients.cs source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Companies.cs source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/CostCenters.cs source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Documents.cs source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/IBusiness.cs source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Projects.cs source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Roles.cs source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Tasks.cs source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/TimeCategories.cs source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/TimeSheets.cs source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Users.cs source/trunk/CronosControl/CronosControlBusinessClassLibrary/CronosControlBusinessClassLibrary.csproj Added Paths: ----------- source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Util/ErrorHandling/ExceptionBusinessError.cs source/trunk/CronosControl/CronosControlWeb/ source/trunk/CronosControl/CronosControlWeb/App_Data/ source/trunk/CronosControl/CronosControlWeb/App_Data/CronosControl.mdf source/trunk/CronosControl/CronosControlWeb/App_Data/CronosControl_log.ldf source/trunk/CronosControl/CronosControlWeb/Content/ source/trunk/CronosControl/CronosControlWeb/Content/Site.css source/trunk/CronosControl/CronosControlWeb/Controllers/ source/trunk/CronosControl/CronosControlWeb/Controllers/AccountController.cs source/trunk/CronosControl/CronosControlWeb/Controllers/HomeController.cs source/trunk/CronosControl/CronosControlWeb/Controllers/ProjectsController.cs source/trunk/CronosControl/CronosControlWeb/CronosControlWeb.csproj source/trunk/CronosControl/CronosControlWeb/Default.aspx source/trunk/CronosControl/CronosControlWeb/Default.aspx.cs source/trunk/CronosControl/CronosControlWeb/Global.asax source/trunk/CronosControl/CronosControlWeb/Global.asax.cs source/trunk/CronosControl/CronosControlWeb/Properties/ source/trunk/CronosControl/CronosControlWeb/Properties/AssemblyInfo.cs source/trunk/CronosControl/CronosControlWeb/Scripts/ source/trunk/CronosControl/CronosControlWeb/Scripts/MicrosoftAjax.debug.js source/trunk/CronosControl/CronosControlWeb/Scripts/MicrosoftAjax.js source/trunk/CronosControl/CronosControlWeb/Scripts/MicrosoftMvcAjax.debug.js source/trunk/CronosControl/CronosControlWeb/Scripts/MicrosoftMvcAjax.js source/trunk/CronosControl/CronosControlWeb/Scripts/jquery-1.3.2-vsdoc.js source/trunk/CronosControl/CronosControlWeb/Scripts/jquery-1.3.2.js source/trunk/CronosControl/CronosControlWeb/Scripts/jquery-1.3.2.min-vsdoc.js source/trunk/CronosControl/CronosControlWeb/Scripts/jquery-1.3.2.min.js source/trunk/CronosControl/CronosControlWeb/Views/ source/trunk/CronosControl/CronosControlWeb/Views/Account/ source/trunk/CronosControl/CronosControlWeb/Views/Account/ChangePassword.aspx source/trunk/CronosControl/CronosControlWeb/Views/Account/ChangePasswordSuccess.aspx source/trunk/CronosControl/CronosControlWeb/Views/Account/LogOn.aspx source/trunk/CronosControl/CronosControlWeb/Views/Account/Register.aspx source/trunk/CronosControl/CronosControlWeb/Views/Home/ source/trunk/CronosControl/CronosControlWeb/Views/Home/About.aspx source/trunk/CronosControl/CronosControlWeb/Views/Home/Index.aspx source/trunk/CronosControl/CronosControlWeb/Views/Projects/ source/trunk/CronosControl/CronosControlWeb/Views/Projects/ProjectsList.aspx source/trunk/CronosControl/CronosControlWeb/Views/Shared/ source/trunk/CronosControl/CronosControlWeb/Views/Shared/Error.aspx source/trunk/CronosControl/CronosControlWeb/Views/Shared/LogOnUserControl.ascx source/trunk/CronosControl/CronosControlWeb/Views/Shared/Site.Master source/trunk/CronosControl/CronosControlWeb/Views/Web.config source/trunk/CronosControl/CronosControlWeb/Web.config source/trunk/CronosControl/CronosControlWeb.Tests/ source/trunk/CronosControl/CronosControlWeb.Tests/App.config source/trunk/CronosControl/CronosControlWeb.Tests/AuthoringTests.txt source/trunk/CronosControl/CronosControlWeb.Tests/Controllers/ source/trunk/CronosControl/CronosControlWeb.Tests/Controllers/AccountControllerTest.cs source/trunk/CronosControl/CronosControlWeb.Tests/Controllers/HomeControllerTest.cs source/trunk/CronosControl/CronosControlWeb.Tests/CronosControlWeb.Tests.csproj source/trunk/CronosControl/CronosControlWeb.Tests/Properties/ source/trunk/CronosControl/CronosControlWeb.Tests/Properties/AssemblyInfo.cs Modified: source/trunk/CronosControl/CronosControl.sln =================================================================== --- source/trunk/CronosControl/CronosControl.sln 2009-11-20 23:22:25 UTC (rev 6) +++ source/trunk/CronosControl/CronosControl.sln 2010-01-13 21:45:19 UTC (rev 7) @@ -13,12 +13,11 @@ LocalTestRun.testrunconfig = LocalTestRun.testrunconfig EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CronosControl", "CronosControl\CronosControl.csproj", "{93AD76A1-1973-434A-8677-8B19F02E30D8}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CronosControlWeb", "CronosControlWeb\CronosControlWeb.csproj", "{F0208315-D73D-4A51-B247-FFFBF19BD9AC}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CronosControlWeb.Tests", "CronosControlWeb.Tests\CronosControlWeb.Tests.csproj", "{9CC0D375-D6BD-418D-87EB-079A4114D8FB}" +EndProject Global - GlobalSection(TestCaseManagementSettings) = postSolution - CategoryFile = CronosControl.vsmdi - EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|.NET = Debug|.NET Debug|Any CPU = Debug|Any CPU @@ -48,16 +47,26 @@ {2D8FF602-961B-470C-AECF-817AFF0C4E9C}.Release|Any CPU.Build.0 = Release|Any CPU {2D8FF602-961B-470C-AECF-817AFF0C4E9C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {2D8FF602-961B-470C-AECF-817AFF0C4E9C}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {93AD76A1-1973-434A-8677-8B19F02E30D8}.Debug|.NET.ActiveCfg = Debug|Any CPU - {93AD76A1-1973-434A-8677-8B19F02E30D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {93AD76A1-1973-434A-8677-8B19F02E30D8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {93AD76A1-1973-434A-8677-8B19F02E30D8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {93AD76A1-1973-434A-8677-8B19F02E30D8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {93AD76A1-1973-434A-8677-8B19F02E30D8}.Release|.NET.ActiveCfg = Release|Any CPU - {93AD76A1-1973-434A-8677-8B19F02E30D8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {93AD76A1-1973-434A-8677-8B19F02E30D8}.Release|Any CPU.Build.0 = Release|Any CPU - {93AD76A1-1973-434A-8677-8B19F02E30D8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {93AD76A1-1973-434A-8677-8B19F02E30D8}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {F0208315-D73D-4A51-B247-FFFBF19BD9AC}.Debug|.NET.ActiveCfg = Debug|Any CPU + {F0208315-D73D-4A51-B247-FFFBF19BD9AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F0208315-D73D-4A51-B247-FFFBF19BD9AC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F0208315-D73D-4A51-B247-FFFBF19BD9AC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {F0208315-D73D-4A51-B247-FFFBF19BD9AC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {F0208315-D73D-4A51-B247-FFFBF19BD9AC}.Release|.NET.ActiveCfg = Release|Any CPU + {F0208315-D73D-4A51-B247-FFFBF19BD9AC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F0208315-D73D-4A51-B247-FFFBF19BD9AC}.Release|Any CPU.Build.0 = Release|Any CPU + {F0208315-D73D-4A51-B247-FFFBF19BD9AC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {F0208315-D73D-4A51-B247-FFFBF19BD9AC}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {9CC0D375-D6BD-418D-87EB-079A4114D8FB}.Debug|.NET.ActiveCfg = Debug|Any CPU + {9CC0D375-D6BD-418D-87EB-079A4114D8FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9CC0D375-D6BD-418D-87EB-079A4114D8FB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9CC0D375-D6BD-418D-87EB-079A4114D8FB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {9CC0D375-D6BD-418D-87EB-079A4114D8FB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {9CC0D375-D6BD-418D-87EB-079A4114D8FB}.Release|.NET.ActiveCfg = Release|Any CPU + {9CC0D375-D6BD-418D-87EB-079A4114D8FB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9CC0D375-D6BD-418D-87EB-079A4114D8FB}.Release|Any CPU.Build.0 = Release|Any CPU + {9CC0D375-D6BD-418D-87EB-079A4114D8FB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {9CC0D375-D6BD-418D-87EB-079A4114D8FB}.Release|Mixed Platforms.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Modified: source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Business.cs =================================================================== --- source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Business.cs 2009-11-20 23:22:25 UTC (rev 6) +++ source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Business.cs 2010-01-13 21:45:19 UTC (rev 7) @@ -9,7 +9,7 @@ namespace CronosControl.Business { - public class Business<T> : IBusiness<T> where T : IEntityWithKey + public abstract class Business<T> : IBusiness<T> where T : IEntityWithKey { private CronosControlEntities cronosControlEntities; @@ -78,6 +78,10 @@ } } + public abstract List<T> List(); + + public abstract List<T> List(int page, int elements); + #endregion } } Modified: source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Calendars.cs =================================================================== --- source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Calendars.cs 2009-11-20 23:22:25 UTC (rev 6) +++ source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Calendars.cs 2010-01-13 21:45:19 UTC (rev 7) @@ -12,6 +12,16 @@ /// </summary> public class Calendars : Business<Calendar>, ICalendars { + #region Business<Calendar> abstract methods + public override List<Calendar> List() + { + throw new NotImplementedException(); + } + public override List<Calendar> List(int page, int elements) + { + throw new NotImplementedException(); + } + #endregion } } Modified: source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Clients.cs =================================================================== --- source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Clients.cs 2009-11-20 23:22:25 UTC (rev 6) +++ source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Clients.cs 2010-01-13 21:45:19 UTC (rev 7) @@ -11,5 +11,16 @@ /// </summary> public class Clients : Business<Client>, IClients { + #region Business<Client> abstract methods + public override List<Client> List() + { + throw new NotImplementedException(); + } + + public override List<Client> List(int page, int elements) + { + throw new NotImplementedException(); + } + #endregion } } Modified: source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Companies.cs =================================================================== --- source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Companies.cs 2009-11-20 23:22:25 UTC (rev 6) +++ source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Companies.cs 2010-01-13 21:45:19 UTC (rev 7) @@ -11,5 +11,16 @@ /// </summary> public class Companies : Business<Company>, ICompanies { + #region Business<Company> abstract methods + public override List<Company> List() + { + throw new NotImplementedException(); + } + + public override List<Company> List(int page, int elements) + { + throw new NotImplementedException(); + } + #endregion } } Modified: source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/CostCenters.cs =================================================================== --- source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/CostCenters.cs 2009-11-20 23:22:25 UTC (rev 6) +++ source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/CostCenters.cs 2010-01-13 21:45:19 UTC (rev 7) @@ -11,5 +11,16 @@ /// </summary> public class CostCenters : Business<CostCenter>, ICostCenters { + #region Business<CostCenter> + public override List<CostCenter> List() + { + throw new NotImplementedException(); + } + + public override List<CostCenter> List(int page, int elements) + { + throw new NotImplementedException(); + } + #endregion } } Modified: source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Documents.cs =================================================================== --- source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Documents.cs 2009-11-20 23:22:25 UTC (rev 6) +++ source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Documents.cs 2010-01-13 21:45:19 UTC (rev 7) @@ -11,5 +11,16 @@ /// </summary> public class Documents : Business<Document>, IDocuments { + #region Business<Document> + public override List<Document> List() + { + throw new NotImplementedException(); + } + + public override List<Document> List(int page, int elements) + { + throw new NotImplementedException(); + } + #endregion } } Modified: source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/IBusiness.cs =================================================================== --- source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/IBusiness.cs 2009-11-20 23:22:25 UTC (rev 6) +++ source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/IBusiness.cs 2010-01-13 21:45:19 UTC (rev 7) @@ -18,10 +18,33 @@ /// <returns>an empty error list in case the entity was saved successfully, an error list with the errors encounter for the operation in other case</returns> List<IBusinessError> Save(T entity); + /// <summary> + /// Get an entity for the given entity, the provided entity only needs to provide the key value for the entity to get. + /// </summary> + /// <param name="entity">The entity with the key value set to get</param> + /// <returns>The entity found null otherwise</returns> T Get(T entity); + /// <summary> + /// Find an entity for the given entity set with the values to search for. + /// </summary> + /// <param name="entity">The entity to find</param> + /// <returns>True if found, false otherwise</returns> bool Find(T entity); + /// <summary> + /// Returns a list with all elements for the entity + /// </summary> + /// <returns>A list with all elements found for the entity</returns> + List<T> List(); + /// <summary> + /// Returns a list with the <paramref name="elements"/> for the requested page. + /// </summary> + /// <param name="page">Page number</param> + /// <param name="elements">Elements by page</param> + /// <returns>List with the elements for the given page</returns> + List<T> List(int page, int elements); + } } Modified: source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Projects.cs =================================================================== --- source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Projects.cs 2009-11-20 23:22:25 UTC (rev 6) +++ source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Projects.cs 2010-01-13 21:45:19 UTC (rev 7) @@ -12,7 +12,19 @@ /// </summary> public class Projects : Business<Project>, IProjects { + CronosControlEntities cronosControlEntities; - + #region Bussiness Abstract Methods + public override List<Project> List() + { + cronosControlEntities = new CronosControlEntities(); + return cronosControlEntities.Project.ToList(); + } + + public override List<Project> List(int page, int elements) + { + throw new NotImplementedException(); + } + #endregion } } Modified: source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Roles.cs =================================================================== --- source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Roles.cs 2009-11-20 23:22:25 UTC (rev 6) +++ source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Roles.cs 2010-01-13 21:45:19 UTC (rev 7) @@ -11,5 +11,16 @@ /// </summary> public class Roles : Business<Role>, IRoles { + #region Business<Role> abstract methods + public override List<Role> List() + { + throw new NotImplementedException(); + } + + public override List<Role> List(int page, int elements) + { + throw new NotImplementedException(); + } + #endregion } } Modified: source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Tasks.cs =================================================================== --- source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Tasks.cs 2009-11-20 23:22:25 UTC (rev 6) +++ source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Tasks.cs 2010-01-13 21:45:19 UTC (rev 7) @@ -11,5 +11,16 @@ /// </summary> public class Tasks : Business<Task>, ITasks { + #region Business<Task> + public override List<Task> List() + { + throw new NotImplementedException(); + } + + public override List<Task> List(int page, int elements) + { + throw new NotImplementedException(); + } + #endregion } } Modified: source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/TimeCategories.cs =================================================================== --- source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/TimeCategories.cs 2009-11-20 23:22:25 UTC (rev 6) +++ source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/TimeCategories.cs 2010-01-13 21:45:19 UTC (rev 7) @@ -11,5 +11,16 @@ /// </summary> public class TimeCategories : Business<TimeCategory>, ITimeCategories { + #region Business<TimeCategory> abstract methods + public override List<TimeCategory> List() + { + throw new NotImplementedException(); + } + + public override List<TimeCategory> List(int page, int elements) + { + throw new NotImplementedException(); + } + #endregion } } Modified: source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/TimeSheets.cs =================================================================== --- source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/TimeSheets.cs 2009-11-20 23:22:25 UTC (rev 6) +++ source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/TimeSheets.cs 2010-01-13 21:45:19 UTC (rev 7) @@ -11,5 +11,16 @@ /// </summary> public class TimeSheets : Business<TimeSheet>, ITimeSheets { + #region Business<TimeSheet> abstract methods + public override List<TimeSheet> List() + { + throw new NotImplementedException(); + } + + public override List<TimeSheet> List(int page, int elements) + { + throw new NotImplementedException(); + } + #endregion } } Modified: source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Users.cs =================================================================== --- source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Users.cs 2009-11-20 23:22:25 UTC (rev 6) +++ source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Users.cs 2010-01-13 21:45:19 UTC (rev 7) @@ -24,5 +24,17 @@ } return base.Save(entity); } + + #region Business<User> abstract methods + public override List<User> List() + { + throw new NotImplementedException(); + } + + public override List<User> List(int page, int elements) + { + throw new NotImplementedException(); + } + #endregion } } Added: source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Util/ErrorHandling/ExceptionBusinessError.cs =================================================================== --- source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Util/ErrorHandling/ExceptionBusinessError.cs (rev 0) +++ source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Util/ErrorHandling/ExceptionBusinessError.cs 2010-01-13 21:45:19 UTC (rev 7) @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CronosControl.Business.Util.ErrorHandling +{ + class ExceptionBusinessError : Exception, IBusinessError + { + private Exception ex; + + public ExceptionBusinessError(Exception ex) + : base(ex.Message) + { + this.ex = ex; + } + } +} Modified: source/trunk/CronosControl/CronosControlBusinessClassLibrary/CronosControlBusinessClassLibrary.csproj =================================================================== --- source/trunk/CronosControl/CronosControlBusinessClassLibrary/CronosControlBusinessClassLibrary.csproj 2009-11-20 23:22:25 UTC (rev 6) +++ source/trunk/CronosControl/CronosControlBusinessClassLibrary/CronosControlBusinessClassLibrary.csproj 2010-01-13 21:45:19 UTC (rev 7) @@ -74,7 +74,7 @@ <Compile Include="Business\TimeCategories.cs" /> <Compile Include="Business\TimeSheets.cs" /> <Compile Include="Business\Users.cs" /> - <Compile Include="Business\Util\ErrorHandling\BusinessError.cs" /> + <Compile Include="Business\Util\ErrorHandling\ExceptionBusinessError.cs" /> <Compile Include="Business\Util\ErrorHandling\IBusinessError.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> Added: source/trunk/CronosControl/CronosControlWeb/App_Data/CronosControl.mdf =================================================================== (Binary files differ) Property changes on: source/trunk/CronosControl/CronosControlWeb/App_Data/CronosControl.mdf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: source/trunk/CronosControl/CronosControlWeb/App_Data/CronosControl_log.ldf =================================================================== (Binary files differ) Property changes on: source/trunk/CronosControl/CronosControlWeb/App_Data/CronosControl_log.ldf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: source/trunk/CronosControl/CronosControlWeb/Content/Site.css =================================================================== --- source/trunk/CronosControl/CronosControlWeb/Content/Site.css (rev 0) +++ source/trunk/CronosControl/CronosControlWeb/Content/Site.css 2010-01-13 21:45:19 UTC (rev 7) @@ -0,0 +1,317 @@ +/*---------------------------------------------------------- +The base color for this template is #5c87b2. If you'd like +to use a different color start by replacing all instances of +#5c87b2 with your new color. +----------------------------------------------------------*/ +body +{ + background-color: #5c87b2; + font-size: .75em; + font-family: Verdana, Helvetica, Sans-Serif; + margin: 0; + padding: 0; + color: #696969; +} + +a:link +{ + color: #034af3; + text-decoration: underline; +} +a:visited +{ + color: #505abc; +} +a:hover +{ + color: #1d60ff; + text-decoration: none; +} +a:active +{ + color: #12eb87; +} + +p, ul +{ + margin-bottom: 20px; + line-height: 1.6em; +} + +/* HEADINGS +----------------------------------------------------------*/ +h1, h2, h3, h4, h5, h6 +{ + font-size: 1.5em; + color: #000; + font-family: Arial, Helvetica, sans-serif; +} + +h1 +{ + font-size: 2em; + padding-bottom: 0; + margin-bottom: 0; +} +h2 +{ + padding: 0 0 10px 0; +} +h3 +{ + font-size: 1.2em; +} +h4 +{ + font-size: 1.1em; +} +h5, h6 +{ + font-size: 1em; +} + +/* this rule styles <h2> tags that are the +first child of the left and right table columns */ +.rightColumn > h1, .rightColumn > h2, .leftColumn > h1, .leftColumn > h2 +{ + margin-top: 0; +} + +/* PRIMARY LAYOUT ELEMENTS +----------------------------------------------------------*/ + +/* you can specify a greater or lesser percentage for the +page width. Or, you can specify an exact pixel width. */ +.page +{ + width: 90%; + margin-left: auto; + margin-right: auto; +} + +#header +{ + position: relative; + margin-bottom: 0px; + color: #000; + padding: 0; +} + +#header h1 +{ + font-weight: bold; + padding: 5px 0; + margin: 0; + color: #fff; + border: none; + line-height: 2em; + font-family: Arial, Helvetica, sans-serif; + font-size: 32px !important; +} + +#main +{ + padding: 30px 30px 15px 30px; + background-color: #fff; + margin-bottom: 30px; + _height: 1px; /* only IE6 applies CSS properties starting with an underscrore */ +} + +#footer +{ + color: #999; + padding: 10px 0; + text-align: center; + line-height: normal; + margin: 0; + font-size: .9em; +} + +/* TAB MENU +----------------------------------------------------------*/ +ul#menu +{ + border-bottom: 1px #5C87B2 solid; + padding: 0 0 2px; + position: relative; + margin: 0; + text-align: right; +} + +ul#menu li +{ + display: inline; + list-style: none; +} + +ul#menu li#greeting +{ + padding: 10px 20px; + font-weight: bold; + text-decoration: none; + line-height: 2.8em; + color: #fff; +} + +ul#menu li a +{ + padding: 10px 20px; + font-weight: bold; + text-decoration: none; + line-height: 2.8em; + background-color: #e8eef4; + color: #034af3; +} + +ul#menu li a:hover +{ + background-color: #fff; + text-decoration: none; +} + +ul#menu li a:active +{ + background-color: #a6e2a6; + text-decoration: none; +} + +ul#menu li.selected a +{ + background-color: #fff; + color: #000; +} + +/* FORM LAYOUT ELEMENTS +----------------------------------------------------------*/ + +fieldset +{ + margin: 1em 0; + padding: 1em; + border: 1px solid #CCC; +} + +fieldset p +{ + margin: 2px 12px 10px 10px; +} + +fieldset label +{ + display: block; +} + +fieldset label.inline +{ + display: inline; +} + +legend +{ + font-size: 1.1em; + font-weight: 600; + padding: 2px 4px 8px 4px; +} + +input[type="text"] +{ + width: 200px; + border: 1px solid #CCC; +} + +input[type="password"] +{ + width: 200px; + border: 1px solid #CCC; +} + +/* TABLE +----------------------------------------------------------*/ + +table +{ + border: solid 1px #e8eef4; + border-collapse: collapse; +} + +table td +{ + padding: 5px; + border: solid 1px #e8eef4; +} + +table th +{ + padding: 6px 5px; + text-align: left; + background-color: #e8eef4; + border: solid 1px #e8eef4; +} + +/* MISC +----------------------------------------------------------*/ +.clear +{ + clear: both; +} + +.error +{ + color:Red; +} + +#menucontainer +{ + margin-top:40px; +} + +div#title +{ + display:block; + float:left; + text-align:left; +} + +#logindisplay +{ + font-size:1.1em; + display:block; + text-align:right; + margin:10px; + color:White; +} + +#logindisplay a:link +{ + color: white; + text-decoration: underline; +} + +#logindisplay a:visited +{ + color: white; + text-decoration: underline; +} + +#logindisplay a:hover +{ + color: white; + text-decoration: none; +} + +.field-validation-error +{ + color: #ff0000; +} + +.input-validation-error +{ + border: 1px solid #ff0000; + background-color: #ffeeee; +} + +.validation-summary-errors +{ + font-weight: bold; + color: #ff0000; +} Added: source/trunk/CronosControl/CronosControlWeb/Controllers/AccountController.cs =================================================================== --- source/trunk/CronosControl/CronosControlWeb/Controllers/AccountController.cs (rev 0) +++ source/trunk/CronosControl/CronosControlWeb/Controllers/AccountController.cs 2010-01-13 21:45:19 UTC (rev 7) @@ -0,0 +1,351 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Security.Principal; +using System.Web; +using System.Web.Mvc; +using System.Web.Security; +using System.Web.UI; + +namespace CronosControlWeb.Controllers +{ + + [HandleError] + public class AccountController : Controller + { + + // This constructor is used by the MVC framework to instantiate the controller using + // the default forms authentication and membership providers. + + public AccountController() + : this(null, null) + { + } + + // This constructor is not used by the MVC framework but is instead provided for ease + // of unit testing this type. See the comments at the end of this file for more + // information. + public AccountController(IFormsAuthentication formsAuth, IMembershipService service) + { + FormsAuth = formsAuth ?? new FormsAuthenticationService(); + MembershipService = service ?? new AccountMembershipService(); + } + + public IFormsAuthentication FormsAuth + { + get; + private set; + } + + public IMembershipService MembershipService + { + get; + private set; + } + + public ActionResult LogOn() + { + + return View(); + } + + [AcceptVerbs(HttpVerbs.Post)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", + Justification = "Needs to take same parameter type as Controller.Redirect()")] + public ActionResult LogOn(string userName, string password, bool rememberMe, string returnUrl) + { + + if (!ValidateLogOn(userName, password)) + { + return View(); + } + + FormsAuth.SignIn(userName, rememberMe); + if (!String.IsNullOrEmpty(returnUrl)) + { + return Redirect(returnUrl); + } + else + { + return RedirectToAction("Index", "Home"); + } + } + + public ActionResult LogOff() + { + + FormsAuth.SignOut(); + + return RedirectToAction("Index", "Home"); + } + + public ActionResult Register() + { + + ViewData["PasswordLength"] = MembershipService.MinPasswordLength; + + return View(); + } + + [AcceptVerbs(HttpVerbs.Post)] + public ActionResult Register(string userName, string email, string password, string confirmPassword) + { + + ViewData["PasswordLength"] = MembershipService.MinPasswordLength; + + if (ValidateRegistration(userName, email, password, confirmPassword)) + { + // Attempt to register the user + MembershipCreateStatus createStatus = MembershipService.CreateUser(userName, password, email); + + if (createStatus == MembershipCreateStatus.Success) + { + FormsAuth.SignIn(userName, false /* createPersistentCookie */); + return RedirectToAction("Index", "Home"); + } + else + { + ModelState.AddModelError("_FORM", ErrorCodeToString(createStatus)); + } + } + + // If we got this far, something failed, redisplay form + return View(); + } + + [Authorize] + public ActionResult ChangePassword() + { + + ViewData["PasswordLength"] = MembershipService.MinPasswordLength; + + return View(); + } + + [Authorize] + [AcceptVerbs(HttpVerbs.Post)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", + Justification = "Exceptions result in password not being changed.")] + public ActionResult ChangePassword(string currentPassword, string newPassword, string confirmPassword) + { + + ViewData["PasswordLength"] = MembershipService.MinPasswordLength; + + if (!ValidateChangePassword(currentPassword, newPassword, confirmPassword)) + { + return View(); + } + + try + { + if (MembershipService.ChangePassword(User.Identity.Name, currentPassword, newPassword)) + { + return RedirectToAction("ChangePasswordSuccess"); + } + else + { + ModelState.AddModelError("_FORM", "The current password is incorrect or the new password is invalid."); + return View(); + } + } + catch + { + ModelState.AddModelError("_FORM", "The current password is incorrect or the new password is invalid."); + return View(); + } + } + + public ActionResult ChangePasswordSuccess() + { + + return View(); + } + + protected override void OnActionExecuting(ActionExecutingContext filterContext) + { + if (filterContext.HttpContext.User.Identity is WindowsIdentity) + { + throw new InvalidOperationException("Windows authentication is not supported."); + } + } + + #region Validation Methods + + private bool ValidateChangePassword(string currentPassword, string newPassword, string confirmPassword) + { + if (String.IsNullOrEmpty(currentPassword)) + { + ModelState.AddModelError("currentPassword", "You must specify a current password."); + } + if (newPassword == null || newPassword.Length < MembershipService.MinPasswordLength) + { + ModelState.AddModelError("newPassword", + String.Format(CultureInfo.CurrentCulture, + "You must specify a new password of {0} or more characters.", + MembershipService.MinPasswordLength)); + } + + if (!String.Equals(newPassword, confirmPassword, StringComparison.Ordinal)) + { + ModelState.AddModelError("_FORM", "The new password and confirmation password do not match."); + } + + return ModelState.IsValid; + } + + private bool ValidateLogOn(string userName, string password) + { + if (String.IsNullOrEmpty(userName)) + { + ModelState.AddModelError("username", "You must specify a username."); + } + if (String.IsNullOrEmpty(password)) + { + ModelState.AddModelError("password", "You must specify a password."); + } + if (!MembershipService.ValidateUser(userName, password)) + { + ModelState.AddModelError("_FORM", "The username or password provided is incorrect."); + } + + return ModelState.IsValid; + } + + private bool ValidateRegistration(string userName, string email, string password, string confirmPassword) + { + if (String.IsNullOrEmpty(userName)) + { + ModelState.AddModelError("username", "You must specify a username."); + } + if (String.IsNullOrEmpty(email)) + { + ModelState.AddModelError("email", "You must specify an email address."); + } + if (password == null || password.Length < MembershipService.MinPasswordLength) + { + ModelState.AddModelError("password", + String.Format(CultureInfo.CurrentCulture, + "You must specify a password of {0} or more characters.", + MembershipService.MinPasswordLength)); + } + if (!String.Equals(password, confirmPassword, StringComparison.Ordinal)) + { + ModelState.AddModelError("_FORM", "The new password and confirmation password do not match."); + } + return ModelState.IsValid; + } + + private static string ErrorCodeToString(MembershipCreateStatus createStatus) + { + // See http://msdn.microsoft.com/en-us/library/system.web.security.membershipcreatestatus.aspx for + // a full list of status codes. + switch (createStatus) + { + case MembershipCreateStatus.DuplicateUserName: + return "Username already exists. Please enter a different user name."; + + case MembershipCreateStatus.DuplicateEmail: + return "A username for that e-mail address already exists. Please enter a different e-mail address."; + + case MembershipCreateStatus.InvalidPassword: + return "The password provided is invalid. Please enter a valid password value."; + + case MembershipCreateStatus.InvalidEmail: + return "The e-mail address provided is invalid. Please check the value and try again."; + + case MembershipCreateStatus.InvalidAnswer: + return "The password retrieval answer provided is invalid. Please check the value and try again."; + + case MembershipCreateStatus.InvalidQuestion: + return "The password retrieval question provided is invalid. Please check the value and try again."; + + case MembershipCreateStatus.InvalidUserName: + return "The user name provided is invalid. Please check the value and try again."; + + case MembershipCreateStatus.ProviderError: + return "The authentication provider returned an error. Please verify your entry and try again. If the problem persists, please contact your system administrator."; + + case MembershipCreateStatus.UserRejected: + return "The user creation request has been canceled. Please verify your entry and try again. If the problem persists, please contact your system administrator."; + + default: + return "An unknown error occurred. Please verify your entry and try again. If the problem persists, please contact your system administrator."; + } + } + #endregion + } + + // The FormsAuthentication type is sealed and contains static members, so it is difficult to + // unit test code that calls its members. The interface and helper class below demonstrate + // how to create an abstract wrapper around such a type in order to make the AccountController + // code unit testable. + + public interface IFormsAuthentication + { + void SignIn(string userName, bool createPersistentCookie); + void SignOut(); + } + + public class FormsAuthenticationService : IFormsAuthentication + { + public void SignIn(string userName, bool createPersistentCookie) + { + FormsAuthentication.SetAuthCookie(userName, createPersistentCookie); + } + public void SignOut() + { + FormsAuthentication.SignOut(); + } + } + + public interface IMembershipService + { + int MinPasswordLength { get; } + + bool ValidateUser(string userName, string password); + MembershipCreateStatus CreateUser(string userName, string password, string email); + bool ChangePassword(string userName, string oldPassword, string newPassword); + } + + public class AccountMembershipService : IMembershipService + { + private MembershipProvider _provider; + + public AccountMembershipService() + : this(null) + { + } + + public AccountMembershipService(MembershipProvider provider) + { + _provider = provider ?? Membership.Provider; + } + + public int MinPasswordLength + { + get + { + return _provider.MinRequiredPasswordLength; + } + } + + public bool ValidateUser(string userName, string password) + { + return _provider.ValidateUser(userName, password); + } + + public MembershipCreateStatus CreateUser(string userName, string password, string email) + { + MembershipCreateStatus status; + _provider.CreateUser(userName, password, email, null, null, true, null, out status); + return status; + } + + public bool ChangePassword(string userName, string oldPassword, string newPassword) + { + MembershipUser currentUser = _provider.GetUser(userName, true /* userIsOnline */); + return currentUser.ChangePassword(oldPassword, newPassword); + } + } +} Added: source/trunk/CronosControl/CronosControlWeb/Controllers/HomeController.cs =================================================================== --- source/trunk/CronosControl/CronosControlWeb/Controllers/HomeController.cs (rev 0) +++ source/trunk/CronosControl/CronosControlWeb/Controllers/HomeController.cs 2010-01-13 21:45:19 UTC (rev 7) @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; + +namespace CronosControlWeb.Controllers +{ + [HandleError] + public class HomeController : Controller + { + public ActionResult Index() + { + ViewData["Message"] = "Welcome to ASP.NET MVC!"; + + return View(); + } + + public ActionResult About() + { + return View(); + } + } +} Added: source/trunk/CronosControl/CronosControlWeb/Controllers/ProjectsController.cs =================================================================== --- source/trunk/CronosControl/CronosControlWeb/Controllers/ProjectsController.cs (rev 0) +++ source/trunk/CronosControl/CronosControlWeb/Controllers/ProjectsController.cs 2010-01-13 21:45:19 UTC (rev 7) @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; +using System.Web.Mvc.Ajax; +using CronosControl.Model; +using CronosControl.Business; + +namespace CronosControlWeb.Controllers +{ + public class ProjectsController : Controller + { + + /// <summary> + /// This is the default index action for the controller, GET: /Projects/ + /// </summary> + /// <returns>The result of the action for the MVC</returns> + public ActionResult Index() + { + Projects projectsBusiness = new Projects(); + List<Project> projects = projectsBusiness.List(); + return View("ProjectsList", projects); + } + + } +} Added: source/trunk/CronosControl/CronosControlWeb/CronosControlWeb.csproj =================================================================== --- source/trunk/CronosControl/CronosControlWeb/CronosControlWeb.csproj (rev 0) +++ source/trunk/CronosControl/CronosControlWeb/CronosControlWeb.csproj 2010-01-13 21:45:19 UTC (rev 7) @@ -0,0 +1,144 @@ +<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.30729</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{F0208315-D73D-4A51-B247-FFFBF19BD9AC}</ProjectGuid> + <ProjectTypeGuids>{603c0e0b-db56-11dc-be95-000d561079b0};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>CronosControlWeb</RootNamespace> + <AssemblyName>CronosControlWeb</AssemblyName> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <MvcBuildViews>false</MvcBuildViews> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Core"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + </Reference> + <Reference Include="System.Data.DataSetExtensions"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + </Reference> + <Reference Include="System.Data.Entity"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + </Reference> + <Reference Include="System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> + <Reference Include="System.Xml.Linq"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + </Reference> + <Reference Include="System.Drawing" /> + <Reference Include="System.Web" /> + <Reference Include="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> + <Reference Include="System.Web.Abstractions" /> + <Reference Include="System.Web.Routing" /> + <Reference Include="System.Xml" /> + <Reference Include="System.Configuration" /> + <Reference Include="System.Web.Services" /> + <Reference Include="System.EnterpriseServices" /> + <Reference Include="System.Web.Mobile" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Controllers\AccountController.cs" /> + <Compile Include="Controllers\HomeController.cs" /> + <Compile Include="Controllers\ProjectsController.cs" /> + <Compile Include="Default.aspx.cs"> + <DependentUpon>Default.aspx</DependentUpon> + <SubType>ASPXCodeBehind</SubType> + </Compile> + <Compile Include="Global.asax.cs"> + <DependentUpon>Global.asax</DependentUpon> + </Compile> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <Content Include="App_Data\CronosControl.mdf"> + </Content> + <Content Include="App_Data\CronosControl_log.ldf"> + <DependentUpon>CronosControl.mdf</DependentUpon> + </Content> + <Content Include="Default.aspx" /> + <Content Include="Global.asax" /> + <Content Include="Views\Projects\ProjectsList.aspx" /> + <Content Include="Web.config" /> + <Content Include="Content\Site.css" /> + <Content Include="Scripts\jquery-1.3.2.js" /> + <Content Include="Scripts\jquery-1.3.2.min.js" /> + <Content Include="Scripts\jquery-1.3.2-vsdoc.js" /> + <Content Include="Scripts\jquery-1.3.2.min-vsdoc.js" /> + <Content Include="Scripts\MicrosoftAjax.js" /> + <Content Include="Scripts\MicrosoftAjax.debug.js" /> + <Content Include="Scripts\MicrosoftMvcAjax.js" /> + <Content Include="Scripts\MicrosoftMvcAjax.debug.js" /> + <Content Include="Views\Account\ChangePassword.aspx" /> + <Content Include="Views\Account\ChangePasswordSuccess.aspx" /> + <Content Include="Views\Account\LogOn.aspx" /> + <Content Include="Views\Account\Register.aspx" /> + <Content Include="Views\Home\About.aspx" /> + <Content Include="Views\Home\Index.aspx" /> + <Content Include="Views\Shared\Error.aspx" /> + <Content Include="Views\Shared\LogOnUserControl.ascx" /> + <Content Include="Views\Shared\Site.Master" /> + <Content Include="Views\Web.config" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\CronosControlBusinessClassLibrary\CronosControlBusinessClassLibrary.csproj"> + <Project>{2D8FF602-961B-470C-AECF-817AFF0C4E9C}</Project> + <Name>CronosControlBusinessClassLibrary</Name> + </ProjectReference> + <ProjectReference Include="..\CronosControlClassLibrary\CronosControlDataAccessClassLibrary.csproj"> + <Project>{7191E8B4-4497-40E8-BD9A-04CD4EF802FC}</Project> + <Name>CronosControlDataAccessClassLibrary</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <Folder Include="Models\" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> --> + <Target Name="AfterBuild" Condition="'$(MvcBuildViews)'=='true'"> + <AspNetCompiler VirtualPath="temp" PhysicalPath="$(ProjectDir)\..\$(ProjectName)" /> + </Target> + <ProjectExtensions> + <VisualStudio> + <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}"> + <WebProjectProperties> + <UseIIS>False</UseIIS> + <AutoAssignPort>True</AutoAssignPort> + <DevelopmentServerPort>3405</DevelopmentServerPort> + <DevelopmentServerVPath>/</DevelopmentServerVPath> + <IISUrl> + </IISUrl> + <NTLMAuthentication>False</NTLMAuthentication> + <UseCustomServer>False</UseCustomServer> + <CustomServerUrl> + </CustomServerUrl> + <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile> + </WebProjectProperties> + </FlavorProperties> + </VisualStudio> + </ProjectExtensions> +</Project> \ No newline at end of file Added: source/trunk/CronosControl/CronosControlWeb/Default.aspx =================================================================== --- source/trunk/CronosControl/CronosControlWeb/Default.aspx (rev 0) +++ source/trunk/CronosControl/CronosControlWeb/Default.aspx 2010-01-13 21:45:19 UTC (rev 7) @@ -0,0 +1,3 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="CronosControlWeb._Default" %> + +<%-- Please do not delete this file. It is used to ensure that ASP.NET MVC is activated by IIS when a user makes a "/" request to the server. --%> Added: source/trunk/CronosControl/CronosControlWeb/Default.aspx.cs =================================================================== --- source/trunk/CronosControl/CronosControlWeb/Default.aspx.cs (rev 0) +++ source/trunk/CronosControl/CronosControlWeb/Default.aspx.cs 2010-01-13 21:45:19 UTC (rev 7) @@ -0,0 +1,22 @@ +using System.Web; +using System.Web.Mvc; +using System.Web.UI; + +namespace CronosControlWeb +{ + public partial class _Default : Page + { + public void Page_Load(object sender, System.EventArgs e) + { + // Change the current path so that the Routing handler can correctly interpret + // the request, then restore the original path so that the OutputCache module + // can correctly process the response (if caching is enabled). + + string originalPath = Request.Path; + HttpContext.Current.RewritePath(Request.ApplicationPath, false); + IHttpHandler httpHandler = new MvcHttpHandler(); + httpHandler.ProcessRequest(HttpContext.Current); + HttpContext.Current.RewritePath(originalPath, false); + } + } +} Added: source/trunk/CronosControl/CronosControlWeb/Global.asax =================================================================== --- source/trunk/CronosControl/CronosControlWeb/Global.asax (rev 0) +++ source/trunk/CronosControl/CronosControlWeb/Global.asax 2010-01-13 21:45:19 UTC (rev 7) @@ -0,0 +1 @@ +<%@ Application Codebehind="Global.asax.cs" Inherits="CronosControlWeb.MvcApplication" Language="C#" %> Added: source/trunk/CronosControl/CronosControlWeb/Global.asax.cs =================================================================== --- source/trunk/CronosControl/CronosControlWeb/Global.asax.cs (rev 0) +++ source/trunk/CronosControl/CronosControlWeb/Global.asax.cs 2010-01-13 21:45:19 UTC (rev 7) @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; +using System.Web.Routing; + +namespace CronosControlWeb +{ + // Note: For instructions on enabling IIS6 or IIS7 classic mode, + // visit http://go.microsoft.com/?LinkId=9394801 + + public class MvcApplication : System.Web.HttpApplication + { + public static void RegisterRoutes(RouteCollection routes) + { + routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); + + routes.MapRoute( + "Default", // Route name + "{controller}/{action}/{id}", // URL with parameters + new { controller = "Home", action = "Index", id = "" } // Parameter defaults + ); + + } + + protected void Application_Start() + { + RegisterRoutes(RouteTable.Routes); + } + } +} \ No newline at end of file Added: source/trunk/CronosControl/CronosControlWeb/Properties/AssemblyInfo.cs =================================================================== --- source/trunk/CronosControl/CronosControlWeb/Properties/AssemblyInfo.cs (rev 0) +++ source/trunk/CronosControl/CronosControlWeb/Properties/AssemblyInfo.cs 2010-01-13 21:45:19 UTC (rev 7) @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 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("CronosControlWeb")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CronosControlWeb")] +[assembly: AssemblyCopyright("Copyright © 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("f1b3f2af-0a98-4ff6-9087-ff910707a75e")] + +// 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.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] Added: source/trunk/CronosControl/CronosControlWeb/Scripts/MicrosoftAjax.debug.js =================================================================== --- source/trunk/CronosControl/CronosControlWeb/Scripts/MicrosoftAjax.debug.js (rev 0) +++ source/trunk/CronosControl/CronosControlWeb/Scripts/MicrosoftAjax.debug.js 2010-01-13 21:45:19 UTC (rev 7) @@ -0,0 +1,6850 @@ +// Name: MicrosoftAjax.debug.js +// Assembly: System.Web.Extensions +// Version: 3.5.0.0 +// FileVersion: 3.5.30729.1 +//----------------------------------------------------------------------- +// Copyright (C) Microsoft Corporation. All rights reserved. +//----------------------------------------------------------------------- +// MicrosoftAjax.js +// Microsoft AJAX Framework. + +Function.__typeName = 'Function'; +Function.__class = true; +Function.createCallback = function Function$createCallback(method, context) { + /// <summary locid="M:J#Function.createCallback" /> + /// <param name="method" type="Function"></param> + /// <param name="context" mayBeNull="true"></param> + /// <returns type="Function"></returns> + var e = Function._validateParams(arguments, [ + {name: "method", type: Function}, + {name: "context", mayBeNull: true} + ]); + if (e) throw e; + return function() { + var l = arguments.length; + if (l > 0) { + var args = []; + for (var i = 0; i < l; i++) { + args[i] = arguments[i]; + } + args[l] = context; + return method.apply(this, args); + } + return method.call(this, context); + } +} +Function.createDelegate = function Function$createDelegate(instance, method) { + /// <summary locid="M:J#Function.createDelegate" /> + /// <param name="instance" mayBeNull="true"></param> + /// <param name="method" type="Function"></param> + /// <returns type="Function"></returns> + var e = Function._validateParams(arguments, [ + {name: "instance", mayBeNull: true}, + {name: "method", type: Function} + ]); + if (e) throw e; + return function() { + return method.apply(instance, arguments); + } +} +Function.emptyFunction = Function.emptyMethod = function Function$emptyMethod() { + /// <summary locid="M:J#Function.emptyMethod" /> + if (arguments.length !== 0) throw Error.parameterCount(); +} +Function._validateParams = function Function$_validateParams(params, expectedParams) { + var e; + e = Function._validateParameterCount(params, expectedParams); + if (e) { + e.popStackFrame(); + return e; + } + for (var i=0; i < params.length; i++) { + var expectedParam = expectedParams[Math.min(i, expectedParams.length - 1)]; + var paramName = expectedParam.name; + if (expectedParam.parameterArray) { + paramName += "[" + (i - expectedParams.length + 1) + "]"; + } + ... [truncated message content] |