예제 #1
0
        private void EditCase()
        {
            CaseViewModel caseVM = ((CaseViewModel)dgHospitalizations.SelectedItem);

            if (caseVM.IsLocked)
            {
                MessageBox.Show("Either this case or contacts of this case are locked for editing. Please wait until other users have released this lock before proceeding.", "Record locked", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }

            DataHelper.SendMessageForLockCase(caseVM);

            Epi.Enter.EnterUIConfig         uiConfig = Core.Common.GetCaseConfig(DataHelper.CaseForm, DataHelper.LabForm);
            Epi.Windows.Enter.EnterMainForm emf      = new Epi.Windows.Enter.EnterMainForm(DataHelper.Project, DataHelper.CaseForm, uiConfig);

            int uniqueKey = caseVM.UniqueKey;

            emf.LoadRecord(uniqueKey);
            emf.RecordSaved += new SaveRecordEventHandler(emfCases_RecordSaved);
            emf.ShowDialog();
            emf.RecordSaved -= new SaveRecordEventHandler(emfCases_RecordSaved);

            System.Threading.Thread.CurrentThread.CurrentUICulture = System.Threading.Thread.CurrentThread.CurrentCulture;

            DataHelper.SendMessageForUnlockCase(caseVM);
        }
예제 #2
0
 /// <summary>
 /// Constructor for Canvas
 /// </summary>
 public Canvas(MainForm frm)
 {
     config = Configuration.GetNewInstance();
     mainFrm = frm as EnterMainForm;
     InitializeComponent();
     canvasPanel.Dock = DockStyle.None;
     canvasPanel.BorderStyle = BorderStyle.FixedSingle;
     canvasPanel.Visible = false;
     RedrawCanvasBackground();
 }
예제 #3
0
 public void UnSubscribe()
 {
     this.Controls.Clear();
     this.host = null;            
     this.dashboard = null;
     this.host = null;
     this.enterMainForm = null;
     this.currentView = null;
     this.db = null;
     this.loadedRuntimeView = null;
 }
예제 #4
0
        /// <summary>
        /// Disposes of the module's container and components
        /// </summary>
        public void Dispose()
        {
            // trash container and any components
            if (this.container != null)
            {
                this.container.Dispose();
            }

            form = null;

            // base class will finish the job
            //base.Dispose();
        }
예제 #5
0
 public LinkedRecordsViewer(EnterMainForm mainForm)
 {
     InitializeComponent();
     this.enterMainForm = mainForm;
     mainForm.OpenViewEvent += new Epi.Windows.Enter.PresentationLogic.GuiMediator.OpenViewEventHandler(mainForm_OpenViewEvent);
     mainForm.CloseViewEvent += new Epi.Windows.Enter.PresentationLogic.GuiMediator.CloseViewEventHandler(mainForm_CloseViewEvent);
     lvLinkedFrom.DoubleClick += new EventHandler(lvLinkedFrom_DoubleClick);
     lvLinkedTo.DoubleClick += new EventHandler(lvLinkedTo_DoubleClick);
     lvLinkedFrom.SelectedIndexChanged += new EventHandler(lvLinkedFrom_SelectedIndexChanged);
     lvLinkedTo.SelectedIndexChanged += new EventHandler(lvLinkedTo_SelectedIndexChanged);
     lvLinkedTo.ItemMouseHover += new ListViewItemMouseHoverEventHandler(lvLinkedTo_ItemMouseHover);
     lvLinkedFrom.ItemMouseHover += new ListViewItemMouseHoverEventHandler(lvLinkedFrom_ItemMouseHover);
     lvLinkedTo.MouseLeave += new EventHandler(lvLinkedTo_MouseLeave);
     lvLinkedFrom.MouseLeave += new EventHandler(lvLinkedFrom_MouseLeave);
 }
예제 #6
0
        public MapViewer(EnterMainForm enterMainForm)
        {
            InitializeComponent();

            host = new ElementHost();
            host.Dock = DockStyle.Fill;
            this.toolStripContainer1.ContentPanel.Controls.Add(host);

            worker = new BackgroundWorker();
            worker.DoWork += new DoWorkEventHandler(worker_DoWork);
            worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted);
            worker.RunWorkerAsync();

            this.enterMainForm = enterMainForm;
        }
예제 #7
0
        public AnalyticsViewer(EnterMainForm enterMainForm)
        {
            InitializeComponent();

            if (System.Windows.Application.Current == null) new System.Windows.Application();

            host = new ElementHost();
            host.Dock = DockStyle.Fill;
            this.toolStripContainer1.ContentPanel.Controls.Add(host);
            this.enterMainForm = enterMainForm;

            this.toolStripContainer1.TopToolStripPanel.Visible = false;

            this.Shown += new EventHandler(AnalyticsViewer_Shown);
        }
        /// <summary>
        /// Constructor for AutoSearch Results dialog
        /// </summary>
        /// <param name="view">The current view</param>
        /// <param name="mainForm">Enter module's main form</param>
        /// <param name="data">Data table containing auto search results</param>
        public AutoSearchResults(View view, EnterMainForm mainForm, DataTable data, bool showContinueNewMessage = false)
            : base(mainForm)
        {
            #region Input Validation

            if (view == null)
            {
                {
                    throw new ArgumentNullException("view");
                }
            }

            #endregion Input Validation

            InitializeComponent();
            //this.view = view;
            this.mainForm = mainForm;

            // set DataGridView properties
            this.dataGrid1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            this.dataGrid1.AllowUserToAddRows = false;
            this.dataGrid1.AllowUserToDeleteRows = false;
            this.dataGrid1.AllowUserToOrderColumns = false;
            this.dataGrid1.AllowUserToResizeRows = false;
            this.dataGrid1.AllowUserToResizeColumns = true;
            this.dataGrid1.AllowDrop = false;
            this.dataGrid1.MultiSelect = false;

            // add event handlers
            this.dataGrid1.KeyDown += new KeyEventHandler(OnKeyDown);
            this.btnOK.KeyDown += new KeyEventHandler(OnKeyDown);
            this.btnCancel.KeyDown += new KeyEventHandler(OnKeyDown);
            this.KeyDown += new KeyEventHandler(OnKeyDown);
            base.KeyDown += new KeyEventHandler(OnKeyDown);
            this.dataGrid1.SelectionChanged += new EventHandler(dataGrid1_SelectionChanged);

            this.lblOKInstructions.Visible = !showContinueNewMessage;
            this.lblCancelInstructions.Visible = !showContinueNewMessage;
            this.btnCancel.Visible = !showContinueNewMessage;
            if (showContinueNewMessage)
            {
                btnOK.Location = new Point(230, 270);
            }
            this.lblContinueNewMessage.Visible = showContinueNewMessage;
            this.lblContinueNew2.Visible = showContinueNewMessage;

            DisplayResults(data);
        }
        /// <summary>
        /// Constructor for AutoSearch Results dialog
        /// </summary>
        /// <param name="view">The current view</param>
        /// <param name="mainForm">Enter module's main form</param>
        /// <param name="data">Data table containing auto search results</param>
        public AutoSearchResults(View view, EnterMainForm mainForm, DataTable data)
            : base(mainForm)
        {
            #region Input Validation

            if (view == null)
            {
                {
                    throw new ArgumentNullException("view");
                }
            }

            #endregion Input Validation

            InitializeComponent();
            //this.view = view;
            this.mainForm = mainForm;

            // set DataGridView properties
            this.dataGrid1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            this.dataGrid1.AllowUserToAddRows = false;
            this.dataGrid1.AllowUserToDeleteRows = false;
            this.dataGrid1.AllowUserToOrderColumns = false;
            this.dataGrid1.AllowUserToResizeRows = false;
            this.dataGrid1.AllowUserToResizeColumns = true;
            this.dataGrid1.AllowDrop = false;
            this.dataGrid1.MultiSelect = false;

            // add event handlers
            this.dataGrid1.KeyDown += new KeyEventHandler(OnKeyDown);
            this.btnOK.KeyDown += new KeyEventHandler(OnKeyDown);
            this.btnCancel.KeyDown += new KeyEventHandler(OnKeyDown);
            this.KeyDown += new KeyEventHandler(OnKeyDown);
            base.KeyDown += new KeyEventHandler(OnKeyDown);
            this.dataGrid1.SelectionChanged += new EventHandler(dataGrid1_SelectionChanged);

            DisplayResults(data);
        }
예제 #10
0
 public void SetAllReferencesToNull()
 {
     this.form = null;
     this.container = null;
     this.moduleManager = null;
     this.ProjectFilePath = null;
     this.SelectedView = null;
 }
예제 #11
0
        /// <summary>
        /// Attach the current project with module loading
        /// </summary>
        public void Load(IModuleManager moduleManager, ICommandLine commandLine)
        {
            //base.Load(moduleManager, commandLine);
            this.moduleManager = moduleManager;
            try
            {
                if (form == null)
                {
                    form = new EnterMainForm(this);
                    container.Add(form);
                    form.Closed += new EventHandler(MainForm_Closed);
                    form.Disposed += new EventHandler(MainForm_Disposed);
                    form.Show();
                    form.Activate();

                    // assure handle creation
                    System.IntPtr handle = form.Handle;

                    // read the command line
                    if (commandLine != null)
                    {
                        string titleArgument = commandLine.GetArgument("title");
                        if (titleArgument != null)
                        {
                            form.Text = titleArgument;
                        }

                        if (commandLine.GetArgument("project") != null)
                        {
                            Project p = new Project(commandLine.GetArgument("project"));
                            form.FireOpenViewEvent(p.Views[commandLine.GetArgument("view")]);
                        }
                        else
                        {
                            if (!form.IsDisposed)
                            {
                                form.Show();
                                if (form.WindowState == FormWindowState.Minimized)
                                {
                                    form.WindowState = FormWindowState.Normal;
                                }
                                form.Activate();
                            }
                        }
                    }
                    //base.OnLoaded();
                }
                else
                {
                    if (!form.IsDisposed)
                    {
                        form.Show();
                        if (form.WindowState == FormWindowState.Minimized)
                        {
                            form.WindowState = FormWindowState.Normal;
                        }
                        form.Activate();
                    }

                }
            }
            finally
            {
            }

            //Processor.CommunicateUI += new CommunicateUIEventHandler(MsgResponse);
        }