2020-10-12 14:39:23 +09:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Web;
|
|
|
|
|
|
using System.Web.Mvc;
|
|
|
|
|
|
|
|
|
|
|
|
using NP.Model;
|
|
|
|
|
|
|
|
|
|
|
|
namespace NP.BO.Controllers
|
|
|
|
|
|
{
|
|
|
|
|
|
public class HomeController : BOBaseController
|
|
|
|
|
|
{
|
|
|
|
|
|
public ActionResult Index(NP.Model.VMHome vm)
|
|
|
|
|
|
{
|
|
|
|
|
|
ViewBag.IsHome = true;
|
|
|
|
|
|
if (SUserInfo.IsTeacher)
|
|
|
|
|
|
{
|
|
|
|
|
|
return RedirectToAction(nameof(croomController.grades), "croom");
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (SUserInfo.IsSiteAdmin)
|
|
|
|
|
|
{
|
|
|
|
|
|
return RedirectToAction(nameof(userController.users), "user");
|
|
|
|
|
|
}
|
2021-05-21 15:55:49 +09:00
|
|
|
|
else if (SUserInfo.IsSubAdmin)
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var m in GetMENUS.Where(w => w.usertype == base.SUserInfo.UserType && w.menuurl != "/" && w.menulevel == 1 && w.ishid < 1).ToList())
|
|
|
|
|
|
{
|
|
|
|
|
|
var ms = GetMENUS.Where(w => w.usertype == base.SUserInfo.UserType && w.pmenuno == m.menuno && w.ishid < 1).FirstOrDefault();
|
|
|
|
|
|
if (ms != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return Redirect(ms.menuurl);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-10-12 14:39:23 +09:00
|
|
|
|
vm.Data = Dao.Get<Data>("common.home", SUserInfo.UserNo).First();
|
2021-01-19 15:57:17 +09:00
|
|
|
|
vm.CMs = Dao.Get<CM>("cm.cms", new System.Collections.Hashtable() { { "ismaster", 0 },{ "isuse", 1 },{"cname",vm.stringval },{ "iscurrent",1 },{ "orderby", "a.setime desc,t.tyear desc,t.tseq desc,a.cname,a.classno" } });
|
2020-10-12 14:39:23 +09:00
|
|
|
|
return View(vm);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|