Exemple #1
0
 private void ShowControl(int id)
 {
     ZhuJi.Portal.IDAL.IPlugin  plugin       = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.Portal.NHibernateDAL.Plugin)) as ZhuJi.Portal.IDAL.IPlugin;
     ZhuJi.Portal.Domain.Plugin domainPlugin = plugin.GetObject(id);
     if (domainPlugin != null)
     {
         string configPath          = HttpContext.Current.Server.MapPath(domainPlugin.Configure);
         ZhuJi.Plugins.IAddIn addin = new ZhuJi.Plugins.AddIn();
         addin.Init(configPath);
         Control control = addin.GetControl(domainPlugin.Keyword);
         phContent.Controls.Add(control);
     }
 }
Exemple #2
0
        /// <summary>
        /// 初始化编辑表单
        /// </summary>
        private void Edit()
        {
            btnAdd.Visible  = true;
            btnAdd.Text     = "另存为新记录";
            btnEdit.Visible = true;
            btnDel.Visible  = true;

            try
            {
                ZhuJi.Portal.IDAL.IPlugin  plugin       = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.Portal.NHibernateDAL.Plugin)) as ZhuJi.Portal.IDAL.IPlugin;
                ZhuJi.Portal.Domain.Plugin domainPlugin = plugin.GetObject(_identity);
                UIMapping.BindObjectToControls(domainPlugin, this);

                if (domainPlugin.IsSystem)
                {
                    btnEdit.Enabled = false;
                    btnDel.Enabled  = false;
                }
            }
            catch (Exception ex)
            {
                ShowMessage(ex);
            }
        }