Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

moved the DB to be included in the project to enable running the proj…

…ect on any computer and changed connection strings in appropriate config files

fixed traveler js object post to profile/edit and included postify.js in the layout
  • Loading branch information...
commit 3a35ea87074794384802515f3ae903d9b2553780 1 parent 494a933
Nimrod Dayan authored
BIN  src/TravelersAround.HTTPHost/App_Data/Database1_log.LDF
View
Binary file not shown
BIN  src/TravelersAround.HTTPHost/App_Data/TravelersAround.mdf
View
Binary file not shown
BIN  src/TravelersAround.HTTPHost/App_Data/TravelersAround_log.ldf
View
Binary file not shown
5 src/TravelersAround.HTTPHost/TravelersAround.HTTPHost.csproj
View
@@ -54,6 +54,10 @@
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
+ <Content Include="App_Data\TravelersAround.mdf" />
+ <Content Include="App_Data\TravelersAround_log.ldf">
+ <DependentUpon>TravelersAround.mdf</DependentUpon>
+ </Content>
<Content Include="Global.asax" />
<Content Include="Web.config">
<SubType>Designer</SubType>
@@ -87,6 +91,7 @@
<Name>TravelersAround.Service</Name>
</ProjectReference>
</ItemGroup>
+ <ItemGroup />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<ProjectExtensions>
4 src/TravelersAround.HTTPHost/Web.config
View
@@ -57,10 +57,10 @@
<connectionStrings>
<add name="TravelersAroundEntities"
- connectionString="metadata=res://*/TravelersAround.csdl|res://*/TravelersAround.ssdl|res://*/TravelersAround.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=NIMROD-LAPTOP\SQLEXPRESS;initial catalog=TravelersAround;integrated security=True;pooling=False;multipleactiveresultsets=True;App=EntityFramework&quot;"
+ connectionString="metadata=res://*/TravelersAround.csdl|res://*/TravelersAround.ssdl|res://*/TravelersAround.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=.\SQLEXPRESS;AttachDBFilename=|DataDirectory|TravelersAround.mdf;integrated security=True;pooling=False;multipleactiveresultsets=True;App=EntityFramework&quot;"
providerName="System.Data.EntityClient" />
<add name="ApplicationServices"
- connectionString="data source=.\SQLEXPRESS;initial catalog=TravelersAround;integrated security=True"
+ connectionString="data source=.\SQLEXPRESS;AttachDBFilename=|DataDirectory|TravelersAround.mdf;integrated security=True"
providerName="System.Data.SqlClient"/>
</connectionStrings>
2  src/TravelersAround.Repository/App.Config
View
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<connectionStrings>
- <add name="TravelersAroundEntities" connectionString="metadata=res://*/TravelersAround.csdl|res://*/TravelersAround.ssdl|res://*/TravelersAround.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=NIMROD-LAPTOP\SQLEXPRESS;initial catalog=TravelersAround;integrated security=True;pooling=False;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
+ <add name="TravelersAroundEntities" connectionString="metadata=res://*/TravelersAround.csdl|res://*/TravelersAround.ssdl|res://*/TravelersAround.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=.\SQLEXPRESS;AttachDBFilename=|DataDirectory|TravelersAround.mdf;integrated security=True;pooling=False;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>
</configuration>
4 src/TravelersAround.Repository/TravelersAround.Repository.csproj
View
@@ -66,7 +66,9 @@
<EntityDeploy Include="TravelersAround.edmx" />
</ItemGroup>
<ItemGroup>
- <None Include="App.Config" />
+ <None Include="App.Config">
+ <SubType>Designer</SubType>
+ </None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
4 src/TravelersAround.Service/App.Config
View
@@ -3,10 +3,10 @@
<connectionStrings>
<add name="TravelersAroundEntities"
- connectionString="metadata=res://*/TravelersAround.csdl|res://*/TravelersAround.ssdl|res://*/TravelersAround.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=NIMROD-LAPTOP\SQLEXPRESS;initial catalog=TravelersAround;integrated security=True;pooling=False;multipleactiveresultsets=True;App=EntityFramework&quot;"
+ connectionString="metadata=res://*/TravelersAround.csdl|res://*/TravelersAround.ssdl|res://*/TravelersAround.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=.\SQLEXPRESS;AttachDBFilename=|DataDirectory|TravelersAround.mdf;integrated security=True;pooling=False;multipleactiveresultsets=True;App=EntityFramework&quot;"
providerName="System.Data.EntityClient" />
<add name="ApplicationServices"
- connectionString="data source=.\SQLEXPRESS;initial catalog=TravelersAround;integrated security=True"
+ connectionString="data source=.\SQLEXPRESS;AttachDBFilename=|DataDirectory|TravelersAround.mdf;integrated security=True"
providerName="System.Data.SqlClient"/>
</connectionStrings>
1  src/TravelersAround.WebMvc/Content/Site.css
View
@@ -382,6 +382,7 @@ div#logo img
font-weight: bold;
color: #ff0000;
background: transparent url(/content/img/icons/note.png) no-repeat center left;
+ padding-left: 20px;
}
.validation-summary-valid
1  src/TravelersAround.WebMvc/Controllers/ProfileController.cs
View
@@ -76,6 +76,7 @@ public ActionResult Edit(ProfileUpdateView model)
ModelState.AddModelError("", model.ResponseMessage);
}
}
+ //TODO: handle situation when model is not valid and return proper error for ajax calls
return View(model);
}
2  src/TravelersAround.WebMvc/Scripts/TravelersAround.js
View
@@ -56,7 +56,7 @@ function printAsyncResponse(message, container) {
function statusMessageAsyncSubmit(formData) {
var data;
traveler.StatusMessage = $(formData.StatusMessage).val();
- $.post('/profile/edit', traveler, function (data) {
+ $.post('/profile/edit', $.postify(traveler), function (data) {
printAsyncResponse(data, $('#status-message-container'));
});
return false;
38 src/TravelersAround.WebMvc/Scripts/postify.js
View
@@ -0,0 +1,38 @@
+// postify.js
+// Converts an object to an ASP.NET MVC model-binding-friendly format
+// Author: Nick Riggs
+// http://www.nickriggs.com
+
+$.postify = function(value) {
+ var result = {};
+
+ var buildResult = function(object, prefix) {
+ for (var key in object) {
+
+ var postKey = isFinite(key)
+ ? (prefix != "" ? prefix : "") + "[" + key + "]"
+ : (prefix != "" ? prefix + "." : "") + key;
+
+ switch (typeof (object[key])) {
+ case "number":
+ case "string":
+ case "boolean":
+ result[postKey] = object[key];
+ break;
+
+ case "object":
+ if (object[key] == null || object[key] == undefined)
+ result[postKey] = object[key];
+ else if (object[key].toUTCString)
+ result[postKey] = object[key].toUTCString().replace("UTC", "GMT");
+ else {
+ buildResult(object[key], postKey != "" ? postKey : key);
+ }
+ }
+ }
+ };
+
+ buildResult(value, "");
+
+ return result;
+};
1  src/TravelersAround.WebMvc/TravelersAround.WebMvc.csproj
View
@@ -100,6 +100,7 @@
<Content Include="Content\img\logo.png" />
<Content Include="favicon.ico" />
<Content Include="Global.asax" />
+ <Content Include="Scripts\postify.js" />
<Content Include="Scripts\TravelersAround.js" />
<Content Include="Web.config" />
<Content Include="Web.Debug.config">
1  src/TravelersAround.WebMvc/Views/Shared/_Layout.cshtml
View
@@ -6,6 +6,7 @@
<script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
@if (User.Identity.IsAuthenticated)
{
+ <script src="@Url.Content("~/Scripts/postify.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/TravelersAround.js")" type="text/javascript"></script>
}
</head>
6 src/TravelersAround.sln
View
@@ -40,6 +40,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TravelersAround.WebMvc", "T
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TravelersAround.Infrastructure", "TravelersAround.Infrastructure\TravelersAround.Infrastructure.csproj", "{E3687668-11DE-45E8-B712-47DC8206D23B}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data Access Layer", "Data Access Layer", "{B22FDCAF-4F77-458A-98C6-09E234F6457D}"
+EndProject
Global
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = TravelersAround1.vsmdi
@@ -102,8 +104,6 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
- {D99128CC-ECAD-4AD0-A4E7-40DBEBA4161F} = {456994AE-3EAD-4B78-83E2-4259FFDD5B4A}
- {76E11CD2-E6AC-47EE-B8F6-23673D4DBBB3} = {456994AE-3EAD-4B78-83E2-4259FFDD5B4A}
{72284192-C787-4F25-A88B-EBDF769EE695} = {456994AE-3EAD-4B78-83E2-4259FFDD5B4A}
{EA3817BC-77E8-4F2D-98B8-0E9FE5B2BEAB} = {456994AE-3EAD-4B78-83E2-4259FFDD5B4A}
{E3687668-11DE-45E8-B712-47DC8206D23B} = {456994AE-3EAD-4B78-83E2-4259FFDD5B4A}
@@ -114,5 +114,7 @@ Global
{36DA9243-33A7-4959-9B42-B3B05BC386F9} = {7C977746-8C38-4555-B564-C74988F201FE}
{25DCDBF0-A995-4155-93FF-463758044040} = {592D09CD-EA61-400A-8898-8FD792A7A08E}
{6672D7B3-FE30-40A8-BFD7-BAA811907411} = {592D09CD-EA61-400A-8898-8FD792A7A08E}
+ {D99128CC-ECAD-4AD0-A4E7-40DBEBA4161F} = {B22FDCAF-4F77-458A-98C6-09E234F6457D}
+ {76E11CD2-E6AC-47EE-B8F6-23673D4DBBB3} = {B22FDCAF-4F77-458A-98C6-09E234F6457D}
EndGlobalSection
EndGlobal
18 src/readme.txt
View
@@ -0,0 +1,18 @@
+Instructions:
+--------------
+
+IMPORTANT! You have to run Visual Studio in administrator mode (right click and choose "run as administrator")
+
+1. Right click TravelersAround.HTTPHost located under the folder: Service Layer and choose "View in Browser" to run the web service before running the project.
+
+2. Press CONTROL + F5 to run.
+
+
+
+Copyright (c) 2011 TravelersAround developed by Nimrod Dayan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please sign in to comment.
Something went wrong with that request. Please try again.