Methods can return void (or nothing). Your current code transcribed to a function might look like this:
@functions{
public static void UpdateProperty(int propertyId, Uri url){
var db = Database.Open("....");
var ImageCount = db.QueryValue("SELECT COUNT (*) FROM Property_Images WHERE PropertyID = @0", propertyId);
var RateCount = db.QueryValue("SELECT COUNT (*) FROM RateInfo WHERE PropertyID = @0", propertyId);
var ExpiryDate = db.QueryValue("SELECT ExpiryDate FROM Property_Info WHERE PropertyID = @0", propertyId);
if(ImageCount > 0 && RateCount > 0 && ExpiryDate > DateTime.Now){
db.Execute("UPDATE Property_Info SET IsActive = 1 WHERE PropertyID = @0", propertyId);
} else {
db.Execute("UPDATE Property_Info SET IsActive = 0 WHERE PropertyID = @0", propertyId);
}
HttpContext.Current.Response.Redirect(url);
}
}
Then you would call it like this:
Is(IsPost){
Functions.UpdateProperty(rPropertyId, Request.RawUrl);
}