public void Execute(object parameter) { DataViewModel modeldata = new DataViewModel(); this.Model.CarDetails = modeldata.CarDetails; }
//private public ResetRecords(DataViewModel model) { this.Model = model; }
//private public QueryRecords(DataViewModel model) { this.Model = model; }
public void Execute(object parameter) { DataViewModel modeldata = new DataViewModel(); this.Model.CarDetails = modeldata.CarDetails; switch (Model.SelectedOperatorkey.ToString()) { case ">": switch (Model.SelecetdYValue) { case "Price": this.Model.CarDetails = (this.Model.CarDetails.Where(s => s.Price > double.Parse(this.Model.ConditionalInput)).ToList()); break; case "MaximumSpeed": this.Model.CarDetails = (this.Model.CarDetails.Where(s => s.MaximumSpeed > double.Parse(this.Model.ConditionalInput)).ToList()); break; case "Mileage": this.Model.CarDetails = (this.Model.CarDetails.Where(s => s.Mileage > double.Parse(this.Model.ConditionalInput)).ToList()); break; } break; case "<": switch (Model.SelecetdYValue) { case "Price": this.Model.CarDetails = (this.Model.CarDetails.Where(s => s.Price < double.Parse(this.Model.ConditionalInput)).ToList()); break; case "MaximumSpeed": this.Model.CarDetails = (this.Model.CarDetails.Where(s => s.MaximumSpeed < double.Parse(this.Model.ConditionalInput)).ToList()); break; case "Mileage": this.Model.CarDetails = (this.Model.CarDetails.Where(s => s.Mileage < double.Parse(this.Model.ConditionalInput)).ToList()); break; } break; case "=": switch (Model.SelecetdYValue) { case "Price": this.Model.CarDetails = (this.Model.CarDetails.Where(s => s.Price == double.Parse(this.Model.ConditionalInput)).ToList()); break; case "MaximumSpeed": this.Model.CarDetails = (this.Model.CarDetails.Where(s => s.MaximumSpeed == double.Parse(this.Model.ConditionalInput)).ToList()); break; case "Mileage": this.Model.CarDetails = (this.Model.CarDetails.Where(s => s.Mileage == double.Parse(this.Model.ConditionalInput)).ToList()); break; } break; } if (this.Model.CarDetails.Count == 0) { this.Model.CarDetails = null; } }
public ModifyRecords(DataViewModel DataModel) { dataModel = DataModel; }