Quipex icon

sale

Quipex | PRO | 06/06/17 02:33:37 AM UTC | 0 ⭐ | 403 👁️ | Never ⏰ | []
Java |

1.42 KB

|

None

|

0 👍

/

0 👎

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package classes;
 
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
 
/**
 *
 * @author User
 */
public class Sale {
    private int quantity;
    private String date;
    private double price;
    private String employee;
    
    public Sale(int id_goods, String dateStart, String dateEnd, int index){
        try {
            System.out.println("index="+index);
            quantity = (int) Database.getSaleInfo("sale_goods.quantity", id_goods, dateStart, dateEnd, index);
            date = (String) Database.getSaleInfo("sale.date", id_goods, dateStart, dateEnd, index);
            price = (double) Database.getSaleInfo("sale_goods.price", id_goods, dateStart, dateEnd, index);
            employee = (String) Database.getSaleInfo("employee.fullname", id_goods, dateStart, dateEnd, index);
        } catch (SQLException ex) {
            Logger.getLogger(Sale.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
 
    public int getQuantity() {
        return quantity;
    }
 
    public String getDate() {
        return date;
    }
 
    public double getPrice() {
        return price;
    }
 
    public String getEmployee() {
        return employee;
    }
}

Comments