コード例 #1
0
        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);
        }
コード例 #2
0
 public void GetLabelSprayQuality(Action <IList <LabelSprayQuality> > action)
 {
     DownloadAndParseJsonData("http://demeter.usask.ca/buffer_zone_multiplier/bufferzone_db_data.php?table=label_spray", jValue =>
     {
         var ret = new List <LabelSprayQuality>();
         foreach (var v in jValue)
         {
             var j    = (JsonValue)v;
             var curr = new LabelSprayQuality()
             {
                 Id   = j["label_sparay_id"],
                 Name = j["label_sparay_name"],
             };
             ret.Add(curr);
         }
         action(ret);
     });
 }