/// <summary>
        /// EnsurePageForRowIndex method implmentation
        /// </summary>
        private int EnsurePageForRowIndex(int rowindex)
        {
            int idx  = rowindex % MMCService.Paging.PageSize;
            int page = (rowindex / MMCService.Paging.PageSize) + 1;

            if (page != MMCService.Paging.CurrentPage)
            {
                UseWaitCursor = true;
                Cursor        = Cursors.WaitCursor;
                try
                {
                    MMCService.Paging.CurrentPage = page;
                    _lst = MMCService.GetUsers();
                }
                catch (Exception ex)
                {
                    MessageBoxParameters messageBoxParameters = new MessageBoxParameters
                    {
                        Text    = ex.Message,
                        Buttons = MessageBoxButtons.OK,
                        Icon    = MessageBoxIcon.Error
                    };
                    SnapIn.Console.ShowDialog(messageBoxParameters);
                }
                finally
                {
                    UseWaitCursor = false;
                    Cursor        = Cursors.Default;
                }
            }
            return(idx);
        }
Esempio n. 2
0
        /// <summary>
        /// RefreshData method implmentation
        /// </summary>
        public void RefreshData(bool refreshgrid = false, bool clearselection = false)
        {
            this.UseWaitCursor = true;
            this.Cursor        = Cursors.WaitCursor;
            ComponentResourceManager resources = new ComponentResourceManager(typeof(UsersListView));

            this.uPNDataGridViewTextBoxColumn.HeaderText             = resources.GetString("uPNDataGridViewTextBoxColumn.HeaderText");
            this.mailAddressDataGridViewTextBoxColumn.HeaderText     = resources.GetString("mailAddressDataGridViewTextBoxColumn.HeaderText");
            this.phoneNumberDataGridViewTextBoxColumn.HeaderText     = resources.GetString("phoneNumberDataGridViewTextBoxColumn.HeaderText");
            this.preferredMethodDataGridViewTextBoxColumn.HeaderText = resources.GetString("preferredMethodDataGridViewTextBoxColumn.HeaderText");
            this.enabledDataGridViewCheckBoxColumn.HeaderText        = resources.GetString("enabledDataGridViewCheckBoxColumn.HeaderText");
            try
            {
                _lst = MMCService.GetUsers();
                if (clearselection)
                {
                    this.GridView.RowCount = 0;
                }
                this.GridView.RowCount = _lst.Count; // MMCService.GetUsersCount(); ICI
                if (refreshgrid)
                {
                    this.GridView.Refresh();
                }
                if (clearselection)
                {
                    // this.GridView.ClearSelection();
                }
            }
            finally
            {
                this.UseWaitCursor = false;
                this.Cursor        = Cursors.Default;
            }
        }
        /// <summary>
        /// RefreshData method implmentation
        /// </summary>
        public void RefreshData(bool refreshgrid = false, bool clearselection = false)
        {
            this.UseWaitCursor = true;
            this.Cursor        = Cursors.WaitCursor;
            ComponentResourceManager resources = new ComponentResourceManager(typeof(UsersListView));

            this.uPNDataGridViewTextBoxColumn.HeaderText             = resources.GetString("uPNDataGridViewTextBoxColumn.HeaderText");
            this.mailAddressDataGridViewTextBoxColumn.HeaderText     = resources.GetString("mailAddressDataGridViewTextBoxColumn.HeaderText");
            this.phoneNumberDataGridViewTextBoxColumn.HeaderText     = resources.GetString("phoneNumberDataGridViewTextBoxColumn.HeaderText");
            this.preferredMethodDataGridViewTextBoxColumn.HeaderText = resources.GetString("preferredMethodDataGridViewTextBoxColumn.HeaderText");
            this.enabledDataGridViewCheckBoxColumn.HeaderText        = resources.GetString("enabledDataGridViewCheckBoxColumn.HeaderText");
            try
            {
                _lst = MMCService.GetUsers();
                if (clearselection)
                {
                    GridView.RowCount = 0;
                }
                // GridView.RowCount = _lst.Count;
                GridView.RowCount = MMCService.GetUsersCount();
                if (refreshgrid)
                {
                    GridView.Refresh();
                }
                if (clearselection)
                {
                    GridView.ClearSelection();
                }
            }
            catch (Exception ex)
            {
                MessageBoxParameters messageBoxParameters = new MessageBoxParameters
                {
                    Text    = ex.Message,
                    Buttons = MessageBoxButtons.OK,
                    Icon    = MessageBoxIcon.Error
                };
                SnapIn.Console.ShowDialog(messageBoxParameters);
            }
            finally
            {
                UseWaitCursor = false;
                Cursor        = Cursors.Default;
            }
        }
Esempio n. 4
0
        /// <summary>
        /// EnsurePageForRowIndex method implmentation
        /// </summary>
        private int EnsurePageForRowIndex(int rowindex)
        {
            int idx  = rowindex % MMCService.Paging.PageSize;
            int page = (rowindex / MMCService.Paging.PageSize) + 1;

            if (page != MMCService.Paging.CurrentPage)
            {
                this.UseWaitCursor = true;
                this.Cursor        = Cursors.WaitCursor;
                try
                {
                    MMCService.Paging.CurrentPage = page;
                    _lst = MMCService.GetUsers();
                }
                finally
                {
                    this.UseWaitCursor = false;
                    this.Cursor        = Cursors.Default;
                }
            }
            return(idx);
        }