internal static IArhiveOperationMasterForm CreateAttachmentWindow(MyChildForm masterForm, WindowInfo masterWindowInfo)
        {
            WindowInfo windowInfo = ADInfoBll.Instance.GetWindowInfo("SD_Attachment");

            MyForm form = null;

            if (windowInfo != null && !string.IsNullOrEmpty(masterWindowInfo.AttachmentId))
            {
                form = ServiceProvider.GetService <IWindowFactory>().CreateWindow(windowInfo) as MyForm;
                masterForm.SetCustomProperty("AttachmentEntityIdExp", masterWindowInfo.AttachmentId);

                if (form != null)
                {
                    form.FormClosing += new FormClosingEventHandler(delegate(object sender1, FormClosingEventArgs e1)
                    {
                        e1.Cancel    = true;
                        form.Visible = false;
                    });
                }
                //if (form != null)
                //{
                //form.Text = masterForm.Text + "的附件";
                //form.Show();
                //form.DisplayManager.SearchManager.LoadData(SearchExpression.And(
                //    SearchExpression.Eq("EntityName", entityName), SearchExpression.Eq("EntityId", entityId)), null);
                //(form.ControlManager.Dao as BaseDao<AttachmentInfo>).EntityOperating += new EventHandler<OperateArgs<AttachmentInfo>>(delegate(object sender1, OperateArgs<AttachmentInfo> e1)
                //{
                //    e1.Entity.EntityName = entityName;
                //    e1.Entity.EntityId = entityId;
                //});
                //}
            }
            return(form as IArhiveOperationMasterForm);
        }
Beispiel #2
0
        private void TryAddButtons(MyButton btn, MyChildForm menuWindow)
        {
            IList <IButton> tsbs = menuWindow.GetCustomProperty(MenuWindowExtention.s_windowMenuButtonName) as IList <IButton>;

            if (tsbs == null)
            {
                tsbs = new List <IButton>();
                menuWindow.SetCustomProperty(MenuWindowExtention.s_windowMenuButtonName, tsbs);
            }
            tsbs.Add(btn);
        }
        internal static IArhiveOperationMasterForm CreateAttachmentWindow(MyChildForm masterForm, WindowInfo masterWindowInfo)
        {
            WindowInfo windowInfo = ADInfoBll.Instance.GetWindowInfo("SD_Attachment");

            MyForm form = null;
            if (windowInfo != null && !string.IsNullOrEmpty(masterWindowInfo.AttachmentId))
            {
                form = ServiceProvider.GetService<IWindowFactory>().CreateWindow(windowInfo) as MyForm;
                masterForm.SetCustomProperty("AttachmentEntityIdExp", masterWindowInfo.AttachmentId);

                if (form != null)
                {
                    form.FormClosing += new FormClosingEventHandler(delegate(object sender1, FormClosingEventArgs e1)
                    {
                        e1.Cancel = true;
                        form.Visible = false;
                    });
                }
                //if (form != null)
                //{
                    //form.Text = masterForm.Text + "的附件";
                    //form.Show();
                    //form.DisplayManager.SearchManager.LoadData(SearchExpression.And(
                    //    SearchExpression.Eq("EntityName", entityName), SearchExpression.Eq("EntityId", entityId)), null);
                    //(form.ControlManager.Dao as BaseDao<AttachmentInfo>).EntityOperating += new EventHandler<OperateArgs<AttachmentInfo>>(delegate(object sender1, OperateArgs<AttachmentInfo> e1)
                    //{
                    //    e1.Entity.EntityName = entityName;
                    //    e1.Entity.EntityId = entityId;
                    //});
                //}
            }
            return form as IArhiveOperationMasterForm;
        }
 private void TryAddButtons(MyButton btn, MyChildForm menuWindow)
 {
     IList<IButton> tsbs = menuWindow.GetCustomProperty(MenuWindowExtention.s_windowMenuButtonName) as IList<IButton>;
     if (tsbs == null)
     {
         tsbs = new List<IButton>();
         menuWindow.SetCustomProperty(MenuWindowExtention.s_windowMenuButtonName, tsbs);
     }
     tsbs.Add(btn);
 }