public static double?GetMultiplierFor(SprayQuality sq, LabelSprayQuality lsq, BoomHeight bh, WindSpeed ws)
        {
            // Work around, use local variable
            var sqId  = sq.Id;
            var lsqId = lsq.Id;
            var bhId  = bh.Id;
            var wsId  = ws.Id;

            var ret = from m in _db.Table <Multiplier>()
                      where m.SprayQualityId == sqId && m.LabelSprayQualityId == lsqId && m.BoomHeightId == bhId && m.WindSpeedId == wsId
                      select m;

            Debug.Assert(ret.Count() == 1);
            var f = ret.FirstOrDefault();

            return(f != null ? f.Value : (double?)null);
        }
Beispiel #2
0
 public void GetSprayQuality(Action <IList <SprayQuality> > action)
 {
     DownloadAndParseJsonData("http://demeter.usask.ca/buffer_zone_multiplier/bufferzone_db_data.php?table=spray_quality", jValue =>
     {
         var ret = new List <SprayQuality>();
         foreach (var v in jValue)
         {
             var j    = (JsonValue)v;
             var curr = new SprayQuality()
             {
                 Id   = j["spray_quality_id"],
                 Name = j["spray_quality_name"],
             };
             ret.Add(curr);
         }
         action(ret);
     });
 }