Beispiel #1
0
        public void MenuAdd(MenusModels MData)
        {
            long NewID = GetItem.NewSN();

            MData.ID = NewID;
            MenusDAO.Insert_Single(MData);

            List <CardsTypeModels> CardsType = CardsTypeDAO.GetData();
            CardsTypeModels        CT        = CardsType.FindLast(dr => dr.Code == MData.DataType);

            if (CT.isNeedSN == true)
            {
                //新增
                // PubFunc.AddPage(MData.SiteID, MData.ID, MData.SN, MData.DataType, CT.EditURLAction, false, MData.Title, 1, true);
                PubFunc.AddPage(MData.SiteID, MData.ID, MData.SN, MData.DataType, null, false, MData.Title, 1, true);
            }
            SysLog.SaveLog(SysActions.Add, SysMgrNo.Menu, MData.Title, MData.SiteID, MData.ID, null);
            if (CT != null)
            {
                Response.Redirect(Url.Action(CT.URLAction, "Menus", new { id = NewID, SiteID = MData.SiteID }));
            }
            else
            {
                TempData["refreshData"] = 1;
                Response.Redirect(Request.RawUrl);
            }
        }
Beispiel #2
0
        public ActionResult AddMode(long SiteID, long MenuID, long PageNo, string DataType, string ZoneSN)
        {
            List <CardsTypeModels> CList = CardsTypeDAO.GetData();

            ViewBag.CardsTypeList = CList.Where(dr => dr.isIndexCards).ToList();
            if (string.IsNullOrEmpty(DataType))
            {
                return(new HttpNotFoundResult());
            }
            var selectCardsType = CList.Where(dr => dr.isIndexCards && dr.Code == DataType);

            if (selectCardsType == null || selectCardsType.Count() <= 0)
            {
                return(new HttpNotFoundResult());
            }
            var zoneModels = WorkV3.Models.DataAccess.ZonesDAO.GetPageData(SiteID, PageNo);

            WorkV3.Areas.Backend.Models.ZonesModels zModel = new ZonesModels();
            zModel.No         = WorkLib.GetItem.NewSN();
            zModel.Ver        = 1;
            zModel.SiteID     = SiteID;
            zModel.PageNo     = PageNo;
            zModel.SN         = ZoneSN;
            zModel.Sort       = Convert.ToByte(zoneModels.Count - 1 < 0 ? 1 : zoneModels.Count);
            zModel.StyleID    = 1;
            zModel.Creator    = MemberDAO.SysCurrent.Id;
            zModel.CreateTime = DateTime.Now;
            WorkV3.Areas.Backend.Models.CardsModels cModel = new CardsModels();
            cModel.No     = WorkLib.GetItem.NewSN();
            cModel.Lang   = "zh-Hant";
            cModel.Ver    = 1;
            cModel.ZoneNo = zModel.No;
            cModel.SN     = selectCardsType.First().Code;
            //cModel.Title = ZoneSN;
            cModel.Title      = selectCardsType.First().Title;
            cModel.CardsType  = selectCardsType.First().Code;
            cModel.StylesID   = 1;
            cModel.Status     = 1;
            cModel.Creator    = MemberDAO.SysCurrent.Id;
            cModel.CreateTime = DateTime.Now;
            WorkV3.Areas.Backend.Models.DataAccess.ZonesDAO.SetZoneInfo(zModel);
            WorkV3.Areas.Backend.Models.DataAccess.CardsDAO.SetCardInfo(cModel);


            TempData["refreshData"] = 1;

            ViewBag.SiteID          = SiteID;
            ViewBag.MenuID          = MenuID;
            ViewBag.PageID          = PageNo;
            ViewBag.DefaultZoneName = GetDefaultSN(SiteID, PageNo);
            return(View());
            //Response.Redirect(Request.RawUrl);
        }
Beispiel #3
0
        // GET: BackEnd
        public ActionResult Index(string SiteSN)
        {
            ViewBag.Member    = Session[WebInfo.SysMemSkey] == null ?null:(Request.Cookies["sessionId"] != null? MemberDAO.Current(Request.Cookies["sessionId"].Value): null);
            ViewBag.UploadUrl = uploadUrl;
            if (ViewBag.Member != null)
            {
                WorkV3.Models.SitesModels SiteItem = WorkV3.Models.DataAccess.SitesDAO.GetSiteInfo(SiteSN);
                if (SiteItem != null)
                {
                    MemberModels mem = MemberDAO.SysCurrent;

                    PageCache.SiteID   = SiteItem.Id;
                    PageCache.SiteName = SiteItem.Title;
                    ViewBag.SiteSN     = SiteSN;
                    ViewBag.SiteID     = PageCache.SiteID;
                    ViewBag.SiteName   = PageCache.SiteName;
                    List <MenusModels> mm = MenusDAO.GetData(PageCache.SiteID);

                    long                  siteId      = PageCache.SiteID;
                    List <Menu>           backendMenu = BackendMenuDAO.GetRoots(siteId).ToList();
                    List <CardsViewModel> cards       = CardsDAO.GetBySiteID(PageCache.SiteID);
                    MemberModels          curUser     = ViewBag.Member;
                    GroupModels           group       = ViewBag.Member == null ? new GroupModels() : GroupDAO.GetItem(curUser.GroupId, siteId);

                    ViewBag.MenuList    = mm;
                    ViewBag.Cards       = cards;
                    ViewBag.CardTypes   = CardsTypeDAO.GetData();
                    ViewBag.BackendMenu = backendMenu;
                    ViewBag.Permissions = group.GetPermissions(siteId);
                }
                else
                {
                    Response.Redirect(Url.Action("Sites"));
                }
                return(View());
            }
            else
            {
                Response.Redirect(Url.Action("Login"));
                return(View());
            }
        }
Beispiel #4
0
        public ActionResult MenuAdd()
        {
            ViewBag.SiteID = GetItem.SiteID();
            int AreaID = 1;

            if (uCheck.IsNumeric(Request["AreaID"]))
            {
                AreaID = int.Parse(Request["AreaID"].ToString());
            }
            ViewBag.AreaID = AreaID;


            List <CardsTypeModels> CList = CardsTypeDAO.GetData();

            ViewBag.CardsTypeList   = CList.Where(dr => dr.isOpenCreate == true).ToList();
            ViewBag.CardsTypeListD1 = CList.Where(dr => (dr.Types == (int)CardType.Card || dr.Types == (int)CardType.CardSet) && dr.isOpenCreate == true).ToList();
            ViewBag.CardsTypeListD2 = CList.Where(dr => (dr.Types == (int)CardType.ClassMenu) && dr.isOpenCreate == true).ToList();

            return(View());
        }
Beispiel #5
0
        public ActionResult AddMode(long SiteID, long MenuID, long PageNo)
        {
            ViewBag.SiteID          = SiteID;
            ViewBag.MenuID          = MenuID;
            ViewBag.PageID          = PageNo;
            ViewBag.DefaultZoneName = GetDefaultSN(SiteID, PageNo);

            var siteItem = WorkV3.Models.DataAccess.SitesDAO.GetInfo(SiteID);

            List <CardsTypeModels> CList = CardsTypeDAO.GetData();

            //20190715 Nina 徵才站台只顯示文章集合卡、徵才集合卡、文字卡
            if (siteItem.SN.ToLower() == "career")
            {
                CList = CList.Where(m => m.Code == "ArticleSet" || m.Code == "RecruitSet" || m.Code == "PlainText").ToList();
            }

            ViewBag.CardsTypeList = CList.Where(dr => dr.isIndexCards).ToList();

            return(View());
        }