private void AddTvaBtn_Click(object sender, RoutedEventArgs e) { TVA tva = new TVA(); TvaClient tvac = new TvaClient(); String input = null; input = TvaValueTxtBox.Text; if (input == null) input = ""; if (/*!Validator.IsAlphanumericValid(input) || */ String.IsNullOrEmpty(input)) { MessageBox.Show("Erreur dans le Nom de la TVA (ne doit pas être vide)"); return; } if (TvaClient.IsTvaExist(Convert.ToDouble(input))) { MessageBox.Show("TVA existe déjà"); return; }; Decimal dec = Convert.ToDecimal(input); tva.TauxTVA = (float)dec; String s =tvac.AddTva(tva); MessageBox.Show(s); Close(); }
private void btnAddMeasure_Click(object sender, RoutedEventArgs e) { TvaClient tc = new TvaClient(); GestionCommerciale.DomainModel.Entities.TVA tva = new GestionCommerciale.DomainModel.Entities.TVA(); //verify value validation tva.TauxTVA = float.Parse(TVATxtBox.Text); tva.Description = DescriptionTxtBox.Text; tc.AddTva(tva); DialogResult = true; Close(); }
public AddPurchaseView(string animationName, TabHelper hlp) { InitializeComponent(); Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR"); Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-FR"); _tabHlp = hlp; _productsSelSelected = new List<ProduitsSel>(); //produit = new Products(); _productManger = new ProductManger(); _tvaClient = new TvaClient(); TvaComboBox.ItemsSource = _tvaClient.GetTvaValues(); _suppliersManager = new SuppliersManager(); _productManger.ResetUnitsOnOrder(); _productSelected = new List<Product>(); if (string.IsNullOrEmpty(animationName)) return; var animation = (Storyboard) Application.Current.Resources[animationName]; LayoutRoot.BeginStoryboard(animation); }
private void Window_Loaded(object sender, RoutedEventArgs e) { TvaClient tvas = new TvaClient(); dgTVAs.ItemsSource = tvas.GetTva(); dgTVAs.Columns.RemoveAt(3); }