private void p40RowUpButton_Click(object sender, EventArgs e)
        {
            int index = p4ClauseGridView.FocusedRowHandle;

            if (index <= 0)
            {
                return;
            }

            PhysicalPage3Row row = NewP40Row();

            row.No          = P40Rows[index].No;
            row.Line        = P40Rows[index].Line;
            row.Clause      = P40Rows[index].Clause;
            row.Description = P40Rows[index].Description;
            row.Result      = P40Rows[index].Result;

            p3Bookmark.Get();
            P40Rows.RemoveAt(index);
            P40Rows.Insert(index - 1, row);
            ReorderP40Rows();
            AppHelper.RefreshGridData(p4ClauseGridView);

            p3Bookmark.Goto();
            p4ClauseGridView.MoveBy(-1);

            p4ClauseGridView.Focus();
        }
        private PhysicalPage3Row NewP40Row()
        {
            PhysicalPage3Row row = new PhysicalPage3Row();

            row.No          = 0;
            row.Line        = false;
            row.Clause      = "";
            row.Description = "";
            row.Result      = "";

            return(row);
        }
        private void SetDataSetToPage3()
        {
            p3Desc1Edit.Text = MainSet.P3Description1;

            P3Rows.Clear();
            for (int i = 0; i < P3Set.RowCount; i++)
            {
                P3Set.Fetch(i);

                PhysicalPage3Row p3Row = new PhysicalPage3Row();
                p3Row.No          = P3Set.No;
                p3Row.Line        = P3Set.Line;
                p3Row.Clause      = P3Set.Clause;
                p3Row.Description = P3Set.Description;
                p3Row.Result      = P3Set.Result;
                P3Rows.Add(p3Row);
            }

            p3ClauseNoColumn.SortOrder = ColumnSortOrder.Ascending;
        }
        private void p3RowDownButton_Click(object sender, EventArgs e)
        {
            int index = p3ClauseGridView.FocusedRowHandle;

            if (index >= P3Rows.Count - 1)
            {
                return;
            }

            PhysicalPage3Row row = NewP3Row();

            row.No          = P3Rows[index].No;
            row.Line        = P3Rows[index].Line;
            row.Clause      = P3Rows[index].Clause;
            row.Description = P3Rows[index].Description;
            row.Result      = P3Rows[index].Result;

            p3Bookmark.Get();
            P3Rows.RemoveAt(index);

            if (index < P3Rows.Count - 1)
            {
                P3Rows.Insert(index + 1, row);
            }
            else
            {
                P3Rows.Add(row);
            }

            ReorderP3Rows();
            AppHelper.RefreshGridData(p3ClauseGridView);

            p3Bookmark.Goto();
            p3ClauseGridView.MoveBy(1);

            p3ClauseGrid.Focus();
        }
        private void SetDataSetToPage4()
        {
            p4Desc1Edit.Text = MainSet.P4Description1;
            p4Desc2Edit.Text = MainSet.P4Description2;
            p4Desc3Edit.Text = MainSet.P4Description3;

            P40Rows.Clear();
            for (int i = 0; i < P40Set.RowCount; i++)
            {
                P40Set.Fetch(i);

                PhysicalPage3Row p3Row = new PhysicalPage3Row();
                p3Row.No          = P40Set.No;
                p3Row.Line        = P40Set.Line;
                p3Row.Clause      = P40Set.Clause;
                p3Row.Description = P40Set.Description;
                p3Row.Result      = P40Set.Result;
                P40Rows.Add(p3Row);
            }

            p40NoColumn.SortOrder = ColumnSortOrder.Ascending;

            P41Rows.Clear();
            for (int i = 0; i < P41Set.RowCount; i++)
            {
                P41Set.Fetch(i);

                PhysicalPage4Row p4Row = new PhysicalPage4Row();
                p4Row.No          = P41Set.No;
                p4Row.Line        = P41Set.Line;
                p4Row.Sample      = P41Set.Sample;
                p4Row.BurningRate = P41Set.BurningRate;
                P41Rows.Add(p4Row);
            }

            p41NoColumn.SortOrder = ColumnSortOrder.Ascending;
        }