public bool DeleteListing(int listingID)
 {
     int propID = -1;
     int addID = -1;
     int compID = -1;
     DatabaseManager dbManager = new DatabaseManager();
     var propIDs = dbManager.ReturnQuery("SELECT Property_ID FROM Listing WHERE List_ID = " + listingID);
     foreach (var i in propIDs)
     {
         propID = Convert.ToInt32(i[0]);
     }
     var compIDs = dbManager.ReturnQuery("SELECT Complex_ID FROM Property WHERE Property_ID = " + propID);
     foreach (var i in compIDs)
     {
         compID = Convert.ToInt32(i[0]);
     }
     var addIDs = dbManager.ReturnQuery("SELECT Address_ID FROM Property WHERE Property_ID = " + propID);
     foreach (var i in addIDs)
     {
         addID = Convert.ToInt32(i[0]);
     }
     dbManager.NonReturnQuery("DELETE FROM Image WHERE ( Image.Property_ID = " + propID + ");");
     if (countPropertiesInComplex(compID) == 0 && countPropertiesWithAddress(addID) == 0)
         return (dbManager.NonReturnQuery("DELETE FROM Complex, Address, Property, Listing USING Complex, Address, Property, Listing WHERE ( Complex.Complex_ID = Property.Complex_ID AND Property.Property_ID = Listing.Property_ID AND Property.Address_ID = Address.Address_ID AND Listing.List_ID =" + listingID + ");"));
     else if (countPropertiesInComplex(compID) == 0 && countPropertiesWithAddress(addID) != 0)
         return (dbManager.NonReturnQuery("DELETE FROM Complex, Property, Listing USING Complex, Property, Listing WHERE (Complex.Complex_ID = Property.Complex_ID AND Property.Property_ID = Listing.Property_ID AND Listing.List_ID =" + listingID + ");"));
     else if (countPropertiesInComplex(compID) != 0 && countPropertiesWithAddress(addID) == 0)
         return (dbManager.NonReturnQuery("DELETE FROM Address, Property, Listing USING Address, Property, Listing WHERE ( Property.Property_ID = Listing.Property_ID AND Property.Address_ID = Address.Address_ID AND Listing.List_ID =" + listingID + ");"));
     else
         return (dbManager.NonReturnQuery("DELETE FROM Complex, Address, Property, Listing USING Complex, Address, Property, Listing WHERE ( Complex.Complex_ID = Property.Complex_ID AND Property.Property_ID = Listing.Property_ID AND Property.Address_ID = Address.Address_ID AND Listing.List_ID =" + listingID + ");"));
 }
Beispiel #2
0
        public bool AddListing(int propertyID, int agentID, int listPrice, int isNegotiable, int isSold)
        {
            DatabaseManager dbManager = new DatabaseManager();

            Console.WriteLine("INSERT INTO Listing (Property_ID, Agent_ID, List_Price, List_isNegotiable, List_isSold) VALUES (" + propertyID + "," + agentID + "," + listPrice + "," + isNegotiable + "," + isSold + ");");
            return(dbManager.NonReturnQuery("INSERT INTO Listing (Property_ID, Agent_ID, List_Price, List_isNegotiable, List_isSold VALUES (" + propertyID + "," + agentID + "," + listPrice + "," + isNegotiable + "," + isSold + ");"));
        }
        public bool EditPassword(string email, string newPassword)
        {
            DatabaseManager dbManager = new DatabaseManager();
            Cryptography crypto = new Cryptography();

            return (dbManager.NonReturnQuery("UPDATE Clients set Client_Password = '******' WHERE Client_Email ='" + email + "';"));
        }
Beispiel #4
0
        public bool AddClient(string name, string surname, string phone, string email, string password)
        {
            DatabaseManager dbManager = new DatabaseManager();
            Cryptography    crypto    = new Cryptography();

            return(dbManager.NonReturnQuery("INSERT INTO Clients (Client_Name , Client_Surname, Client_Phone, Client_Email, Client_Password) VALUES ('" + name + "','" + surname + "','" + phone + "','" + email + "','" + Cryptography.CreateHash(password) + "');"));
        }
        public bool EditPassword(string email, string newPassword)
        {
            DatabaseManager dbManager = new DatabaseManager();
            Cryptography crypto = new Cryptography();

            return (dbManager.NonReturnQuery("UPDATE Agent set Agent_Password = '******' WHERE Agent_Email ='" + email + "';"));
        }
        public bool EditPassword(string email, string newPassword)
        {
            DatabaseManager dbManager = new DatabaseManager();
            Cryptography    crypto    = new Cryptography();

            return(dbManager.NonReturnQuery("UPDATE Agent set Agent_Password = '******' WHERE Agent_Email ='" + email + "';"));
        }
        public bool AddClient(string name, string surname, string phone, string email, string password)
        {
            DatabaseManager dbManager = new DatabaseManager();
            Cryptography crypto = new Cryptography();

            return (dbManager.NonReturnQuery("INSERT INTO Clients (Client_Name , Client_Surname, Client_Phone, Client_Email, Client_Password) VALUES ('" + name + "','" + surname + "','" + phone + "','" + email + "','" + crypto.EncryptString(password) + "');"));
        }
        public bool EditPassword(string username, string newPassword)
        {
            DatabaseManager dbManager = new DatabaseManager();
            Cryptography crypto = new Cryptography();

            return (dbManager.NonReturnQuery("UPDATE Admin set Admin_Password = '******' WHERE Admin_Username ='******';"));
        }
        public bool AddAdmin(string username, string password)
        {
            DatabaseManager dbManager = new DatabaseManager();
            Cryptography crypto = new Cryptography();

            return (dbManager.NonReturnQuery("INSERT INTO Admin (Admin_Username , Admin_Password) VALUES ('" + username + "','" + crypto.EncryptString(password) + "');"));
        }
        public bool AddAdmin(string username, string password)
        {
            DatabaseManager dbManager = new DatabaseManager();
            Cryptography    crypto    = new Cryptography();

            return(dbManager.NonReturnQuery("INSERT INTO Admin (Admin_Username , Admin_Password) VALUES ('" + username + "','" + Cryptography.CreateHash(password) + "');"));
        }
        public bool AddCity(string cityName, string provinceName)
        {
            DatabaseManager dbManager = new DatabaseManager();

            //return dbManager.NonReturnQuery("INSERT INTO City (City_Name,City_Province_ID) VALUES ('" + cityName + "',(SELECT Province_ID FROM Province WHERE Province_Name = '" + provinceName + "');");
            return(dbManager.NonReturnQuery("INSERT INTO City (City_Name, City_Province_ID) VALUES ('" + cityName + "'," + ProvinceID(provinceName).ToString() + ");"));
        }
        public bool EditCity(string oldCityName, string oldProvince, string newCityName, string newProvince)
        {
            DatabaseManager dbManager = new DatabaseManager();

//          UPDATE City SET City_Name = 'Pretoria2', City_Province_ID = (SELECT Province_ID FROM Province WHERE Province_Name = 'Mpumalanga') WHERE City_Name = 'Pretoria' AND City_Province_ID = (SELECT Province_ID FROM Province WHERE Province_Name = 'Gauteng');
            return(dbManager.NonReturnQuery("UPDATE City SET City_Name='" + newCityName + "', City_Province_ID = (SELECT Province_ID FROM Province WHERE Province_Name ='" + newProvince + "') WHERE City_Name ='" + oldCityName + "' AND City_Province_ID = (SELECT Province_ID FROM Province WHERE Province_Name = '" + oldProvince + "');"));
        }
        public bool AddAgent(string name, string surname, string phone, string email, string password)
        {
            DatabaseManager dbManager = new DatabaseManager();
            Cryptography    crypto    = new Cryptography();

            return(dbManager.NonReturnQuery("INSERT INTO Agent (Agent_Name , Agent_Surname, Agent_Phone, Agent_Email, Agent_Password) VALUES ('" + name + "','" + surname + "','" + phone + "','" + email + "','" + crypto.EncryptString(password) + "');"));
        }
        public bool EditPassword(string username, string newPassword)
        {
            DatabaseManager dbManager = new DatabaseManager();
            Cryptography    crypto    = new Cryptography();

            return(dbManager.NonReturnQuery("UPDATE Admin set Admin_Password = '******' WHERE Admin_Username ='******';"));
        }
Beispiel #15
0
        public bool EditPassword(string email, string newPassword)
        {
            DatabaseManager dbManager = new DatabaseManager();
            Cryptography    crypto    = new Cryptography();

            return(dbManager.NonReturnQuery("UPDATE Clients set Client_Password = '******' WHERE Client_Email ='" + email + "';"));
        }
        public bool EditArea(string oldAreaName, string newAreaName, string oldCityName, string newCityName, string oldProvinceName, string newProvinceName)
        {
            DatabaseManager dbManger = new DatabaseManager();

            Console.WriteLine(oldAreaName + "," + oldCityName + "," + oldProvinceName + " to " + newAreaName + "," + newCityName + "," + newProvinceName);

            return(dbManger.NonReturnQuery("UPDATE Area SET Area_Name = '" + newAreaName + "' , Area_City_ID = " + CityID(newCityName, ProvinceID(newProvinceName)) + " WHERE Area_Name = '" + oldAreaName + "' AND Area_City_ID = " + CityID(oldCityName, ProvinceID(oldProvinceName)) + ";"));
        }
        public bool AddAgent(string name, string surname, string phone, string email, string password)
        {
            DatabaseManager dbManager = new DatabaseManager();
            Cryptography crypto = new Cryptography();
            MySql.Data.MySqlClient.MySqlCommand com = new MySql.Data.MySqlClient.MySqlCommand();

            return (dbManager.NonReturnQuery("INSERT INTO Agent (Agent_Name , Agent_Surname, Agent_Phone, Agent_Email, Agent_Password) VALUES ('" + name + "','" + surname + "','" + phone + "','" + email + "','" + Cryptography.CreateHash(password).ToString() + "');"));
        }
        public bool AddAgent(string name, string surname, string phone, string email, string password)
        {
            DatabaseManager dbManager = new DatabaseManager();
            Cryptography    crypto    = new Cryptography();

            MySql.Data.MySqlClient.MySqlCommand com = new MySql.Data.MySqlClient.MySqlCommand();

            return(dbManager.NonReturnQuery("INSERT INTO Agent (Agent_Name , Agent_Surname, Agent_Phone, Agent_Email, Agent_Password) VALUES ('" + name + "','" + surname + "','" + phone + "','" + email + "','" + Cryptography.CreateHash(password).ToString() + "');"));
        }
        public bool AddPreferenceArea(int preferenceID, string areaIn)
        {
            string[] area;
            string[] dell = new string[] { ", " };
            area = areaIn.Split(dell, System.StringSplitOptions.None);
            DatabaseManager dbManager  = new DatabaseManager();
            LocationManager locManager = new LocationManager();

            return(dbManager.NonReturnQuery("INSERT INTO Preference_Area (Preference_ID, Area_ID) values (" + preferenceID + "," + locManager.AreaID(locManager.CityID(area[1], locManager.ProvinceID(area[0])), area[2]) + ");"));
        }
        public bool DeletePreferenceArea(int preferenceID, string areaIn)
        {
            string[] area;
            string[] dell = new string[] { ", " };
            area = areaIn.Split(dell, System.StringSplitOptions.None);
            DatabaseManager dbManager  = new DatabaseManager();
            LocationManager locManager = new LocationManager();

            return(dbManager.NonReturnQuery("DELETE FROM Preference_Area WHERE Preference_ID = " + preferenceID + " AND Area_ID = " + locManager.AreaID(locManager.CityID(area[1], locManager.ProvinceID(area[0])), area[2]) + ";"));
        }
        public bool AddPreferenceArea(int preferenceID, string areaIn)
        {
            string[] area;
            string[] dell = new string[] { ", " };
            area = areaIn.Split(dell, System.StringSplitOptions.None);
            DatabaseManager dbManager = new DatabaseManager();
            LocationManager locManager = new LocationManager();

            return (dbManager.NonReturnQuery("INSERT INTO Preference_Area (Preference_ID, Area_ID) values (" + preferenceID + "," + locManager.AreaID(locManager.CityID(area[1], locManager.ProvinceID(area[0])), area[2]) + ");"));
        }
        public bool DeletePreferenceArea(int preferenceID, string areaIn)
        {
            string[] area;
            string[] dell = new string[] { ", " };
            area = areaIn.Split(dell, System.StringSplitOptions.None);
            DatabaseManager dbManager = new DatabaseManager();
            LocationManager locManager = new LocationManager();

            return (dbManager.NonReturnQuery("DELETE FROM Preference_Area WHERE Preference_ID = " + preferenceID + " AND Area_ID = " + locManager.AreaID(locManager.CityID(area[1], locManager.ProvinceID(area[0])), area[2]) + ";"));
        }
Beispiel #23
0
        public bool DeleteListing(int listingID)
        {
            int             propID    = -1;
            int             addID     = -1;
            int             compID    = -1;
            DatabaseManager dbManager = new DatabaseManager();
            var             propIDs   = dbManager.ReturnQuery("SELECT Property_ID FROM Listing WHERE List_ID = " + listingID);

            foreach (var i in propIDs)
            {
                propID = Convert.ToInt32(i[0]);
            }
            var compIDs = dbManager.ReturnQuery("SELECT Complex_ID FROM Property WHERE Property_ID = " + propID);

            foreach (var i in compIDs)
            {
                compID = Convert.ToInt32(i[0]);
            }
            var addIDs = dbManager.ReturnQuery("SELECT Address_ID FROM Property WHERE Property_ID = " + propID);

            foreach (var i in addIDs)
            {
                addID = Convert.ToInt32(i[0]);
            }
            dbManager.NonReturnQuery("DELETE FROM Image WHERE ( Image.Property_ID = " + propID + ");");
            if (countPropertiesInComplex(compID) == 0 && countPropertiesWithAddress(addID) == 0)
            {
                return(dbManager.NonReturnQuery("DELETE FROM Complex, Address, Property, Listing USING Complex, Address, Property, Listing WHERE ( Complex.Complex_ID = Property.Complex_ID AND Property.Property_ID = Listing.Property_ID AND Property.Address_ID = Address.Address_ID AND Listing.List_ID =" + listingID + ");"));
            }
            else if (countPropertiesInComplex(compID) == 0 && countPropertiesWithAddress(addID) != 0)
            {
                return(dbManager.NonReturnQuery("DELETE FROM Complex, Property, Listing USING Complex, Property, Listing WHERE (Complex.Complex_ID = Property.Complex_ID AND Property.Property_ID = Listing.Property_ID AND Listing.List_ID =" + listingID + ");"));
            }
            else if (countPropertiesInComplex(compID) != 0 && countPropertiesWithAddress(addID) == 0)
            {
                return(dbManager.NonReturnQuery("DELETE FROM Address, Property, Listing USING Address, Property, Listing WHERE ( Property.Property_ID = Listing.Property_ID AND Property.Address_ID = Address.Address_ID AND Listing.List_ID =" + listingID + ");"));
            }
            else
            {
                return(dbManager.NonReturnQuery("DELETE FROM Complex, Address, Property, Listing USING Complex, Address, Property, Listing WHERE ( Complex.Complex_ID = Property.Complex_ID AND Property.Property_ID = Listing.Property_ID AND Property.Address_ID = Address.Address_ID AND Listing.List_ID =" + listingID + ");"));
            }
        }
Beispiel #24
0
        public bool AddListingImage(int propertyID, string url, string caption)
        {
            DatabaseManager dbManager = new DatabaseManager();

            return(dbManager.NonReturnQuery("INSERT INTO Image (Property_ID, Image_URL, Image_Caption) values (" + propertyID.ToString() + ",'" + url + "','" + caption + "');"));
        }
Beispiel #25
0
        public bool EditListingAddress(int addressID, int areaID, string streetName, int streetNo)
        {
            DatabaseManager dbManager = new DatabaseManager();

            return(dbManager.NonReturnQuery("UPDATE Address SET Area_ID = " + areaID + ", Address_Streetname = '" + streetName + "', Address_Streetno = " + streetNo + " WHERE Address_ID = " + addressID + ";"));
        }
Beispiel #26
0
        public bool EditListingComplex(int complexID, string complexName, int addressID)
        {
            DatabaseManager dbManager = new DatabaseManager();

            return(dbManager.NonReturnQuery("UPDATE Complex SET Complex_Name = '" + complexName + "', Address_ID = " + addressID + " WHERE Complex_ID = " + complexID + ";"));
        }
        public bool DeletePreference(int preferenceID)
        {
            DatabaseManager dbManager = new DatabaseManager();

            return (dbManager.NonReturnQuery("DELETE FROM Preference WHERE Preference_ID = " + preferenceID + ";"));
        }
        public bool DeleteAdmin(string username)
        {
            DatabaseManager dbManager = new DatabaseManager();

            return(dbManager.NonReturnQuery("DELETE FROM Admin WHERE Admin_Username = '******';"));
        }
 public bool EditListingProperty(int propertyID, int clientID, int addressID, int complexID, int propertyUnitNo, int bedroomCount, int bathroomCount, int garageCount, int hasPool, int plotSize, int houseSize, int propertyValue, string propertyDescription)
 {
     DatabaseManager dbManager = new DatabaseManager();
     return (dbManager.NonReturnQuery("UPDATE Property SET Client_ID = " + clientID + ", Address_ID = " + addressID + ", Complex_ID = " + complexID + ", Property_Unit_No = " + propertyUnitNo + ", Property_Bedroom_Count = " + bedroomCount + ", Property_Bathroom_Count = " + bathroomCount + ", Property_Garage_Count = " + garageCount + ", Property_hasPool = " + hasPool + ", Property_Plot_size = " + plotSize + ", Property_House_Size = " + houseSize + ", Property_Value = " + propertyValue + ", Property_Description = '" + propertyDescription + "' WHERE Property_ID = " + propertyID + ";"));
 }
        public bool EditPreference(int preferenceID, int clientID, int minBedrooms, int maxBedrooms, int minBathrooms, int maxBathrooms, int minGarages, int maxGarages, int minPlotSize, int maxPlotSize, int minHouseSize, int maxHouseSize, int minPrice, int maxPrice, int hasPool)
        {
            DatabaseManager dbManager = new DatabaseManager();

            return(dbManager.NonReturnQuery("UPDATE Preference SET Preference_Min_Bedrooms = " + minBedrooms + ", Preference_Max_Bedrooms = " + maxBedrooms + ", Preference_Min_Bathrooms = " + minBathrooms + ", Preference_Max_Bathrooms = " + maxBathrooms + ", Preference_Min_Garages = " + minGarages + ", Preference_Max_Garages = " + maxGarages + ", Preference_hasPool = " + hasPool + ", Preference_Min_Plot_Size = " + minPlotSize + ", Preference_Max_Plot_Size = " + maxPlotSize + ", Preference_Min_House_Size = " + minHouseSize + ", Preference_Max_House_Size = " + maxHouseSize + ", Preference_Min_Price = " + minPrice + ", Preference_Max_Price = " + maxPrice + " WHERE  (Preference_Client_ID = " + clientID + " AND Preference_ID = " + preferenceID + ");"));
        }
        public bool EditUsername(string oldUsername, string newUsername)
        {
            DatabaseManager dbManager = new DatabaseManager();

            return (dbManager.NonReturnQuery("UPDATE Admin SET Admin_Username ='******' WHERE Admin_Username ='******';"));
        }
        public bool EditPhone(string email, string newPhone)
        {
            DatabaseManager dbManager = new DatabaseManager();

            return (dbManager.NonReturnQuery("UPDATE Clients SET Client_Phone ='" + newPhone + "' WHERE Client_Email ='" + email + "';"));
        }
        public bool EditEmail(string oldEmail, string newEmail)
        {
            DatabaseManager dbManager = new DatabaseManager();

            return (dbManager.NonReturnQuery("UPDATE Clients SET Client_Email ='" + newEmail + "' WHERE Client_Email ='" + oldEmail + "';"));
        }
        public bool DeleteClient(string email)
        {
            DatabaseManager dbManager = new DatabaseManager();

            return (dbManager.NonReturnQuery("DELETE FROM Clients WHERE Client_Email = '" + email + "';"));
        }
Beispiel #35
0
        public bool AddListingComplex(string complexName, int addressID)
        {
            DatabaseManager dbManager = new DatabaseManager();

            return(dbManager.NonReturnQuery("INSERT INTO Complex (Complex_Name, Address_ID) values ('" + complexName + "'," + addressID + ");"));
        }
        public bool EditSurname(string email, string newSurname)
        {
            DatabaseManager dbManager = new DatabaseManager();

            return (dbManager.NonReturnQuery("UPDATE Agent SET Agent_Surname ='" + newSurname + "' WHERE Agent_Email ='" + email + "';"));
        }
        public bool EditPhone(string email, string newPhone)
        {
            DatabaseManager dbManager = new DatabaseManager();

            return(dbManager.NonReturnQuery("UPDATE Agent SET Agent_Phone ='" + newPhone + "' WHERE Agent_Email ='" + email + "';"));
        }
Beispiel #38
0
        public bool EditListingImage(int imageID, string caption)
        {
            DatabaseManager dbManager = new DatabaseManager();

            return(dbManager.NonReturnQuery("UPDATE Image SET Image_Caption = '" + caption + "' WHERE Image_ID = " + imageID + ";"));
        }
        public bool EditEmail(string oldEmail, string newEmail)
        {
            DatabaseManager dbManager = new DatabaseManager();

            return(dbManager.NonReturnQuery("UPDATE Agent SET Agent_Email ='" + newEmail + "' WHERE Agent_Email ='" + oldEmail + "';"));
        }
 public bool EditListingImage(int imageID, string caption)
 {
     DatabaseManager dbManager = new DatabaseManager();
     return (dbManager.NonReturnQuery("UPDATE Image SET Image_Caption = '" + caption + "' WHERE Image_ID = " + imageID + ";"));
 }
        public bool DeleteAdmin(string username)
        {
            DatabaseManager dbManager = new DatabaseManager();

            return (dbManager.NonReturnQuery("DELETE FROM Admin WHERE Admin_Username = '******';"));
        }
 public bool AddListingComplex(string complexName, int addressID)
 {
     DatabaseManager dbManager = new DatabaseManager();
     return (dbManager.NonReturnQuery("INSERT INTO Complex (Complex_Name, Address_ID) values ('" + complexName + "'," + addressID + ");"));
 }
        public bool EditUsername(string oldUsername, string newUsername)
        {
            DatabaseManager dbManager = new DatabaseManager();

            return(dbManager.NonReturnQuery("UPDATE Admin SET Admin_Username ='******' WHERE Admin_Username ='******';"));
        }
 public bool ClearPreferenceArea(int preferenceID)
 {
     DatabaseManager dbManager = new DatabaseManager();
     return (dbManager.NonReturnQuery("DELETE FROM Preference_Area WHERE Preference_ID = " + preferenceID + ";"));
 }
        public bool AddPreference(int clientID, int minBedrooms, int maxBedrooms, int minBathrooms, int maxBathrooms, int minGarages, int maxGarages, int minPlotSize, int maxPlotSize, int minHouseSize, int maxHouseSize, int minPrice, int maxPrice, int hasPool)
        {
            DatabaseManager dbManager = new DatabaseManager();

            return dbManager.NonReturnQuery("INSERT INTO Preference (Preference_Client_ID, Preference_Min_Bedrooms, Preference_Max_Bedrooms, Preference_Min_Bathrooms, Preference_Max_Bathrooms, Preference_Min_Garages, Preference_Max_Garages, Preference_hasPool, Preference_Min_Plot_Size, Preference_Max_Plot_Size, Preference_Min_House_Size, Preference_Max_House_Size, Preference_Min_Price, Preference_Max_Price) VALUES (" + clientID + "," + minBedrooms + "," + maxBedrooms + "," + minBathrooms + "," + maxBathrooms + "," + minGarages + "," + maxGarages + "," + hasPool + "," + minPlotSize + "," + maxPlotSize + "," + minHouseSize + "," + maxHouseSize + "," + minPrice + "," + maxPrice + ");");
        }
 public bool DeleteOffer(int offerID)
 {
     DatabaseManager dbManager = new DatabaseManager();
     return dbManager.NonReturnQuery("DELETE FROM Offer WHERE Offer_ID = " + offerID + ";");
 }
        public bool EditPreference(int preferenceID, int clientID, int minBedrooms, int maxBedrooms, int minBathrooms, int maxBathrooms, int minGarages, int maxGarages, int minPlotSize, int maxPlotSize, int minHouseSize, int maxHouseSize, int minPrice, int maxPrice, int hasPool)
        {
            DatabaseManager dbManager = new DatabaseManager();

            return (dbManager.NonReturnQuery("UPDATE Preference SET Preference_Min_Bedrooms = " + minBedrooms + ", Preference_Max_Bedrooms = " + maxBedrooms + ", Preference_Min_Bathrooms = " + minBathrooms + ", Preference_Max_Bathrooms = " + maxBathrooms + ", Preference_Min_Garages = " + minGarages + ", Preference_Max_Garages = " + maxGarages + ", Preference_hasPool = " + hasPool + ", Preference_Min_Plot_Size = " + minPlotSize + ", Preference_Max_Plot_Size = " + maxPlotSize + ", Preference_Min_House_Size = " + minHouseSize + ", Preference_Max_House_Size = " + maxHouseSize + ", Preference_Min_Price = " + minPrice + ", Preference_Max_Price = " + maxPrice + " WHERE  (Preference_Client_ID = " + clientID + " AND Preference_ID = " + preferenceID + ");"));
        }
        public bool AddPreference(int clientID, int minBedrooms, int maxBedrooms, int minBathrooms, int maxBathrooms, int minGarages, int maxGarages, int minPlotSize, int maxPlotSize, int minHouseSize, int maxHouseSize, int minPrice, int maxPrice, int hasPool)
        {
            DatabaseManager dbManager = new DatabaseManager();

            return(dbManager.NonReturnQuery("INSERT INTO Preference (Preference_Client_ID, Preference_Min_Bedrooms, Preference_Max_Bedrooms, Preference_Min_Bathrooms, Preference_Max_Bathrooms, Preference_Min_Garages, Preference_Max_Garages, Preference_hasPool, Preference_Min_Plot_Size, Preference_Max_Plot_Size, Preference_Min_House_Size, Preference_Max_House_Size, Preference_Min_Price, Preference_Max_Price) VALUES (" + clientID + "," + minBedrooms + "," + maxBedrooms + "," + minBathrooms + "," + maxBathrooms + "," + minGarages + "," + maxGarages + "," + hasPool + "," + minPlotSize + "," + maxPlotSize + "," + minHouseSize + "," + maxHouseSize + "," + minPrice + "," + maxPrice + ");"));
        }
 public bool AddListingImage(int propertyID, string url, string caption)
 {
     DatabaseManager dbManager = new DatabaseManager();
     return (dbManager.NonReturnQuery("INSERT INTO Image (Property_ID, Image_URL, Image_Caption) values (" + propertyID.ToString() + ",'" + url + "','" + caption + "');"));
 }
Beispiel #50
0
        public bool EditListing(int listingID, int propertyID, int agentID, int listPrice, int isNegotiable, int isSold, string listDescription)
        {
            DatabaseManager dbManager = new DatabaseManager();

            return(dbManager.NonReturnQuery("UPDATE Listing SET Property_ID = " + propertyID + ", Agent_ID = " + agentID + ", List_Price = " + listPrice + ", List_isNegotiable = " + isNegotiable + ", List_isSold = " + isSold + ", List_Description = '" + listDescription + "' WHERE List_ID = " + listingID + ";"));
        }
 public bool AddOffer(int listID, int clientID, int offerPrice, int offerStatus, string date)
 {
     DatabaseManager dbManager = new DatabaseManager();
     return dbManager.NonReturnQuery("INSERT INTO Offer (List_ID, Client_ID, Offer_Price, Offer_Status, Offer_Change_Date) VALUES (" + listID + "," + clientID + "," + offerPrice + "," + offerStatus + ",'" + date + "');");
 }
 public bool AddListingProperty(int clientID, int addressID, int complexID, int propertyUnitNo, int bedroomCount, int bathroomCount, int garageCount, int hasPool, int plotSize, int houseSize, int propertyValue)
 {
     DatabaseManager dbManager = new DatabaseManager();
     return (dbManager.NonReturnQuery("INSERT INTO Property (Client_ID, Address_ID, Complex_ID, Property_Unit_No, Property_Bedroom_Count, Property_Bathroom_Count, Property_Garage_Count, Property_hasPool, Property_Plot_size, Property_House_Size, Property_Value) values (" + clientID + "," + addressID + "," + complexID + "," + propertyUnitNo + "," + bedroomCount + "," + bathroomCount + "," + garageCount + "," + hasPool + "," + plotSize + "," + houseSize + "," + propertyValue + ");"));
 }
 public bool EditOffer(int offerID, int listID, int clientID, int offerPrice, int offerStatus, string date)
 {
     DatabaseManager dbManager = new DatabaseManager();
     return dbManager.NonReturnQuery("UPDATE Offer SET List_ID = " + listID + ", Client_ID = " + clientID + ", Offer_Price = " + offerPrice + ", Offer_Status = " + offerStatus + ", Offer_Change_Date = '" + date + "' WHERE Offer_ID = " + offerID + ";");
 }
        public bool DeleteAgent(string email)
        {
            DatabaseManager dbManager = new DatabaseManager();

            return(dbManager.NonReturnQuery("DELETE FROM Agent WHERE Agent_Email = '" + email + "';"));
        }
 public bool AddListing(int propertyID, int agentID, int listPrice, int isNegotiable, int isSold)
 {
     DatabaseManager dbManager = new DatabaseManager();
     Console.WriteLine("INSERT INTO Listing (Property_ID, Agent_ID, List_Price, List_isNegotiable, List_isSold) VALUES (" + propertyID + "," + agentID + "," + listPrice + "," + isNegotiable + "," + isSold + ");");
     return dbManager.NonReturnQuery("INSERT INTO Listing (Property_ID, Agent_ID, List_Price, List_isNegotiable, List_isSold VALUES (" + propertyID + "," + agentID + "," + listPrice + "," + isNegotiable + "," + isSold + ");");
 }
Beispiel #56
0
        public bool EditListingProperty(int propertyID, int clientID, int addressID, int complexID, int propertyUnitNo, int bedroomCount, int bathroomCount, int garageCount, int hasPool, int plotSize, int houseSize, int propertyValue, string propertyDescription)
        {
            DatabaseManager dbManager = new DatabaseManager();

            return(dbManager.NonReturnQuery("UPDATE Property SET Client_ID = " + clientID + ", Address_ID = " + addressID + ", Complex_ID = " + complexID + ", Property_Unit_No = " + propertyUnitNo + ", Property_Bedroom_Count = " + bedroomCount + ", Property_Bathroom_Count = " + bathroomCount + ", Property_Garage_Count = " + garageCount + ", Property_hasPool = " + hasPool + ", Property_Plot_size = " + plotSize + ", Property_House_Size = " + houseSize + ", Property_Value = " + propertyValue + ", Property_Description = '" + propertyDescription + "' WHERE Property_ID = " + propertyID + ";"));
        }
        public bool DeletePreference(int preferenceID)
        {
            DatabaseManager dbManager = new DatabaseManager();

            return(dbManager.NonReturnQuery("DELETE FROM Preference WHERE Preference_ID = " + preferenceID + ";"));
        }
 public bool AddListingAddress(int areaID, string streetName, int streetNo)
 {
     DatabaseManager dbManager = new DatabaseManager();
     return (dbManager.NonReturnQuery("INSERT INTO Address (Area_ID, Address_Streetname, Address_Streetno) values (" + areaID + ",'" + streetName + "'," + streetNo + ");"));
 }
        public bool ClearPreferenceArea(int preferenceID)
        {
            DatabaseManager dbManager = new DatabaseManager();

            return(dbManager.NonReturnQuery("DELETE FROM Preference_Area WHERE Preference_ID = " + preferenceID + ";"));
        }
 public bool EditListingComplex(int complexID, string complexName, int addressID)
 {
     DatabaseManager dbManager = new DatabaseManager();
     return (dbManager.NonReturnQuery("UPDATE Complex SET Complex_Name = '" + complexName + "', Address_ID = " + addressID + " WHERE Complex_ID = " + complexID + ";"));
 }