Exemplo n.º 1
0
        /// <summary>
        /// 初始化添加/编辑表单
        /// </summary>
        public void Initialize()
        {
            btnAdd.Visible  = false;
            btnEdit.Visible = false;
            btnDel.Visible  = false;
            try
            {
                ZhuJi.Portal.IDAL.IChannel          channel = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.Portal.NHibernateDAL.Channel)) as ZhuJi.Portal.IDAL.IChannel;
                IList <ZhuJi.Portal.Domain.Channel> list    = channel.TreeNodes();
                Parent.Items.Clear();
                foreach (ZhuJi.Portal.Domain.Channel domainChannel in list)
                {
                    Parent.Items.Add(new ListItem(domainChannel.Title.PadLeft(domainChannel.Title.Length + domainChannel.Depth, SYMBOLS), domainChannel.Id.ToString()));
                }
                Parent.Items.Insert(0, new ListItem("根目录", "0"));

                ZhuJi.Portal.IDAL.ISite          site     = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.Portal.NHibernateDAL.Site)) as ZhuJi.Portal.IDAL.ISite;
                IList <ZhuJi.Portal.Domain.Site> listSite = site.GetObjects("", "tmp.OrderBy");
                foreach (ZhuJi.Portal.Domain.Site domainSite in listSite)
                {
                    SiteId.Items.Add(new ListItem(domainSite.Title.ToString(), domainSite.Id.ToString()));
                }

                ZhuJi.Portal.IDAL.IContentItem          contentItem     = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.Portal.NHibernateDAL.ContentItem)) as ZhuJi.Portal.IDAL.IContentItem;
                IList <ZhuJi.Portal.Domain.ContentItem> listContentItem = contentItem.GetObjects("", "tmp.OrderBy");
                foreach (ZhuJi.Portal.Domain.ContentItem domainContentItem in listContentItem)
                {
                    ContentItemId.Items.Add(new ListItem(domainContentItem.Name.ToString(), domainContentItem.Id.ToString()));
                }

                ZhuJi.Portal.IDAL.ISkin          skin     = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.Portal.NHibernateDAL.Skin)) as ZhuJi.Portal.IDAL.ISkin;
                IList <ZhuJi.Portal.Domain.Skin> listSkin = skin.GetObjects("", "tmp.OrderBy");
                foreach (ZhuJi.Portal.Domain.Skin domainSkin in listSkin)
                {
                    SkinId.Items.Add(new ListItem(domainSkin.Name.ToString(), domainSkin.Id.ToString()));
                }
            }
            catch (Exception ex)
            {
                ShowMessage(ex);
            }

            switch (_command)
            {
            case "ADD":
                Add();
                break;

            case "EDIT":
                Edit();
                break;
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 初始化查询列表
 /// </summary>
 public void List()
 {
     try
     {
         ZhuJi.Portal.IDAL.IContentItem contentItem = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.Portal.NHibernateDAL.ContentItem)) as ZhuJi.Portal.IDAL.IContentItem;
         rptList.DataSource = contentItem.GetObjects(base.Where, base.OrderNo, base.PageNo, base.PageSize);
         rptList.DataBind();
         if (base.IsShowPager)
         {
             simplePager.Visible     = true;
             simplePager.CurrentPage = base.PageNo;
             simplePager.PageSize    = base.PageSize;
             simplePager.PageUrl     = Request.Url.ToString();
             simplePager.RecordCount = contentItem.GetRowCount;
             simplePager.DataBind();
         }
     }
     catch (Exception ex)
     {
         ShowMessage(ex);
     }
 }