Esempio n. 1
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            if (!IsPostBack)
            {
                var relatedFieldId = Body.GetQueryInt("RelatedFieldID");
                var totalLevel     = Body.GetQueryInt("TotalLevel");
                var cols           = "100%";
                if (totalLevel == 2)
                {
                    cols = "50%,50%";
                }
                else if (totalLevel == 3)
                {
                    cols = "33%,33%,33%";
                }
                else if (totalLevel == 4)
                {
                    cols = "25%,25%,25%,25%";
                }
                else if (totalLevel == 5)
                {
                    cols = "20%,20%,20%,20%,20%";
                }
                var builder = new StringBuilder();
                var urlItem = PageRelatedFieldItem.GetRedirectUrl(PublishmentSystemId, relatedFieldId, 1);
                builder.Append($@"
<frameset framespacing=""0"" border=""false"" cols=""{cols}"" frameborder=""0"" scrolling=""yes"">
	<frame name=""level1"" scrolling=""auto"" marginwidth=""0"" marginheight=""0"" src=""{urlItem}"" >
");

                for (var i = 2; i <= totalLevel; i++)
                {
                    builder.Append($@"
<frame name=""level{i}"" scrolling=""auto"" marginwidth=""0"" marginheight=""0"" src=""../pageBlank.html"">
");
                }

                builder.Append("</frameset>");

                ltlFrames.Text = builder.ToString();
            }
        }
Esempio n. 2
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            bool isChanged;

            try
            {
                var itemNameArray = TbItemNames.Text.Split('\n');
                foreach (var item in itemNameArray)
                {
                    if (string.IsNullOrEmpty(item))
                    {
                        continue;
                    }

                    var itemName  = item.Trim();
                    var itemValue = itemName;

                    if (itemName.IndexOf('|') != -1)
                    {
                        itemValue = itemName.Substring(itemName.IndexOf('|') + 1);
                        itemName  = itemName.Substring(0, itemName.IndexOf('|'));
                    }

                    var itemInfo = new RelatedFieldItemInfo(0, _relatedFieldId, itemName, itemValue, _parentId, 0);
                    DataProvider.RelatedFieldItemDao.Insert(itemInfo);
                }

                isChanged = true;
            }
            catch
            {
                isChanged = false;
                FailMessage("添加字段项出错!");
            }

            if (isChanged)
            {
                LayerUtils.CloseAndRedirect(Page, PageRelatedFieldItem.GetRedirectUrl(SiteId, _relatedFieldId, _parentId, _level));
            }
        }
Esempio n. 3
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            bool isChanged;

            try
            {
                var itemInfo = DataProvider.RelatedFieldItemDao.GetRelatedFieldItemInfo(_id);
                itemInfo.ItemName  = ItemName.Text;
                itemInfo.ItemValue = ItemValue.Text;
                DataProvider.RelatedFieldItemDao.Update(itemInfo);

                isChanged = true;
            }
            catch (Exception ex)
            {
                isChanged = false;
                FailMessage(ex, ex.Message);
            }

            if (isChanged)
            {
                PageUtils.CloseModalPageAndRedirect(Page, PageRelatedFieldItem.GetRedirectUrl(PublishmentSystemId, _relatedFieldId, _parentId, _level));
            }
        }