DocumentServer/OnlineEditorsExample/OnlineEditorsExampleMVC/Controllers/HomeController.cs
2015-04-29 19:10:50 +03:00

34 lines
899 B
C#

using System.Web.Mvc;
using OnlineEditorsExampleMVC.Helpers;
using OnlineEditorsExampleMVC.Models;
namespace OnlineEditorsExampleMVC.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
public ActionResult Editor(string fileName, string mode)
{
mode = mode ?? string.Empty;
var file = new FileModel
{
TypeDesktop = mode != "embedded",
FileName = fileName
};
return View("Editor", file);
}
public ActionResult Sample(string fileExt)
{
var fileName = DocManagerHelper.CreateDemo(fileExt);
Response.Redirect(Url.Action("Editor", "Home", new { fileName = fileName }));
return null;
}
}
}