Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*This class is utilized in the addition and soon the deletion of machines from the database.
- *
- */
- package itinventory;
- import javax.swing.JOptionPane;
- /**
- *
- * @author jacobit
- */
- public class InsertAndDelete {
- public String SerialNumber;
- public String NameOfMachine;
- public int TypeOfDevice;
- public String DeviceLocation;
- public String IPAddress;
- public void initialize(int DeviceType,String Serial,String Name, String Location, String IP){
- SerialNumber = Serial;
- NameOfMachine = Name;
- TypeOfDevice = DeviceType;
- DeviceLocation = Location;
- IPAddress = IP;
- }
- public String getSerial(){
- return SerialNumber;
- }
- public String getName(){
- return NameOfMachine;
- }
- public String getDeviceLocation(){
- return DeviceLocation;
- }
- public String getIP(){
- return IPAddress;
- }
- public int getDeviceType(){
- return TypeOfDevice;
- }
- public void setSerial(String Serial){
- while(Serial.length()>45){
- Serial = JOptionPane.showInputDialog("That Serial is too long. Please try again.");
- }
- SerialNumber = Serial;
- }
- public void setName(String Name){
- while(Name.length()>45){
- Name = JOptionPane.showInputDialog("That device name is too long. Please try again.");
- }
- NameOfMachine = Name;
- }
- public void setLocation(String Location){
- while(Location.length()>45){
- Location = JOptionPane.showInputDialog("That device location is too long. Please try again.");
- }
- DeviceLocation = Location;
- }
- public void setIP(String IP){
- while(IP.length()>15){
- IP = JOptionPane.showInputDialog("That device IP is too long. Please try again.");
- }
- IPAddress = IP;
- }
- public void setDeviceType(int DeviceType){
- TypeOfDevice = DeviceType;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement