From 0411e4c814956a530201938851e70a63d3004b65 Mon Sep 17 00:00:00 2001 From: James Kolpack Date: Tue, 4 Dec 2012 14:04:29 -0500 Subject: [PATCH] Small fixes for web deploy --- Web/Controllers/VehicleController.cs | 2 +- Web/DAL/MileageTrakerInitializer.cs | 8 ++--- Web/Properties/PublishProfiles/ETHRA.pubxml | 29 +++++++++++++++++++ .../PublishProfiles/Localhost.pubxml | 13 +++++++++ Web/Utility/ExcelWriter.cs | 3 +- Web/Utility/FormatHintAttribute.cs | 22 ++------------ Web/Web.Release.config | 5 ++++ Web/Web.config | 2 +- Web/Web.csproj | 8 +++++ 9 files changed, 65 insertions(+), 27 deletions(-) create mode 100644 Web/Properties/PublishProfiles/ETHRA.pubxml create mode 100644 Web/Properties/PublishProfiles/Localhost.pubxml diff --git a/Web/Controllers/VehicleController.cs b/Web/Controllers/VehicleController.cs index 15d2c77..5092645 100644 --- a/Web/Controllers/VehicleController.cs +++ b/Web/Controllers/VehicleController.cs @@ -65,7 +65,7 @@ namespace MileageTraker.Web.Controllers public JsonResult Exists(string vehicleId) { var vehicle = _ds.GetVehicle(vehicleId); - return Json(vehicle != null ? true : false, JsonRequestBehavior.AllowGet); + return Json(vehicle != null, JsonRequestBehavior.AllowGet); } public FileResult Export() diff --git a/Web/DAL/MileageTrakerInitializer.cs b/Web/DAL/MileageTrakerInitializer.cs index f2065e7..7342236 100644 --- a/Web/DAL/MileageTrakerInitializer.cs +++ b/Web/DAL/MileageTrakerInitializer.cs @@ -8,11 +8,11 @@ using MileageTraker.Web.Models; namespace MileageTraker.Web.DAL { public class MileageTrakerInitializer : -#if DEBUG - DropCreateDatabaseIfModelChanges -#else +//#if DEBUG +// DropCreateDatabaseIfModelChanges +//#else CreateDatabaseIfNotExists -#endif +//#endif { private const string CreateIndex = "CREATE NONCLUSTERED INDEX [IDX_{1}] ON [{0}] ([{1}])"; diff --git a/Web/Properties/PublishProfiles/ETHRA.pubxml b/Web/Properties/PublishProfiles/ETHRA.pubxml new file mode 100644 index 0000000..672ad6d --- /dev/null +++ b/Web/Properties/PublishProfiles/ETHRA.pubxml @@ -0,0 +1,29 @@ + + + + + Package + + C:\Users\poprhythm\Documents\code\PublishPackages\MileageTraker.zip + true + Default Web Site + + + + + + + + + + + + + + Data Source=mileage;Initial Catalog=MileageTraker;User Id=MileageTrakerUser;Password=qwerty;Connect Timeout=60 + + + \ No newline at end of file diff --git a/Web/Properties/PublishProfiles/Localhost.pubxml b/Web/Properties/PublishProfiles/Localhost.pubxml new file mode 100644 index 0000000..068d7fb --- /dev/null +++ b/Web/Properties/PublishProfiles/Localhost.pubxml @@ -0,0 +1,13 @@ + + + + + FileSystem + + C:\inetpub\MileageTraker + False + + \ No newline at end of file diff --git a/Web/Utility/ExcelWriter.cs b/Web/Utility/ExcelWriter.cs index 6466f95..2f21dd0 100644 --- a/Web/Utility/ExcelWriter.cs +++ b/Web/Utility/ExcelWriter.cs @@ -35,7 +35,8 @@ namespace MileageTraker.Web.Utility // write column headers var properties = typeof(T).GetProperties() - .Where(p => !p.PropertyType.IsCollection()); + .Where(p => !p.PropertyType.IsCollection()) + .ToList(); properties.Zip( CustomExtensions.GetNumbers(), diff --git a/Web/Utility/FormatHintAttribute.cs b/Web/Utility/FormatHintAttribute.cs index 90753fb..ff401fb 100644 --- a/Web/Utility/FormatHintAttribute.cs +++ b/Web/Utility/FormatHintAttribute.cs @@ -5,7 +5,7 @@ namespace MileageTraker.Web.Utility [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)] public class FormatHintAttribute : Attribute { - public string Text { get; set; } + public string Text { get; private set; } public FormatHintAttribute(string text) { @@ -15,7 +15,7 @@ namespace MileageTraker.Web.Utility [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)] public class UnitsAttribute : Attribute { - public string Text { get; set; } + public string Text { get; private set; } public UnitsAttribute(string text) { @@ -27,22 +27,4 @@ namespace MileageTraker.Web.Utility public class NoEditLabelAttribute : Attribute { } - - [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)] - public sealed class RenderModeAttribute : Attribute - { - public RenderMode RenderMode { get; set; } - - public RenderModeAttribute(RenderMode renderMode) - { - RenderMode = renderMode; - } - } - - public enum RenderMode - { - Any, - EditModeOnly, - DisplayModeOnly - } } \ No newline at end of file diff --git a/Web/Web.Release.config b/Web/Web.Release.config index 4122d79..1288a60 100644 --- a/Web/Web.Release.config +++ b/Web/Web.Release.config @@ -28,4 +28,9 @@ --> + + + + + \ No newline at end of file diff --git a/Web/Web.config b/Web/Web.config index aad8cf8..83369db 100644 --- a/Web/Web.config +++ b/Web/Web.config @@ -5,7 +5,7 @@
- + diff --git a/Web/Web.csproj b/Web/Web.csproj index 985b465..7bee143 100644 --- a/Web/Web.csproj +++ b/Web/Web.csproj @@ -21,6 +21,10 @@ 4.0 + + + + true @@ -359,6 +363,10 @@ + + + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)