JXMovies/CMS/JXCMS.CMS.Movie/Admin/Controllers/CollectionController.cs

47 lines
1.2 KiB
C#
Raw Normal View History

2020-02-09 19:10:05 +08:00
using JXCMS.CMS.Attribute;
using JXCMS.CMS.Movie.Entity;
using Microsoft.AspNetCore.Mvc;
namespace JXCMS.CMS.Admin.Controllers
{
[Area("Admin")]
[AdminAuthentication]
public class CollectionController : Controller
{
public IActionResult Index()
{
ViewBag.title = "采集地址";
var website = WebSiteEntity.Select.ToList();
ViewBag.website = website;
return View();
}
[HttpPost]
public IActionResult AddWebSite(WebSiteEntity webSiteEntity)
{
webSiteEntity.Save();
return Redirect(Url.Action("Index"));
}
2020-02-09 22:43:16 +08:00
public IActionResult DeleteWebSite(int id)
{
return Redirect(Url.Action("Index"));
}
2020-02-09 19:10:05 +08:00
public IActionResult WebSiteDialog(int id)
{
WebSiteEntity webSiteEntity = null;
if (id == 0)
{
webSiteEntity = new WebSiteEntity();
ViewBag.title = "添加新网站";
}
else
{
webSiteEntity = WebSiteEntity.Find(id);
ViewBag.title = "修改" + webSiteEntity.WebSiteName;
}
return View(webSiteEntity);
}
}
}