private void zipCode_Validate(object sender, ValidationEventArgs e)
 {
     companyDataValid.zipCode = false;
     if (e.Value == null)
     {
         e.SetError("A mező kitöltése kötelező", DevExpress.XtraEditors.DXErrorProvider.ErrorType.Critical);
         CompanyDataVM.ItemSourceSearcher("zipCode", null);
     }
     else if (!e.Value.ToString().Where(char.IsNumber).Count().Equals(e.Value.ToString().Length))
     {
         e.SetError("A mező csak számokat tartalmazhat", DevExpress.XtraEditors.DXErrorProvider.ErrorType.Critical);
         CompanyDataVM.ItemSourceSearcher("zipCode", "false");
     }
     else if (!CompanyDataVM.ListChecker(e.Value.ToString(), typeof(zipcode_fx)))
     {
         e.SetError("A mező tartalma nem megfelelő", DevExpress.XtraEditors.DXErrorProvider.ErrorType.Critical);
         CompanyDataVM.ItemSourceSearcher("zipCode", "false");
     }
     else
     {
         e.SetError("A mező tartalma megfelelő", DevExpress.XtraEditors.DXErrorProvider.ErrorType.User1);
         companyDataValid.zipCode = true;
         CompanyDataVM.ItemSourceSearcher("zipCode", e.Value.ToString());
     }
     ForceBinding(sender, e);
 }
        private async void Start()
        {
            await Loading.Show();

            EditorLocalizer.Active = new Localizer();
            companyDataValid       = new CompanyDataValid();
            InitializeComponent();
            CompanyDataVM    = new CompanyDataVM(view.MoveFirstRow);
            this.DataContext = CompanyDataVM;
            validatorClass   = companyDataValid;
            button           = save;
            ConnectValidators();
        }
 private void settlement_Validate(object sender, ValidationEventArgs e)
 {
     companyDataValid.settlement = false;
     if (string.IsNullOrEmpty(e.Value as string))
     {
         e.SetError("A mező kitöltése nem kötelező", DevExpress.XtraEditors.DXErrorProvider.ErrorType.Critical);
         CompanyDataVM.ItemSourceSearcher("settlement", null);
     }
     else if (!CompanyDataVM.ListChecker(e.Value.ToString(), typeof(settlement_fx)))
     {
         e.SetError("A mező tartalma nem megfelelő", DevExpress.XtraEditors.DXErrorProvider.ErrorType.Critical);
         CompanyDataVM.ItemSourceSearcher("settlement", "false");
     }
     else
     {
         e.SetError("A mező tartalma megfelelő", DevExpress.XtraEditors.DXErrorProvider.ErrorType.User1);
         companyDataValid.settlement = true;
         CompanyDataVM.ItemSourceSearcher("settlement", e.Value.ToString());
     }
     ForceBinding(sender, e);
 }
 private void zipCodeErase(object sender, RoutedEventArgs e)
 {
     zipCode.Clear();
     CompanyDataVM.ItemSourceSearcher("zipCode", null);
 }
 private void Erase(object sender, RoutedEventArgs e)
 {
     CompanyDataVM.EraseMethod();
 }
 protected internal bool Dirty()
 {
     return(CompanyDataVM.VMDirty());
 }
 private void newLine(object sender, RoutedEventArgs e)
 {
     CompanyDataVM.NewLine(view.MoveLastRow);
 }
 private void view_BeforeLayoutRefresh(object sender, DevExpress.Xpf.Core.CancelRoutedEventArgs e)
 {
     e.Cancel = !CompanyDataVM.Validate();
 }
 private void Update(object sender, RoutedEventArgs e)
 {
     CompanyDataVM.Refresh();
 }
 private void Save(object sender, RoutedEventArgs e)
 {
     CompanyDataVM.Save();
 }
 private void settlementErase(object sender, RoutedEventArgs e)
 {
     settlement.Clear();
     CompanyDataVM.ItemSourceSearcher("settlement", null);
 }