diff --git a/HoloXPLOR/App_Start/RouteConfig.cs b/HoloXPLOR/App_Start/RouteConfig.cs index 259c4f6..973779c 100644 --- a/HoloXPLOR/App_Start/RouteConfig.cs +++ b/HoloXPLOR/App_Start/RouteConfig.cs @@ -44,6 +44,12 @@ public static void RegisterRoutes(RouteCollection routes) defaults: new { controller = "HoloTable", action = "Inventory" } ); + routes.MapRoute( + name: "HangarDelete", + url: "HoloTable/Delete/{id}", + defaults: new { controller = "HoloTable", action = "Delete" } + ); + routes.MapRoute( name: "HangarRating", url: "HoloTable/Rating/{id}/{shipid}/{targetship}", diff --git a/HoloXPLOR/Controllers/HoloTableController.cs b/HoloXPLOR/Controllers/HoloTableController.cs index 1bbd390..c1f779f 100644 --- a/HoloXPLOR/Controllers/HoloTableController.cs +++ b/HoloXPLOR/Controllers/HoloTableController.cs @@ -13,6 +13,7 @@ using Xml = HoloXPLOR.Data.XML; using System.Threading.Tasks; using System.Net.Http; +using System.Threading; namespace HoloXPLOR.Controllers { @@ -116,6 +117,28 @@ public ActionResult Rating(String id, Guid shipID, String targetShip) } } + public ActionResult Delete(String id) + { + if (String.Equals("sample", id, StringComparison.InvariantCultureIgnoreCase)) + { + return RedirectToAction("NotAllowed"); + } + + HoloTableController._lockMap[id] = HoloTableController._lockMap.GetValue(id, new Object()); + + lock (HoloTableController._lockMap[id]) + { + String filename = HttpContext.Server.MapPath(String.Format(@"~/App_Data/{0}.xml", id)); + + if (System.IO.File.Exists(filename)) + { + System.IO.File.Delete(filename); + } + } + + return View(); + } + private IEnumerable FlattenIDs(DetailModel model, Item item) { if (item != null || item.ID != Guid.Empty) diff --git a/HoloXPLOR/HoloXPLOR.csproj b/HoloXPLOR/HoloXPLOR.csproj index e11b114..01cb3d0 100644 --- a/HoloXPLOR/HoloXPLOR.csproj +++ b/HoloXPLOR/HoloXPLOR.csproj @@ -2133,7 +2133,7 @@ - + @@ -2312,7 +2312,10 @@ - + + Designer + + diff --git a/HoloXPLOR/Properties/PublishProfiles/holoxplor-test.azurewebsites.net.pubxml b/HoloXPLOR/Properties/PublishProfiles/holoxplor-ptu.pubxml similarity index 77% rename from HoloXPLOR/Properties/PublishProfiles/holoxplor-test.azurewebsites.net.pubxml rename to HoloXPLOR/Properties/PublishProfiles/holoxplor-ptu.pubxml index 0468e63..56d1c4a 100644 --- a/HoloXPLOR/Properties/PublishProfiles/holoxplor-test.azurewebsites.net.pubxml +++ b/HoloXPLOR/Properties/PublishProfiles/holoxplor-ptu.pubxml @@ -8,16 +8,16 @@ by editing this MSBuild file. In order to learn more about this please visit htt MSDeploy Release Any CPU - http://holoxplor-test.azurewebsites.net + http://holoxplor-ptu.azurewebsites.net True False - holoxplor-test.scm.azurewebsites.net:443 - holoxplor-test + holoxplor-ptu.scm.azurewebsites.net:443 + holoxplor-ptu True WMSVC True - $holoxplor-test + $holoxplor-ptu <_SavePWD>True <_DestinationType>AzureWebSite diff --git a/HoloXPLOR/Views/HoloTable/Delete.cshtml b/HoloXPLOR/Views/HoloTable/Delete.cshtml new file mode 100644 index 0000000..1f58df7 --- /dev/null +++ b/HoloXPLOR/Views/HoloTable/Delete.cshtml @@ -0,0 +1,17 @@ +@{ + ViewBag.Title = "Hangar"; +} + +@using (Html.BeginForm("Upload", "HoloTable", FormMethod.Post, new { id = "form-upload" })) +{ } + +
+

Your Hangar has been removed.

+

You must re-upload your Inventory XML to continue.

+
+ +
+ @Html.Partial("_GettingStarted") + @Html.Partial("_Instructions") + @Html.Partial("_Support") +
diff --git a/HoloXPLOR/Views/Shared/_Layout.cshtml b/HoloXPLOR/Views/Shared/_Layout.cshtml index 2b137e0..daaef49 100644 --- a/HoloXPLOR/Views/Shared/_Layout.cshtml +++ b/HoloXPLOR/Views/Shared/_Layout.cshtml @@ -82,6 +82,10 @@
  • Hangar
  • }
  • Download
  • + @if (!String.Equals(ViewBag.ID, "sample", StringComparison.InvariantCultureIgnoreCase)) + { +
  • Delete My Data
  • + } }