コード例 #1
0
        public JsonResult SaveSection(Section objsec)
        {
            SectionManagement objSection = new SectionManagement(SessionCustom, HttpContext);

            objsec.LanguageId = CurrentLanguage.LanguageId;
            HttpContext.Cache.Remove("sectionsactive");
            return(this.Json(new { result = objSection.SaveSection(objsec) }));
        }
コード例 #2
0
        /// <summary>
        /// gets the home of section module
        /// </summary>
        /// <returns>returns the result to action</returns>
        public ActionResult Index()
        {
            SectionManagement objSection = new SectionManagement(SessionCustom, HttpContext);

            return(this.View(new Secciones()
            {
                UserPrincipal = CustomUser,
                Module = this.Module,
                CollSections = objSection.GetSectionsParentNull(CurrentLanguage.LanguageId.Value),
                ColModul = CustomMemberShipProvider.GetModuls(CustomUser.UserId, SessionCustom, HttpContext),
                CollLayouts = objSection.GetLayouts(),
                CollTemplates = objSection.GetTemplates(),
                CurrentLanguage = CurrentLanguage
            }));
        }
コード例 #3
0
        /// <summary>
        /// gets the detail of a banner
        /// </summary>
        /// <param name="id">identifier of banner</param>
        /// <returns>returns the result to action</returns>
        public ActionResult Detail(int?id)
        {
            BannerRepository   objbanner         = new BannerRepository(SessionCustom);
            SectionManagement  objsection        = new SectionManagement(SessionCustom, HttpContext);
            SectionRepository  sectionrepository = new SectionRepository(SessionCustom);
            PositionRepository objposition       = new PositionRepository(SessionCustom);

            Domain.Entities.Banner banner = null;
            bool?isHome = null;

            if (id != null)
            {
                objbanner.Entity.BannerId = id;
                objbanner.Load();
                banner     = objbanner.Entity;
                ViewBag.id = id;

                BannersectionRepository objbannersection = new BannersectionRepository(SessionCustom);
                objbannersection.Entity.BannerId = id;

                List <Bannersection> collsections = objbannersection.GetAll();
                objsection.CreateTreeViewCheck(sectionrepository.GetAll().FindAll(t => t.LanguageId == CurrentLanguage.LanguageId), collsections);
                isHome = collsections.Exists(t => t.SectionId == 0);
            }
            else
            {
                objsection.CreateTreeViewCheck(sectionrepository.GetAll().FindAll(t => t.LanguageId == CurrentLanguage.LanguageId), null);
            }

            return(this.View(new Banners()
            {
                UserPrincipal = CustomUser,
                Banner = banner,
                ColModul = CustomMemberShipProvider.GetModuls(CustomUser.UserId, SessionCustom, HttpContext),
                Module = this.Module,
                TreeView = objsection.Tree,
                Collposition = objposition.GetAll(),
                IsHome = isHome,
                CurrentLanguage = CurrentLanguage
            }));
        }
コード例 #4
0
        /// <summary>
        /// change the section parent
        /// </summary>
        /// <param name="sectionId">identifier of section</param>
        /// <param name="parentId">identifier of parent section</param>
        /// <returns>returns the result to action</returns>
        public JsonResult ChangeParent(int sectionId, int parentId)
        {
            SectionRepository objsection = new SectionRepository(SessionCustom);
            SectionManagement objman     = new SectionManagement(SessionCustom, HttpContext);

            objsection.Entity.SectionId = sectionId;
            objsection.LoadByKey();

            if (parentId != 0)
            {
                objsection.Entity.ParentId = parentId;
            }
            else
            {
                objsection.Entity.ParentId = null;
            }

            objsection.Update();
            objsection.Entity = new Section();

            objman.CreateTreeView(sectionId, objsection.GetAll());

            return(this.Json(new { result = true, html = objman.Tree }));
        }
コード例 #5
0
        public JsonResult Detail(int id)
        {
            SectionManagement objSection = new SectionManagement(SessionCustom, HttpContext);

            return(this.Json(objSection.GetSection(id), JsonRequestBehavior.AllowGet));
        }
コード例 #6
0
        public JsonResult DeleteSection(int sectionId)
        {
            SectionManagement objSection = new SectionManagement(SessionCustom, HttpContext);

            return(this.Json(new { result = objSection.DeleteSection(sectionId) }));
        }