diff --git a/app/Agri.Models/Farm/NutrientFertilizer.cs b/app/Agri.Models/Farm/NutrientFertilizer.cs index c3e253fe..c3fd22a7 100644 --- a/app/Agri.Models/Farm/NutrientFertilizer.cs +++ b/app/Agri.Models/Farm/NutrientFertilizer.cs @@ -27,6 +27,14 @@ public class NutrientFertilizer public bool isFertigation { get; set; } public decimal injectionRate { get; set; } public int injectionRateUnitId { get; set; } + public decimal tankVolume { get; set; } + public int tankVolumeUnitId { get; set; } + public decimal solInWater { get; set; } + public decimal amountToDissolve { get; set; } + public int dissolveUnitId { get; set; } + public decimal nutrientConcentrationN { get; set; } + public decimal nutrientConcentrationP205 { get; set; } + public decimal nutrientConcentrationK2O { get; set; } public string groupID { get; set; } } } diff --git a/app/Server/src/SERVERAPI/Controllers/NutrientsController.cs b/app/Server/src/SERVERAPI/Controllers/NutrientsController.cs index 6db01b4b..ae29e575 100644 --- a/app/Server/src/SERVERAPI/Controllers/NutrientsController.cs +++ b/app/Server/src/SERVERAPI/Controllers/NutrientsController.cs @@ -257,7 +257,6 @@ public IActionResult ManureDetails(string fldName, int? id) public IActionResult FertigationDetails(string fldName, int? id, string? groupID) { - var thign = ModelState.IsValid; var fgvm = new FertigationDetailsViewModel() { fieldName = fldName, @@ -296,6 +295,15 @@ public IActionResult FertigationDetails(string fldName, int? id, string? groupID fgvm.selFertSchedOption = nf.applMethodId.ToString(); fgvm.injectionRate = nf.injectionRate.ToString("#.##"); fgvm.selInjectionRateUnitOption = nf.injectionRateUnitId.ToString(); + fgvm.tankVolume = nf.tankVolume.ToString("#.##"); + fgvm.selTankVolumeUnitOption = nf.tankVolumeUnitId; + fgvm.solInWater = nf.solInWater.ToString("#.##"); + fgvm.selSolubilityUnitOption = nf.solInWaterUnitId; + fgvm.amountToDissolve = nf.amountToDissolve.ToString("#.##"); + fgvm.selDissolveUnitOption = nf.dissolveUnitId; + fgvm.nutrientConcentrationN = nf.nutrientConcentrationN.ToString("#.##"); + fgvm.nutrientConcentrationP205 = nf.nutrientConcentrationP205.ToString("#.##"); + fgvm.nutrientConcentrationK2O = nf.nutrientConcentrationK2O.ToString("#.##"); if (!ft.Custom && ft.DryLiquid == "liquid") { if (fgvm.density != _fg.GetLiquidFertilizerDensity(nf.fertilizerId, nf.liquidDensityUnitId).Value.ToString("#.##")) @@ -480,7 +488,6 @@ private List GetOptionsList(List selectOption) where T: Se private void FertigationDetailsSetup(ref FertigationDetailsViewModel fgvm) { - //here we will have to add the solid units dropdown fgvm.typOptions = GetOptionsList(_fg.FertilizerTypes); fgvm.fertOptions = GetFertigationFertilizers(fgvm.selTypOption); fgvm.productRateUnitOptions = GetOptionsList(_fg.ProductRateUnits); @@ -1137,6 +1144,15 @@ private List FertigationInsert(FertigationDetailsViewModel fgvm) isFertigation = true, injectionRate = Convert.ToDecimal(fgvm.injectionRate), injectionRateUnitId = Convert.ToInt32(fgvm.selInjectionRateUnitOption), + tankVolume = Convert.ToDecimal(fgvm.tankVolume), + tankVolumeUnitId = Convert.ToInt32(fgvm.selTankVolumeUnitOption), + solInWater = Convert.ToDecimal(fgvm.solInWater), + solInWaterUnitId = Convert.ToInt32(fgvm.selSolubilityUnitOption), + amountToDissolve = Convert.ToDecimal(fgvm.amountToDissolve), + dissolveUnitId = Convert.ToInt32(fgvm.amountToDissolveUnits), + nutrientConcentrationN = Convert.ToDecimal(fgvm.nutrientConcentrationN), + nutrientConcentrationP205 = Convert.ToDecimal(fgvm.nutrientConcentrationP205), + nutrientConcentrationK2O = Convert.ToDecimal(fgvm.nutrientConcentrationK2O), groupID = groupID }; @@ -1215,6 +1231,15 @@ private void FertigationUpdate(FertigationDetailsViewModel fgvm) groupID = fgvm.groupID, injectionRate = Convert.ToDecimal(fgvm.injectionRate), injectionRateUnitId = Convert.ToInt32(fgvm.selInjectionRateUnitOption), + tankVolume = Convert.ToDecimal(fgvm.tankVolume), + tankVolumeUnitId = Convert.ToInt32(fgvm.selTankVolumeUnitOption), + solInWater = Convert.ToDecimal(fgvm.solInWater), + solInWaterUnitId = Convert.ToInt32(fgvm.selSolubilityUnitOption), + amountToDissolve = Convert.ToDecimal(fgvm.amountToDissolve), + dissolveUnitId = Convert.ToInt32(fgvm.amountToDissolveUnits), + nutrientConcentrationN = Convert.ToDecimal(fgvm.nutrientConcentrationN), + nutrientConcentrationP205 = Convert.ToDecimal(fgvm.nutrientConcentrationP205), + nutrientConcentrationK2O = Convert.ToDecimal(fgvm.nutrientConcentrationK2O), isFertigation = true };