169 lines
3.9 KiB
Java
169 lines
3.9 KiB
Java
package com.utopiaindustries.qualitycontrol.utils;
|
|
|
|
import androidx.lifecycle.ViewModel;
|
|
|
|
import com.utopiaindustries.qualitycontrol.models.Department;
|
|
import com.utopiaindustries.qualitycontrol.models.LocationFloor;
|
|
import com.utopiaindustries.qualitycontrol.models.LocationSite;
|
|
import com.utopiaindustries.qualitycontrol.models.LocationUnit;
|
|
import com.utopiaindustries.qualitycontrol.viewmodels.ItemModel;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
public class QualityControlViewModel extends ViewModel {
|
|
|
|
private String currentDate;
|
|
private int siteId;
|
|
private int unitId;
|
|
private int departmentId;
|
|
private int floorId;
|
|
private List<ItemModel> qualityControlItemList;
|
|
|
|
private List<LocationSite> locationSiteList;
|
|
private List<Department> departmentList;
|
|
private List<LocationFloor> floorList;
|
|
private List<LocationUnit> unitList;
|
|
|
|
private boolean fromViewModel;
|
|
private String location;
|
|
private String department;
|
|
private String unit;
|
|
private String floor;
|
|
|
|
public String getLocation() {
|
|
return location;
|
|
}
|
|
|
|
public void setLocation(String location) {
|
|
this.location = location;
|
|
}
|
|
|
|
public String getDepartment() {
|
|
return department;
|
|
}
|
|
|
|
public void setDepartment(String department) {
|
|
this.department = department;
|
|
}
|
|
|
|
public String getUnit() {
|
|
return unit;
|
|
}
|
|
|
|
public void setUnit(String unit) {
|
|
this.unit = unit;
|
|
}
|
|
|
|
public String getFloor() {
|
|
return floor;
|
|
}
|
|
|
|
public void setFloor(String floor) {
|
|
this.floor = floor;
|
|
}
|
|
|
|
public boolean isFromViewModel() {
|
|
return fromViewModel;
|
|
}
|
|
|
|
public void setFromViewModel(boolean fromViewModel) {
|
|
this.fromViewModel = fromViewModel;
|
|
}
|
|
|
|
|
|
|
|
public QualityControlViewModel() {
|
|
// Initialize the list to avoid NullPointerException
|
|
qualityControlItemList = new ArrayList<>();
|
|
locationSiteList = new ArrayList<>();
|
|
}
|
|
|
|
public String getCurrentDate() {
|
|
return currentDate;
|
|
}
|
|
|
|
public void setCurrentDate(String currentDate) {
|
|
this.currentDate = currentDate;
|
|
}
|
|
|
|
public int getSiteId() {
|
|
return siteId;
|
|
}
|
|
|
|
public void setSiteId(int siteId) {
|
|
this.siteId = siteId;
|
|
}
|
|
|
|
public int getUnitId() {
|
|
return unitId;
|
|
}
|
|
|
|
public void setUnitId(int unitId) {
|
|
this.unitId = unitId;
|
|
}
|
|
|
|
public int getDepartmentId() {
|
|
return departmentId;
|
|
}
|
|
|
|
public void setDepartmentId(int departmentId) {
|
|
this.departmentId = departmentId;
|
|
}
|
|
|
|
public int getFloorId() {
|
|
return floorId;
|
|
}
|
|
|
|
public void setFloorId(int floorId) {
|
|
this.floorId = floorId;
|
|
}
|
|
|
|
public List<ItemModel> getQualityControlItemList() {
|
|
return qualityControlItemList;
|
|
}
|
|
|
|
/*public void setQualityControlItemList(List<ItemModel> qualityControlItemList) {
|
|
this.qualityControlItemList = qualityControlItemList;
|
|
}*/
|
|
|
|
// Method to append data to the list
|
|
public void appendToQualityControlItemList(List<ItemModel> items) {
|
|
if (items != null) {
|
|
qualityControlItemList.addAll(items);
|
|
}
|
|
}
|
|
|
|
public List<LocationSite> getLocationSiteList() {
|
|
return locationSiteList;
|
|
}
|
|
|
|
public void setLocationSiteList(List<LocationSite> locationSiteList) {
|
|
this.locationSiteList = locationSiteList;
|
|
}
|
|
|
|
public List<Department> getDepartmentList() {
|
|
return departmentList;
|
|
}
|
|
|
|
public void setDepartmentList(List<Department> departmentList) {
|
|
this.departmentList = departmentList;
|
|
}
|
|
|
|
public List<LocationFloor> getFloorList() {
|
|
return floorList;
|
|
}
|
|
|
|
public void setFloorList(List<LocationFloor> floorList) {
|
|
this.floorList = floorList;
|
|
}
|
|
|
|
public List<LocationUnit> getUnitList() {
|
|
return unitList;
|
|
}
|
|
|
|
public void setUnitList(List<LocationUnit> unitList) {
|
|
this.unitList = unitList;
|
|
}
|
|
}
|