Ejemplo n.º 1
0
        /// <summary>
        /// gets the index of the idea report module
        /// </summary>
        /// <returns>returns the result to action</returns>
        public ActionResult Index()
        {
            IdeaReportRepository ideaReport = new IdeaReportRepository(SessionCustom);
            ModulRepository      modul      = new ModulRepository(SessionCustom);

            modul.Entity.ModulId    = 56;
            modul.Entity.LanguageId = CurrentLanguage.LanguageId;
            modul.Load();

            PaginInfo paginInfo = new PaginInfo()
            {
                PageIndex = 1
            };

            return(this.View(new Models.IdeaReport()
            {
                UserPrincipal = CustomUser,
                Module = modul.Entity,
                CollIdeaReport = ideaReport.GetAllPaging(null, paginInfo),
                ColModul = CustomMemberShipProvider.GetModuls(CustomUser.UserId, SessionCustom, HttpContext),
                Total = paginInfo.TotalCount,
                Controller = modul.Entity.Controller,
                CurrentLanguage = CurrentLanguage
            }));
        }
Ejemplo n.º 2
0
        public JsonResult GetIdeaReports(int mod, int page, string text, short?filter, bool?active)
        {
            StringBuilder strbl = new StringBuilder();

            IdeaReportRepository objideaReport = new IdeaReportRepository(SessionCustom);
            PaginInfo            paginInfo     = new PaginInfo()
            {
                PageIndex = page
            };

            objideaReport.Entity.Text   = text;
            objideaReport.Entity.Status = active;

            IEnumerable <Domain.Entities.FrontEnd.IdeaReportPaging> ideaReports = objideaReport.GetAllPaging(filter, paginInfo);

            foreach (Domain.Entities.FrontEnd.IdeaReportPaging ideaReport in ideaReports)
            {
                string ideaActive       = ideaReport.IdeaActive.Value ? "block" : "none";
                string ideaInActive     = !ideaReport.IdeaActive.Value ? "block" : "none";
                string ideaUserActive   = ideaReport.IdeaUserActive.Value ? "none" : "block";
                string ideaUserInActive = !ideaReport.IdeaUserActive.Value ? "none" : "block";
                strbl.AppendLine("<tr id=\"li" + ideaReport.IdeaReportId + "\" >");
                strbl.AppendLine("<td onclick=\"if(ctnback.clicOk) { ctnback.contentselect(this, " + ideaReport.IdeaReportId + "); } else { ctnback.clicOk = true; }\">" + Business.Utils.TruncateWord(ideaReport.IdeaText, 45) + "</td>");
                strbl.AppendLine("<td onclick=\"if(ctnback.clicOk) { ctnback.contentselect(this, " + ideaReport.IdeaReportId + "); } else { ctnback.clicOk = true; }\">" + ideaReport.Motive + "</td>");
                strbl.AppendLine("<td onclick=\"if(ctnback.clicOk) { ctnback.contentselect(this, " + ideaReport.IdeaReportId + "); } else { ctnback.clicOk = true; }\">" + Business.Utils.TruncateWord(ideaReport.Text, 45) + "</td>");
                strbl.AppendLine("<td>");
                if (!ideaReport.Status.Value)
                {
                    strbl.AppendLine("<a class=\"check-report\" data-id=\"" + ideaReport.IdeaReportId + "\">" + Resources.Global.Messages.CHECKED + "</a>");
                }
                else
                {
                    strbl.AppendLine("<img src=\"" + Url.Content("~/resources/images/25check.png") + "\" />");
                }

                strbl.AppendLine("</td>");
                strbl.AppendLine("<td data-id=\"" + ideaReport.IdeaId + "\">");
                strbl.AppendLine("<a class=\"block-idea\" style=\"display:" + ideaActive + ";\">" + Resources.Extend.Messages.BLOCK_IDEA + "</a>");
                strbl.AppendLine("<a class=\"unblock-idea\" style=\"display:" + ideaInActive + ";\">" + Resources.Extend.Messages.UNBLOCK_IDEA + "</a>");
                strbl.AppendLine("</td>");
                strbl.AppendLine("<td data-id=\"" + ideaReport.IdeaUserId + "\">");
                strbl.AppendLine("<a class=\"block-idea-user\" style=\"display:" + ideaUserActive + ";\">" + Resources.Extend.Messages.BLOCK_USER + "</a>");
                strbl.AppendLine("<a class=\"unblock-idea-user\" style=\"display:" + ideaUserInActive + ";\">" + Resources.Extend.Messages.UNBLOCK_USER + "</a>");
                strbl.AppendLine("</td></tr>");
            }

            return(this.Json(new { html = strbl.ToString(), count = ideaReports.Count(), total = paginInfo.TotalCount }, JsonRequestBehavior.AllowGet));
        }