package baseclass;

import p2.util.P2Exception;
import p2.webclient.system.beans.GridBean;
import p2.webclient.system.controller.Utility;
import p2.webclient.system.controller.WebClientEvent;

public class GridBeanCust extends GridBean {
	@Override
	public synchronized void selectAll() throws P2Exception {
		super.selectAll();
//		if (count() <= 100) {
//			super.selectAll();
//		} else {
//			int StartIndex = this.getPageStartIndex();// 开始行
//			boolean iselect = !this.isSelected(StartIndex);
//			int EndIndex = this.getPageRowCount();// 结束行
//			if (iselect) {
//				this.select(StartIndex, EndIndex);
//			} else {
//				this.unselect(StartIndex, EndIndex);
//			}
//			this.refreshTable();
//			sessionContext.queueRefreshEvent();
//		}
	}

	@Override
	public synchronized void unselectAll() throws P2Exception {
		super.unselectAll();
//		if (count() <= 100) {
//			super.unselectAll();
//		} else {
//			int StartIndex = this.getPageStartIndex();// 开始行
//			boolean iselect = !this.isSelected(StartIndex);
//			int EndIndex = this.getPageRowCount();// 结束行
//			if (iselect) {
//				this.select(StartIndex, EndIndex);
//			} else {
//				this.unselect(StartIndex, EndIndex);
//			}
//			this.refreshTable();
//			sessionContext.queueRefreshEvent();
//		}
	}

	public void closeApp(String closeApp) throws P2Exception {
		Utility.sendEvent(new WebClientEvent("closeappwin", app.getApp().toLowerCase(),
				closeApp, "", "", 0, sessionContext));
	}

	public void openApp(String openApp, long fbillid) throws P2Exception {
		closeApp(openApp);
		Utility.sendEvent(new WebClientEvent("opennewapp", app.getApp().toLowerCase(),
				openApp, "", "", fbillid, sessionContext));
	}

}
