本文整理汇总了C#中RealEstate.Classes.DatabaseManager.NonReturnQuery方法的典型用法代码示例。如果您正苦于以下问题:C# DatabaseManager.NonReturnQuery方法的具体用法?C# DatabaseManager.NonReturnQuery怎么用?C# DatabaseManager.NonReturnQuery使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RealEstate.Classes.DatabaseManager
的用法示例。
在下文中一共展示了DatabaseManager.NonReturnQuery方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteListing
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 + ");"));
}
示例2: EditPassword
public bool EditPassword(string email, string newPassword)
{
DatabaseManager dbManager = new DatabaseManager();
Cryptography crypto = new Cryptography();
return (dbManager.NonReturnQuery("UPDATE Clients set Client_Password = '" + crypto.EncryptString(newPassword) + "' WHERE Client_Email ='" + email + "';"));
}
示例3: EditPassword
public bool EditPassword(string email, string newPassword)
{
DatabaseManager dbManager = new DatabaseManager();
Cryptography crypto = new Cryptography();
return (dbManager.NonReturnQuery("UPDATE Agent set Agent_Password = '" + Cryptography.CreateHash(newPassword) + "' WHERE Agent_Email ='" + email + "';"));
}
示例4: EditPassword
public bool EditPassword(string username, string newPassword)
{
DatabaseManager dbManager = new DatabaseManager();
Cryptography crypto = new Cryptography();
return (dbManager.NonReturnQuery("UPDATE Admin set Admin_Password = '" + crypto.EncryptString(newPassword) + "' WHERE Admin_Username ='" + username + "';"));
}
示例5: AddAdmin
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) + "');"));
}
示例6: AddClient
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) + "');"));
}
示例7: AddAgent
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() + "');"));
}
示例8: DeletePreferenceArea
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]) + ";"));
}
示例9: AddPreferenceArea
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]) + ");"));
}
示例10: AddListingImage
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 + "');"));
}
示例11: AddListingComplex
public bool AddListingComplex(string complexName, int addressID)
{
DatabaseManager dbManager = new DatabaseManager();
return (dbManager.NonReturnQuery("INSERT INTO Complex (Complex_Name, Address_ID) values ('" + complexName + "'," + addressID + ");"));
}
示例12: AddListingAddress
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 + ");"));
}
示例13: EditListingProperty
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 + ";"));
}
示例14: DeleteOffer
public bool DeleteOffer(int offerID)
{
DatabaseManager dbManager = new DatabaseManager();
return dbManager.NonReturnQuery("DELETE FROM Offer WHERE Offer_ID = " + offerID + ";");
}
示例15: ClearPreferenceArea
public bool ClearPreferenceArea(int preferenceID)
{
DatabaseManager dbManager = new DatabaseManager();
return (dbManager.NonReturnQuery("DELETE FROM Preference_Area WHERE Preference_ID = " + preferenceID + ";"));
}