| | |
| | | } |
| | | public delegate void DelegateGetModel(string guid); |
| | | public delegate void DelegateGetList(int currentPage); |
| | | public delegate void DelegateGetUserControlList(); |
| | | |
| | | /// <summary> |
| | | /// |
| | |
| | | /// <param name="pageBar1"></param> |
| | | /// <param name="action"></param> |
| | | /// <param name="page"></param> |
| | | public static void SetTabParameter(GridView gridView1, DevExpress.XtraTab.XtraTabControl xtraTabControl1, UcPageBar pageBar1, DelegateGetModel action = null, DelegateGetList page = null, Label lbGuid = null) |
| | | public static void SetTabParameter(GridView gridView1, DevExpress.XtraTab.XtraTabControl xtraTabControl1, UcPageBar pageBar1, DelegateGetModel action = null, DelegateGetList page = null, Label lbGuid = null, UcToolBarMenu barMenu = null, DelegateGetUserControlList ucLst = null) |
| | | { |
| | | xtraTabControl1.SelectedPageChanged += (s, e) => |
| | | { |
| | | if (pageBar1 != null && xtraTabControl1.SelectedTabPageIndex == 0) |
| | | { |
| | | if (barMenu != null) |
| | | barMenu.SetAllButton(0); |
| | | |
| | | page(pageBar1.CurrentPage); |
| | | int rowHandle = 0; |
| | | rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], lbGuid.Text); |
| | | if (rowHandle < 0) |
| | | rowHandle = 0; |
| | | gridView1.FocusedRowHandle = rowHandle; |
| | | return; |
| | | } |
| | | |
| | | if (xtraTabControl1.SelectedTabPageIndex == 1) |
| | | { |
| | | int _handle = gridView1.FocusedRowHandle; |
| | |
| | | return; |
| | | } |
| | | action(_guid); |
| | | return; |
| | | } |
| | | if (pageBar1 != null && xtraTabControl1.SelectedTabPageIndex == 0) |
| | | |
| | | if (barMenu != null && xtraTabControl1.SelectedTabPageIndex == 2) |
| | | { |
| | | page(pageBar1.CurrentPage); |
| | | int rowHandle = 0; |
| | | rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], lbGuid.Text); |
| | | if (rowHandle < 0) |
| | | rowHandle = 0; |
| | | gridView1.FocusedRowHandle = rowHandle; |
| | | barMenu.SetAllButton(2); |
| | | ucLst(); |
| | | return; |
| | | } |
| | | }; |
| | | } |