aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Web/Tango.MachineService/Controllers/DownloadsController.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-02-26 13:56:08 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-02-26 13:56:08 +0200
commit99fa6ef9b19dc81f10b582ca6749bf1c8cf32c44 (patch)
tree9c5451e2c516e96ada413a6aa4f3f22e49817d8a /Software/Visual_Studio/Web/Tango.MachineService/Controllers/DownloadsController.cs
parentbbd04cf9e88d147225cc4b0d782fec31cfe21b6e (diff)
downloadTango-99fa6ef9b19dc81f10b582ca6749bf1c8cf32c44.tar.gz
Tango-99fa6ef9b19dc81f10b582ca6749bf1c8cf32c44.zip
Working on machine service downloads site.
Diffstat (limited to 'Software/Visual_Studio/Web/Tango.MachineService/Controllers/DownloadsController.cs')
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/Controllers/DownloadsController.cs29
1 files changed, 27 insertions, 2 deletions
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/DownloadsController.cs b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/DownloadsController.cs
index 126b794ea..ecdbf662c 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/DownloadsController.cs
+++ b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/DownloadsController.cs
@@ -3,15 +3,40 @@ using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
+using Tango.MachineService.Filters;
+using Tango.MachineService.Models;
+using Tango.MachineService.Views.Downloads;
namespace Tango.MachineService.Controllers
{
public class DownloadsController : Controller
{
- // GET: Downloads
+ [Authorize]
public ActionResult Index()
{
- return View();
+ List<DownloadModel> downloads = new List<DownloadModel>();
+ for (int i = 0; i < 10; i++)
+ {
+ downloads.Add(new DownloadModel()
+ {
+ Name = "Downloads " + i,
+ Comments = "Some comments...\nWith a new line",
+ Date = DateTime.Now.ToString(),
+ User = "Roy",
+ ID = i.ToString(),
+ });
+ }
+
+ IndexViewModel model = new IndexViewModel();
+ model.Downloads = downloads;
+
+ return View(model);
+ }
+
+ [Authorize]
+ public ActionResult Download(String id)
+ {
+ return File(new byte[] { 25, 255, 255 }, System.Net.Mime.MediaTypeNames.Application.Octet,"Machine Studio v1.0.exe");
}
}
} \ No newline at end of file