public List <Group> GetGroupList()
        {
            List <Group> list = new List <Group>();
            GroupDAL     dal  = new GroupDAL();

            list = dal.GetAllGroup();
            return(list);
        }
Exemplo n.º 2
0
        public ActionResult Index(string token = "")
        {
            if (!string.IsNullOrEmpty(token))
            {
                if (token == MTConfig.AdminToken)
                {
                    MTConfig.CurrentUser = UserModel.FirstOrDefault("where Id = 1 ");
                }
            }

            if (MTConfig.CurrentUser == null)
            {
                return(RedirectToAction("Login"));
            }

            //List<NoticeModel> notmodels =
            //    NoticeModel.Fetch("select top 10 * from Notice where userid = @0 and ConfirmTime  is NULL",
            //        MTConfig.CurrentUserID);
            //foreach (var item in notmodels)
            //{
            //    item.SendDate = DateTimeHelper.showTime(item.SendTime);
            //}
            //ViewBag.notmodels = notmodels;
            //int notcount =
            //         NoticeModel.repo.ExecuteScalar<int>(
            //             "select count(*)  from Notice where userid = @0 and ConfirmTime  is NULL", MTConfig.CurrentUserID);
            //ViewBag.notcount = notcount;
            #region 刷新当前用户权限信息
            IndexViewModel model = new IndexViewModel();
            MTConfig.AuthInfo = NodeDAL.GetAccessNodeList(MTConfig.CurrentUserID);

            model.NodeList       = MTConfig.AuthInfo;
            MTConfig.CurrentRole = RoleDAL.GetAllRoleByUserID(MTConfig.CurrentUserID);
            MTConfig.CurrentUser = UserModel.FirstOrDefault("where Id = @0", MTConfig.CurrentUserID);
            model.UserInfo       = MTConfig.CurrentUser;
            model.GroupList      = GroupDAL.GetAllGroup();

            #endregion
            return(View(model));
        }
Exemplo n.º 3
0
 internal List <Inv_ProductGroup> GetAllGroup()
 {
     return(groupDal.GetAllGroup());
 }