Exemple #1
0
 public Data searchAll(Data data)
 {
     rating rating = new Rating_db();
     Data db = new Data();
     db.open();
     Data result = db.select(@"SELECT * FROM profile WHERE latitude<@eastLatitude AND latitude>@westLatitude
                             AND longitude<@northLongitude AND longitude>@southLongitude", data);
     result.getString("averageRating", rating.
     db.close();
     return result;
 }
Exemple #2
0
 public bool checkUserRating(Data data)
 {
     Rating_db rating = new Rating_db();
     if (rating.checkUserRating(data).Count > 0)
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Exemple #3
0
 public Double getRatingThree(Data data)
 {
     Rating_db rating = new Rating_db();
     if (Convert.ToInt32(data.getString("totalRating")) > 0)
     {
         return (double)rating.getRatingThree(data).Count / (double)Convert.ToDouble(data.getString("totalRating")) * 100;
     }
     else
     {
         return 0;
     }
 }
Exemple #4
0
 public Double averageRating(Data data)
 {
     Rating_db rating = new Rating_db();
     int total = rating.totalRating(data).Count;
     if (total == 0)
     {
         return 0;
     }
     else
     {
         int value = Convert.ToInt32(data.getString("sum_rating"));
         double average = ((double)value / (double)(total * 5)) * 5;
         return average;
     }
 }
Exemple #5
0
 public bool update(Data data)
 {
     Rating_db rating = new Rating_db();
     return rating.update(data);
 }
Exemple #6
0
 public int numPerRate(Data data, String value)
 {
     Rating_db rating = new Rating_db();
     data.add("value", value);
     return rating.numPerRate(data).Count;
 }
Exemple #7
0
 public bool insert(Data data)
 {
     Rating_db rating = new Rating_db();
     return rating.insert(data);
 }
Exemple #8
0
 public int getTotalRating(Data data)
 {
     Rating_db rating = new Rating_db();
     return rating.getTotalRating(data).Count;
 }