Exemple #1
0
        public ActionResult Create(long?Id)
        {
            var model = new Models.SysNoticeModels.SysNoticeModel();

            if (Id != null)
            {
                var item = provider.GetNotice(Id.Value);
                model = new Models.SysNoticeModels.SysNoticeModel
                {
                    Id         = item.Id,
                    CreateTime = item.CreateTime,
                    Content    = item.Content,
                    NoticeType = item.NoticeType,
                    Title      = item.Title
                };
            }
            return(View(model));
        }
        public ActionResult Login()
        {
            if (Common.ToolHelper.IsMobileDevice())
            {
                return(RedirectToAction("Index", "Mobile"));
            }
            if (Common.FormsTicket.UserId > 0)
            {
                return(RedirectToAction("Index", "Default"));
            }
            //System.Web.HttpContext.Current.Session.Clear();
            //System.Web.Security.FormsAuthentication.SignOut();

            Provider.SysNoticeProvider provider = new Provider.SysNoticeProvider();

            var    list    = provider.GetList();
            var    model   = new List <Models.SysNoticeModels.SysNoticeModel>();
            string Title   = "";
            string Content = "";

            foreach (var item in list)
            {
                if (item.NoticeType == 1)
                {
                    var t = provider.GetNotice(item.Id);
                    if (t != null)
                    {
                        Title   = t.Title;
                        Content = t.Content;
                    }
                }
                else
                {
                    model.Add(new Models.SysNoticeModels.SysNoticeModel
                    {
                        Id         = item.Id,
                        CreateTime = item.CreateTime,
                        Content    = item.Content,
                        NoticeType = item.NoticeType,
                        Title      = item.Title
                    });
                }
            }

            ViewBag.Head    = Title;
            ViewBag.Content = Content;
            var title = new Cache.SysSettingCache().Get(Common.FormsTicket.SystemCode);

            ViewBag.Title     = title.SystemName;
            ViewBag.LoginLogo = title.LoginLogo == null ? "" : new Common.FileHelper().GetFileUrl(title.LoginLogo, Common.FileConfig.OtherPhotoPath, this.HttpContext);
            ViewBag.Contact   = title.Contact;
            ViewBag.Feeback   = title.Feeback;
            return(View(model));
        }
        /// <summary>
        /// 首页
        /// </summary>
        /// <returns></returns>
        public ActionResult Test()
        {
            Provider.SysNoticeProvider provider = new Provider.SysNoticeProvider();

            var    list    = provider.GetList();
            var    model   = new List <Models.SysNoticeModels.SysNoticeModel>();
            string Title   = "";
            string Content = "";

            foreach (var item in list)
            {
                if (item.NoticeType == 1)
                {
                    var t = provider.GetNotice(item.Id);
                    if (t != null)
                    {
                        Title   = t.Title;
                        Content = t.Content;
                    }
                }
                else
                {
                    model.Add(new Models.SysNoticeModels.SysNoticeModel
                    {
                        Id         = item.Id,
                        CreateTime = item.CreateTime,
                        Content    = item.Content,
                        NoticeType = item.NoticeType,
                        Title      = item.Title
                    });
                }
            }
            ViewBag.Title   = Title;
            ViewBag.Content = Content;
            return(View(model));
        }