Example #1
0
        void viewUser()
        {
            try
            {
                if (addUserPane != null && addUserPane.IsDirty)
                {
                    DialogResult result = MessageBox.Show("There are seems unsaved work.. Are you sure you want to continue?",
                                                          "You are going to leave unsave work", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

                    if (result == DialogResult.No)
                    {
                        return;
                    }
                    else
                    {
                        addUserPane.clearTextboxes();
                    }
                }

                if (mode != UserAdminMode.View_user)
                {
                    userView = new UserView(userPanel, masterController);
                    mode     = UserAdminMode.View_user;
                    flipColors();
                }

                lbUsers.Focus();
                selectedEmployee = userEmployeeMap[lbUsers.SelectedItem.ToString()];
                userView.showUser(selectedEmployee);
            }
            catch (NullReferenceException)
            {
                if (lbUsers.SelectedItem == null)
                {
                    MessageBox.Show("No selected user.. ");
                }
            }
        }
        void viewUser()
        {
            try
                {
                    if (addUserPane != null && addUserPane.IsDirty)
                    {
                        DialogResult result = MessageBox.Show("There are seems unsaved work.. Are you sure you want to continue?",
                                                                "You are going to leave unsave work", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

                        if (result == DialogResult.No)
                            return;
                        else
                            addUserPane.clearTextboxes();
                    }

                    if (mode != UserAdminMode.View_user)
                    {
                        userView = new UserView(userPanel, masterController);
                        mode = UserAdminMode.View_user;
                        flipColors();
                    }

                    lbUsers.Focus();
                    selectedEmployee = userEmployeeMap[lbUsers.SelectedItem.ToString()];
                    userView.showUser(selectedEmployee);
                }
                catch (NullReferenceException)
                {
                    if (lbUsers.SelectedItem == null)
                        MessageBox.Show("No selected user.. ");
                }
        }