//int cropYearIndex = -1; //public int CropYear //{ // get { return cropYearIndex; } // set { SetProperty(ref cropYearIndex, value); } //} //string crop = string.Empty; //public string Crop //{ // get { return crop; } // set { SetProperty(ref crop, value); } //} //string grainHeight = string.Empty; //public string GrainHeight //{ // get { return grainHeight; } // set { SetProperty(ref grainHeight, value); } //} //string grainHopperHeight = string.Empty; //public string GrainHopperHeight //{ // get { return grainHopperHeight; } // set { SetProperty(ref grainHopperHeight, value); } //} //string grainConeHeight = string.Empty; //public string GrainConeHeight //{ // get { return grainConeHeight; } // set { SetProperty(ref grainConeHeight, value); } //} //string moisturePercent = string.Empty; //public string MoisturePercent //{ // get { return moisturePercent; } // set { SetProperty(ref moisturePercent, value); } //} //string moistureFactor = string.Empty; //public string MoistureFactor //{ // get { return moistureFactor; } // set { SetProperty(ref moistureFactor, value); } //} //string testWeight = string.Empty; //public string TestWeight //{ // get { return testWeight; } // set { SetProperty(ref testWeight, value); } //} //string packFactor = string.Empty; //public string PackFactor //{ // get { return packFactor; } // set { SetProperty(ref packFactor, value); } //} //string dockagePercent = string.Empty; //public string DockagePercent //{ // get { return dockagePercent; } // set { SetProperty(ref dockagePercent, value); } //} //string dockageFactor = string.Empty; //public string DockageFactor //{ // get { return dockageFactor; } // set { SetProperty(ref dockageFactor, value); } //} //int conversionFactorIndex = -1; //public int ConversionFactor //{ // get { return conversionFactorIndex; } // set { SetProperty(ref conversionFactorIndex, value); } //} //string shellFactor = string.Empty; //public string ShellFactor //{ // get { return shellFactor; } // set { SetProperty(ref shellFactor, value); } //} //string totalDeductionVolume = string.Empty; //public string TotalDeductionVolume //{ // get { return totalDeductionVolume; } // set { SetProperty(ref totalDeductionVolume, value); } //} //string contentsNotes = string.Empty; //public string ContentsNotes //{ // get { return contentsNotes; } // set { SetProperty(ref contentsNotes, value); } //} //string grainVolume = string.Empty; //public string GrainVolume //{ // get { return grainVolume; } // set { SetProperty(ref grainVolume, value); } //} #endregion #endregion #region Constructors public BinViewModel() { Title = "New Bin"; Binstance = new Binstance(); YTYData = new YTYData(); //var test = dateRange; //DateRange = dateRange; New = true; Edit = false; }
public static YTYData MapViewModelToYTY(this BinViewModel inViewModel) { YTYData yty = new YTYData(); //yty.Crop = inViewModel.Crop; //yty.CropYear = inViewModel.CropYear; //double d; //yty.GrainHeight = double.TryParse(inViewModel.GrainHeight, out d) ? d : 0; //yty.GrainHopperHeight = double.TryParse(inViewModel.GrainHopperHeight, out d) ? d : 0; //yty.ConeHeight = double.TryParse(inViewModel.GrainConeHeight, out d) ? d : 0; //yty.MoistureOfGrain = double.TryParse(inViewModel.MoisturePercent, out d) ? d : 0; //yty.MoistureFactor = double.TryParse(inViewModel.MoistureFactor, out d) ? d : 0; //yty.TestWeight = double.TryParse(inViewModel.TestWeight, out d) ? d : 0; //yty.PackFactor = double.TryParse(inViewModel.PackFactor, out d) ? d : 0; //yty.DockagePercent = double.TryParse(inViewModel.DockagePercent, out d) ? d : 0; //yty.DockageFactor = double.TryParse(inViewModel.DockageFactor, out d) ? d : 0; //yty.TotalVolume = double.TryParse(inViewModel.GrainVolume, out d) ? d : 0; //switch (inViewModel.ConversionFactor) //{ // case 0: // yty.ConversionFactor = 0.4; // break; // case 1: // yty.ConversionFactor = 0.8; // break; // default: // yty.ConversionFactor = 0; // break; //} //yty.ShellFactor = double.TryParse(inViewModel.ShellFactor, out d) ? d : 0; //yty.TotalDeductionVolume = double.TryParse(inViewModel.TotalDeductionVolume, out d) ? d : 0; //yty.Notes = inViewModel.ContentsNotes; return(yty); }