PageRenderTime 21ms CodeModel.GetById 8ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/webccr/src/com/emis/caesar/senao/event/TFocusSaleItemEventContext.java

https://bitbucket.org/sanliou/synccr
Java | 34 lines | 29 code | 3 blank | 2 comment | 4 complexity | ef5d0967fec4fe0c1ce02b90d77a4d18 MD5 | raw file
 1package com.emis.caesar.senao.event;
 2
 3import com.emis.caesar.senao.unit.TCcrConst;
 4import com.emis.caesar.senao.unit.sale.TSaleItem;
 5import com.emis.caesar.senao.util.GenUtil;
 6
 7public class TFocusSaleItemEventContext extends TButtonEventContext {
 8	protected TSaleItem FoFocusItem = null;
 9	public TFocusSaleItemEventContext() {
10		super();
11		FiNextState = TCcrConst.CPS_SALE;
12	}
13	//
14	protected boolean inCcrSate(){
15		int aRunSate [] = {TCcrConst.CPS_SALE ,TCcrConst.CPS_WAIT_PAY};
16		return GenUtil.isIntKeyInArray(aRunSate, FoCcr.getCurrnetState());
17	}
18	//
19	public boolean isItemExisted() {
20		int _iSn = 0;
21		_iSn = FoCcr.getDbData.getCursorSaleItemSn();
22		if (_iSn > 0) {
23			FoFocusItem = FoSale.getSaleItemBySn(_iSn); //假設UI取值不會出錯, 暫不用考量取得NULL(EXCEPTION)
24		}
25		if (FoFocusItem == null) {
26			FsErrMsg = "無法取得指定交易項目, 請通知開發人員";
27			return false;
28		}
29		else {
30			return true;
31		}
32	}
33
34}