Package id.keda87.clickrental.controller

Source Code of id.keda87.clickrental.controller.ControllerSettingHarga

package id.keda87.clickrental.controller;

import id.keda87.clickrental.dao.ConcreteNominalDao;
import id.keda87.clickrental.model.Nominal;
import id.keda87.clickrental.view.sub.SubSettingHarga;
import java.util.List;

public class ControllerSettingHarga {

    private SubSettingHarga sewden;
    private ConcreteNominalDao serviceNominal;
    private List<Nominal> konfigurasiSewaDenda;

    public ControllerSettingHarga(SubSettingHarga sewden) {
        this.sewden = sewden;
        serviceNominal = new ConcreteNominalDao();
        konfigurasiSewaDenda = serviceNominal.getSewaDenda();
    }
   
    public void isiKonfigurasi(){
        konfigurasiSewaDenda = serviceNominal.getSewaDenda();
        for (Nominal sewa_denda : konfigurasiSewaDenda) {
            sewden.getTfDenda().setText(String.valueOf(sewa_denda.getDendaSewa()));
            sewden.getTfSewa().setText(String.valueOf(sewa_denda.getHargaSewa()));
        }
    }
   
    public void update(){
        if(sewden.getKunci().isSelected()){
            Nominal nominal = new Nominal();
            nominal.setDendaSewa(Integer.parseInt(sewden.getTfDenda().getText()));
            nominal.setHargaSewa(Integer.parseInt(sewden.getTfSewa().getText()));
            serviceNominal.updateNominal(nominal);
        }
    }
}
TOP

Related Classes of id.keda87.clickrental.controller.ControllerSettingHarga

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.