Advertisement
JakeFromNotStateFarm

Untitled

Dec 12th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.97 KB | None | 0 0
  1. /*This class is utilized in the addition and soon the deletion of machines from the database.
  2. *
  3. */
  4. package itinventory;
  5.  
  6. import javax.swing.JOptionPane;
  7.  
  8. /**
  9.  *
  10.  * @author jacobit
  11.  */
  12. public class InsertAndDelete {
  13.    
  14.     public String SerialNumber;
  15.     public String NameOfMachine;
  16.     public int TypeOfDevice;
  17.     public String DeviceLocation;
  18.     public String IPAddress;
  19.    
  20.    
  21.     public void initialize(int DeviceType,String Serial,String Name, String Location, String IP){
  22.         SerialNumber = Serial;
  23.         NameOfMachine = Name;
  24.         TypeOfDevice = DeviceType;
  25.         DeviceLocation = Location;
  26.         IPAddress = IP;
  27.     }
  28.     public String getSerial(){
  29.         return SerialNumber;
  30.     }
  31.     public String getName(){
  32.         return NameOfMachine;
  33.     }
  34.     public String getDeviceLocation(){
  35.         return DeviceLocation;
  36.     }
  37.     public String getIP(){
  38.         return IPAddress;
  39.     }
  40.     public int getDeviceType(){
  41.         return TypeOfDevice;
  42.     }
  43.    
  44.     public void setSerial(String Serial){
  45.         while(Serial.length()>45){
  46.             Serial = JOptionPane.showInputDialog("That Serial is too long. Please try again.");
  47.         }
  48.         SerialNumber = Serial;
  49.     }
  50.     public void setName(String Name){
  51.         while(Name.length()>45){
  52.             Name = JOptionPane.showInputDialog("That device name is too long. Please try again.");
  53.         }
  54.         NameOfMachine = Name;
  55.     }
  56.     public void setLocation(String Location){
  57.         while(Location.length()>45){
  58.             Location = JOptionPane.showInputDialog("That device location is too long. Please try again.");
  59.         }
  60.         DeviceLocation = Location;
  61.     }
  62.     public void setIP(String IP){
  63.         while(IP.length()>15){
  64.             IP = JOptionPane.showInputDialog("That device IP is too long. Please try again.");
  65.         }
  66.         IPAddress = IP;
  67.     }
  68.     public void setDeviceType(int DeviceType){
  69.         TypeOfDevice = DeviceType;
  70.     }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement