-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathServicio.java
More file actions
65 lines (52 loc) · 1.29 KB
/
Servicio.java
File metadata and controls
65 lines (52 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package logicadenegocios;
import java.text.SimpleDateFormat;
import java.util.*;
public class Servicio {
private static int cantidad=0;
private String ident;
private Date fechaIn;
private String fechaFin;
private int monto;
private String detalle;
private String tipo;
private Empresa empresaAsignada;
public Servicio(String pIdent,int pMonto,String pDetalle,Empresa pEmpresa,String pTipo){
cantidad++;
ident = "ID-SM"+cantidad;
setFechaIn();
monto = pMonto;
tipo=pTipo;
detalle = pDetalle;
empresaAsignada = pEmpresa;
}
public void setFechaIn(){
Calendar calendario = Calendar.getInstance();
fechaIn = calendario.getTime();
}
public void setFechaFin(String pFecha){
fechaFin=pFecha;
}
public String getFechaIn(){
SimpleDateFormat mascara= new SimpleDateFormat("dd/MM/yy");
return mascara.format(fechaIn);
}
public String getFechaFin(){
SimpleDateFormat mascara= new SimpleDateFormat("dd/MM/yy");
return mascara.format(fechaFin);
}
public String getIdentificador(){
return ident;
}
public String getDetalle(){
return detalle;
}
public Empresa getEmpresa(){
return empresaAsignada;
}
public int getMonto(){
return monto;
}
public String getTipo(){
return tipo;
}
}