Пример #1
0
        protected override void LoadSettingsFromEvent(IEvent ev)
        {
            int? visitId = ev.UniqueId.KeyValue as int?;

            if (visitId != null)
            {
                ucDefineVisit=new UCDefineVisit(visitId.Value);
                ucDefineVisit.Dock = DockStyle.Fill;
                this.Controls.Add(ucDefineVisit);
                ucDefineVisit.Disposed += (x, y) => this.Close();
                this.FormClosed += (x, y) =>
                {
                    ucDefineVisit.Dispose();
                    OnVisitContextSaved();
                };
            }
            else
            {
                ucDefineVisit = new UCDefineVisit();
                ucDefineVisit.Dock = DockStyle.Fill;
                this.Controls.Add(ucDefineVisit);

                ucDefineVisit.Disposed += (x, y) => this.Close();
                this.FormClosed += (x, y) =>
                {
                    ucDefineVisit.Dispose();
                    OnVisitContextSaved();
                };
                base.LoadSettingsFromEvent(ev);
            }
        }
Пример #2
0
        public FormDefineVisit(int visitId)
        {
            InitializeComponent();

            Methods.SetWindowsIcon(this);

            ucDefineVisit = new UCDefineVisit(visitId);
            ucDefineVisit.Dock = DockStyle.Fill;
            this.Controls.Add(ucDefineVisit);
            ucDefineVisit.Disposed += (x, y) => { this.Close(); OnVisitContextSaved(); };
        }