public override ValidationResult Validate(object value, CultureInfo cultureInfo) { Regex regex = new Regex(@"^[0-9]+$"); RECEPTION reception = ((Window as PayWindow).DataContext as PayViewModel).Reception; if (value == null) { return(new ValidationResult(true, null)); } if (value.ToString() == "") { return(new ValidationResult(false, this.ErrorMessageNull)); } else if (regex.IsMatch(value.ToString())) { return(new ValidationResult(false, this.ErrorMessage)); } else if ((DataProvider.Ins.DB.GARA_INFO.FirstOrDefault().IsOverPay == false) && ((int)value > reception.Debt)) { return(new ValidationResult(false, this.ErrorMessagePayOver)); } return(new ValidationResult(true, null)); }
public ChangeCarInfoWindow(RECEPTION carReception) { InitializeComponent(); this.DataContext = (changeCarInfoViewModel = new ChangeCarInfoViewModel(carReception)); }
public CarServiceWindow(RECEPTION carReception) { InitializeComponent(); this.DataContext = (carServiceViewModel = new CarServiceViewModel(carReception)); }
public AddRepairFormWindow(RECEPTION reception) { InitializeComponent(); this.DataContext = (addRepairFormViewModel = new AddRepairFormViewModel(reception)); }
public PayWindow(RECEPTION carReception) { InitializeComponent(); this.DataContext = (payViewModel = new PayViewModel(carReception)); }
public BillTemplate(RECEPTION reception) { InitializeComponent(); this.DataContext = (billViewModel = new BillViewModel(reception)); }