private void EditListings() { agentEmail = (this.Tag as AgentWindow).currentAgentName; Classes.ListingManager listManager = new Classes.ListingManager(); if (listManager.GetAddressID(currentAreaID, streetName, streetNo) == -1) { listManager.AddListingAddress(currentAreaID, streetName, streetNo); } else { listManager.EditListingAddress(listManager.GetAddressID(currentAreaID, streetName, streetNo), currentAreaID, streetName, streetNo); } addressID = listManager.GetAddressID(currentAreaID, streetName, streetNo); if (CB_Complex.IsChecked == true) { if (listManager.GetComplexID(complexName, addressID) == -1) { listManager.AddListingComplex(complexName, addressID); } else { listManager.EditListingComplex(listManager.GetComplexID(complexName, addressID), complexName, addressID); } complexID = listManager.GetComplexID(complexName, addressID); } else { complexID = -1; } agentID = listManager.GetAgentID(agentEmail); propertyID = listManager.GetPropertyID(agentID, currentListID); listManager.EditListingProperty(propertyID, currentClientID, addressID, complexID, complexNo, bedrooms, bathrooms, garages, hasPool, plotSize, houseSize, propertyValue, description); listManager.EditListing(currentListID, propertyID, agentID, propertyPrice, isNegotiable, isSold, description); }
private void EditListings() { agentEmail = (this.Tag as AgentWindow).currentAgentName; Classes.ListingManager listManager = new Classes.ListingManager(); if (listManager.GetAddressID(currentAreaID, streetName, streetNo) == -1) listManager.AddListingAddress(currentAreaID, streetName, streetNo); else listManager.EditListingAddress(listManager.GetAddressID(currentAreaID, streetName, streetNo), currentAreaID, streetName, streetNo); addressID = listManager.GetAddressID(currentAreaID, streetName, streetNo); if (CB_Complex.IsChecked == true) { if (listManager.GetComplexID(complexName, addressID) == -1) listManager.AddListingComplex(complexName, addressID); else listManager.EditListingComplex(listManager.GetComplexID(complexName, addressID), complexName, addressID); complexID = listManager.GetComplexID(complexName, addressID); } else complexID = -1; agentID = listManager.GetAgentID(agentEmail); propertyID = listManager.GetPropertyID(agentID, currentListID); listManager.EditListingProperty(propertyID, currentClientID, addressID, complexID, complexNo, bedrooms, bathrooms, garages, hasPool, plotSize, houseSize, propertyValue, description); listManager.EditListing(currentListID, propertyID, agentID, propertyPrice, isNegotiable, isSold, description); }