예제 #1
0
        public void Execute(object parameter)
        {
            DataViewModel modeldata = new DataViewModel();

            this.Model.CarDetails = modeldata.CarDetails;
        }
예제 #2
0
 //private
 public ResetRecords(DataViewModel model)
 {
     this.Model = model;
 }
예제 #3
0
 //private
 public QueryRecords(DataViewModel model)
 {
     this.Model = model;
 }
예제 #4
0
        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;
            }
        }
예제 #5
0
 public ModifyRecords(DataViewModel DataModel)
 {
     dataModel = DataModel;
 }