Exemplo n.º 1
0
        public decimal GetAmmoniaRetention(FarmManure farmManure, int seasonapplicationid)
        {
            AmmoniaRetention myAmmoniaRetention = _sd.GetAmmoniaRetention(seasonapplicationid, farmManure.DMId);

            var ammoniaRention = myAmmoniaRetention.Value ?? 0;

            return(ammoniaRention);
        }
Exemplo n.º 2
0
        public decimal GetAmmoniaRetention(int manureid, int seasonapplicationid)
        {
            decimal ammoniaRention = 0;

            FarmManure myManure = _ud.GetFarmManure(manureid);

            AmmoniaRetention myAmmoniaRetention = _sd.GetAmmoniaRetention(seasonapplicationid, myManure.dmid);

            ammoniaRention = myAmmoniaRetention.value.HasValue ? myAmmoniaRetention.value.Value : 0;

            return(ammoniaRention);
        }
Exemplo n.º 3
0
        public List <AmmoniaRetention> GetAmmoniaRetentions()
        {
            JArray array             = (JArray)rss["agri"]["nmp"]["ammoniaretentions"]["ammoniaretention"];
            var    ammoniaRetentions = new List <AmmoniaRetention>();

            foreach (var r in array)
            {
                var ammoniaRetention = new AmmoniaRetention
                {
                    SeasonApplicationId = Convert.ToInt32(r["seasonapplicatonid"].ToString()),
                    DryMatter           = Convert.ToInt32(r["dm"].ToString()),
                    Value = r["value"].ToString() == "null"
                        ? (decimal?)null
                        : Convert.ToDecimal(r["value"].ToString())
                };
                ammoniaRetentions.Add(ammoniaRetention);
            }

            return(ammoniaRetentions);
        }