Monitoring Stok

MonitoringStok.java

package com.ipi.myweb.pages.monitoring;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.tapestry5.annotations.Component;
import org.apache.tapestry5.annotations.InjectPage;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.corelib.components.Form;

import com.ipi.myweb.annotation.ProtectedPage;
import com.ipi.myweb.base.BasePage;
import com.ipi.myweb.beans.Buku;
import com.ipi.myweb.beans.MapStok;
import com.ipi.myweb.pages.master.MasterBuku;

@ProtectedPage
public class MonitoringStok extends BasePage {

@InjectPage
private MasterBuku masterBuku;

@InjectPage
private DetailMonStok detail;

@SuppressWarnings("unused")
@Component
private Form form;

@Persist
private String kode;

@Persist
private String judul;

@SuppressWarnings("rawtypes")
@Persist
private Map map;

private MapStok mapstok;

private List listMapStok;

@SuppressWarnings("unchecked")
void onSelectedFromFilter(){
getMap().put("kode", kode);
getMap().put("judul", judul);
setMap(getMap());
}

@SuppressWarnings("rawtypes")
void onSelectedFromReset(){
setMap(new HashMap());
setKode(null);
setJudul(null);
}

Object onActionFromGotoPopupNis(String id_buku){
detail.setIdBuku(id_buku);
return detail;
}

Object onActionFromGotoBuku(String id_buku){
Buku book = getMasterFacade().getBukuDao().findByPrimaryKey(id_buku);
masterBuku.setBook(book);
masterBuku.setIdBuku(id_buku);
return masterBuku;
}

void pageReset(){
onSelectedFromReset();
}

public MapStok getMapstok() {
if (mapstok == null)
mapstok = new MapStok();
return mapstok;
}

public void setMapstok(MapStok mapstok) {
this.mapstok = mapstok;
}

public List getListMapStok() {
if (listMapStok == null){
listMapStok = new ArrayList();
}
listMapStok = getMasterFacade().getPinjamDao().getMonitoringStok(getMap());
return listMapStok;
}

public void setListMapStok(List listMapStok) {
this.listMapStok = listMapStok;
}

@SuppressWarnings("rawtypes")
public Map getMap() {
if (map == null)
map = new HashMap();
return map;
}

@SuppressWarnings("rawtypes")
public void setMap(Map map) {
this.map = map;
}

public String getKode() {
return kode;
}

public void setKode(String kode) {
this.kode = kode;
}

public String getJudul() {
return judul;
}

public void setJudul(String judul) {
this.judul = judul;
}

private int i = 0;
public String getEvenOdd(){
i++;
return i % 2 == 0 ? "odd" : "even";
}

public boolean isZero(){
return true;
}

public Integer getMapStokKeluar(){
return mapstok.getkeluar();
}

}

Published by

saifiahmada

Begin a big Process with a bit trying

One thought on “Monitoring Stok”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s