Exemplo n.º 1
0
        }//--------------------------

        //this procedure shows the updated form
        private void ShowUpdateEmployeeDialog(String id)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                if (!String.IsNullOrEmpty(id))
                {
                    using (EmployeeUpdate frmUpdate = new EmployeeUpdate(_userInfo,
                                                                         _empManager.GetDetailsEmployeeInformation(_userInfo, id, Application.StartupPath, true), _empManager))
                    {
                        _frmSearch.WindowState = FormWindowState.Minimized;

                        frmUpdate.ShowDialog(this);

                        if (frmUpdate.HasUpdated)
                        {
                            _frmSearch.DataSource = _empManager.GetSelectedEmployeeInformation(_searchFilter);
                        }

                        _frmSearch.WindowState = FormWindowState.Normal;
                    }
                }
            }
            catch (Exception ex)
            {
                RemoteClient.ProcStatic.ShowErrorDialog(ex.Message, "Error Loading Update Employee Module");
            }
            finally
            {
                this.ctlManager.SetFocusOnSearchTextBox();

                this.Cursor = Cursors.Arrow;
            }
        }//-------------------------------
Exemplo n.º 2
0
        }//-------------------------------

        //this procedure shows the updated form
        private void ShowUpdateEmployeeDialog(CommonExchange.Employee empInfo)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                if (empInfo != null)
                {
                    Boolean isForEmployeeUpdate = false;

                    using (EmployeeUpdate frmUpdate = new EmployeeUpdate(_userInfo, empInfo, _empManager))
                    {
                        _frmSearch.WindowState = FormWindowState.Minimized;

                        frmUpdate.ShowDialog(this);

                        if (frmUpdate.HasUpdated)
                        {
                            _frmSearch.DataSource = _empManager.GetSelectedEmployeeInformation(_searchFilter);
                        }
                        else if (frmUpdate.IsForEmployeeUpdate)
                        {
                            isForEmployeeUpdate = true;

                            empInfo = frmUpdate.EmployeeInformation;
                        }

                        _frmSearch.WindowState = FormWindowState.Normal;
                    }

                    if (isForEmployeeUpdate)
                    {
                        this.ShowUpdateEmployeeDialog(empInfo);
                    }
                }
            }
            catch (Exception ex)
            {
                RemoteClient.ProcStatic.ShowErrorDialog(ex.Message, "Error Loading Update Employee Module");
            }
            finally
            {
                this.ctlManager.SetFocusOnSearchTextBox();

                this.Cursor = Cursors.Arrow;
            }
        }//-------------------------------