Esempio n. 1
0
        public ActionResult Index()
        {
            AnnouncementEntity   objAnnouncment = AnnouncementServices.GetAnnouncement();
            List <HolidayEntity> objHolidayList = HolidayServices.GetAllHoliday();

            ViewBag.HolidayList = objHolidayList;
            string AnnouncmentText = objAnnouncment.AnnouncementText;

            AnnouncmentText = AnnouncmentText == null ? string.Empty : AnnouncmentText;
            string AnnouncmentHtml = "";

            if (AnnouncmentText.Trim() != "")
            {
                try
                {
                    string[] AnnouncmentList = AnnouncmentText.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);

                    foreach (string item in AnnouncmentList)
                    {
                        AnnouncmentHtml += "<li class=\"news-item\"><small>" + item + "</small></li>";
                    }
                }
                catch { }
            }
            else
            {
                AnnouncmentHtml = "<li class=\"news-item\"><small>No new Announcments.</small></li>";
            }
            ViewBag.AnnouncementMessage = AnnouncmentHtml;
            return(View());
        }
        public ActionResult Index()
        {
            List <HolidayEntity> model = HolidayServices.GetAllHoliday();

            return(View(model));
        }