protected void Eliminate_ParkingSpace_Click(object sender, EventArgs e) { ParkingSpaceTransaction transaction = new ParkingSpaceTransaction(); transaction.deleteLastSpaceinDB(1); showInScreenOnlyExistingSpaces(); }
protected void Page_Load(object sender, EventArgs e) { ParkingSpaceTransaction transaction = new ParkingSpaceTransaction(); List<string> existingSpaces = transaction.PrintExistingSpaces(1); printInScreen(existingSpaces); User user = new User("*****@*****.**"); populateDDLListOfVehicles(user); }
public void showInScreenOnlyExistingSpaces() { ParkingSpaceTransaction transaction = new ParkingSpaceTransaction(); makeAllSpacesInvisible(); List<string> existingSpaces = transaction.PrintExistingSpaces(1); printInScreen(existingSpaces); }
public void markAsOccupiedReservedSpaces(List<string> lstReservedSpaces) { ParkingSpaceTransaction transaction = new ParkingSpaceTransaction(); List<string> existingSpaces = transaction.PrintExistingSpaces(1); List<int> lstIndexes = lstIndexesOfReservedSpaces(existingSpaces, lstReservedSpaces); int spaceNumber = existingSpaces.Count; if (spaceNumber >= 1) { if (isAnOccupiedIndex(1, lstIndexes)) ParkinSpace001.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 2) { if (isAnOccupiedIndex(2, lstIndexes)) ParkinSpace002.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 3) { if (isAnOccupiedIndex(3, lstIndexes)) ParkinSpace003.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 4) { if (isAnOccupiedIndex(4, lstIndexes)) ParkinSpace004.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 5) { if (isAnOccupiedIndex(5, lstIndexes)) ParkinSpace005.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 6) { if (isAnOccupiedIndex(6, lstIndexes)) ParkinSpace006.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 7) { if (isAnOccupiedIndex(7, lstIndexes)) ParkinSpace007.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 8) { if (isAnOccupiedIndex(8, lstIndexes)) ParkinSpace008.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 9) { if (isAnOccupiedIndex(9, lstIndexes)) ParkinSpace009.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 10) { if (isAnOccupiedIndex(10, lstIndexes)) ParkinSpace010.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 11) { if (isAnOccupiedIndex(11, lstIndexes)) ParkinSpace011.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 12) { if (isAnOccupiedIndex(12, lstIndexes)) ParkinSpace012.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 13) { if (isAnOccupiedIndex(13, lstIndexes)) ParkinSpace013.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 14) { if (isAnOccupiedIndex(14, lstIndexes)) ParkinSpace014.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 15) { if (isAnOccupiedIndex(15, lstIndexes)) ParkinSpace015.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 16) { if (isAnOccupiedIndex(16, lstIndexes)) ParkinSpace016.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 17) { if (isAnOccupiedIndex(17, lstIndexes)) ParkinSpace017.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 18) { if (isAnOccupiedIndex(18, lstIndexes)) ParkinSpace018.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 19) { if (isAnOccupiedIndex(19, lstIndexes)) ParkinSpace019.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 20) { if (isAnOccupiedIndex(20, lstIndexes)) ParkinSpace020.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 21) { if (isAnOccupiedIndex(21, lstIndexes)) ParkinSpace021.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 22) { if (isAnOccupiedIndex(22, lstIndexes)) ParkinSpace002.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 23) { if (isAnOccupiedIndex(23, lstIndexes)) ParkinSpace023.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 24) { if (isAnOccupiedIndex(24, lstIndexes)) ParkinSpace024.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 25) { if (isAnOccupiedIndex(25, lstIndexes)) ParkinSpace025.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 26) { if (isAnOccupiedIndex(26, lstIndexes)) ParkinSpace026.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 27) { if (isAnOccupiedIndex(27, lstIndexes)) ParkinSpace027.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 28) { if (isAnOccupiedIndex(28, lstIndexes)) ParkinSpace028.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 29) { if (isAnOccupiedIndex(29, lstIndexes)) ParkinSpace029.ImageUrl = "ocuppiedParkingSpace.jpg"; } if (spaceNumber >= 30) { if (isAnOccupiedIndex(30, lstIndexes)) ParkinSpace030.ImageUrl = "ocuppiedParkingSpace.jpg"; } }
bool isAnExistingName() { bool isExisting = false; ParkingSpaceTransaction transaction = new ParkingSpaceTransaction(); List<string> lstExistingSpaces = transaction.PrintExistingSpaces(1); for (int i = 0; i < lstExistingSpaces.Count; i++) { if (lstExistingSpaces[i] == TextBoxSpaceIdentifier.Text) { isExisting = true; i = lstExistingSpaces.Count; } } return isExisting; }
void insertSpaceInDB() { ParkingSpace newSpace = new ParkingSpace(TextBoxSpaceIdentifier.Text, 1); ParkingSpaceTransaction newSpaceTransaction = new ParkingSpaceTransaction(); newSpaceTransaction.InsertNewParkingSpace(newSpace); ParkingSpaceTransaction transaction = new ParkingSpaceTransaction(); List<string> existingSpaces = transaction.PrintExistingSpaces(1); printInScreen(existingSpaces); }
public List<string> lstReservedSpacesInHour(int idTimeForReservation) { DateTime date = DateTime.Today; ParkingSpaceTransaction transaction = new ParkingSpaceTransaction(); List<string> reservedSpacesPerHour = transaction.GetAllReservedSpacesOnDayAndHour(1, date, idTimeForReservation); return reservedSpacesPerHour; }