コード例 #1
0
        private void btnEditUser_Click(object sender, EventArgs e)
        {
            if (gridViewUsers.RowCount < 1)
                return;

            WaitDialog.Show("Loading form.");
            this.SetFocusedViewInstance();
            m_objAddUserForm = new AddUser(AddUser.SaveType.SaveTypeEdit, m_objUser, true) {
                IsNew = false, // since there is no adding of internal user anymore, only editing ...
                UserType = AddUser.eUserType.InternalUser,
                objInternalUserControl = this
            };
            m_objAddUserForm.InitializeModule();

            m_objPopupDialog = new PopupDialog() {
                FormBorderStyle = FormBorderStyle.FixedSingle,
                MinimizeBox = false,
                MaximizeBox = false,
                StartPosition = FormStartPosition.CenterScreen,
                Text = "Manager Application - Users",
                ClientSize = new Size(m_objAddUserForm.Width + 2, m_objAddUserForm.Height + 2)
            };
            m_objPopupDialog.Controls.Add(m_objAddUserForm);

            WaitDialog.Close();
            m_objPopupDialog.ShowDialog(this.ParentForm);
            gridViewUsers.SelectRow("id", m_objAddUserForm.UserId);
        }
コード例 #2
0
        /// <summary>
        /// Initializes the popup dialog for user entry
        /// </summary>
        private void DisplayUserForm(bool IsNew)
        {
            WaitDialog.Show(ParentForm, "Loading components...");
            if (IsNew)
            {
                m_objAddUserForm = new AddUser();
                m_objAddUserForm.IsNew = true;
            }
            else
            {
                m_objAddUserForm = new AddUser(AddUser.SaveType.SaveTypeEdit, m_objUser);
                m_objAddUserForm.IsNew = false;
            }

            m_objAddUserForm.UserType = AddUser.eUserType.CustomerUser;
            m_objAddUserForm.InitializeModule();
            m_objAddUserForm.objCustomerUserControl = this;
            PopupDialog m_objPopupDialog = new PopupDialog();
            m_objPopupDialog.FormBorderStyle = FormBorderStyle.FixedSingle;
            m_objPopupDialog.MinimizeBox = false;
            m_objPopupDialog.MaximizeBox = false;
            m_objPopupDialog.StartPosition = FormStartPosition.CenterScreen;
            m_objPopupDialog.Text = "Manager Application - Users";
            m_objPopupDialog.Controls.Add(m_objAddUserForm);
            m_objPopupDialog.ClientSize = new Size(m_objAddUserForm.Width + 2, m_objAddUserForm.Height + 2);
               WaitDialog.Close();
            m_objPopupDialog.ShowDialog(this.ParentForm);
        }