Ejemplo n.º 1
0
        private async void ApplyChanges_Click(object sender, RoutedEventArgs e)
        {
            bool ChangesApplied = false;

            try
            {
                double Count       = double.Parse(ChangeCount.Text.Replace(',', '.'), System.Globalization.NumberStyles.Number, System.Globalization.CultureInfo.InvariantCulture);
                double Price       = double.Parse(ChangePrice.Text.Replace(',', '.'), System.Globalization.NumberStyles.Number, System.Globalization.CultureInfo.InvariantCulture);
                string Description = ChangeDesc.Text.ToString();
                SampleDataSource.ChangeCountAndPrice(Count, Price, Description);
                ChangesApplied = true;
            }
            catch
            {
            }

            if (ChangesApplied)
            {
                navigationHelper.GoBack();
            }
            else
            {
                MessageDialog mDialog = new MessageDialog(App.resourceLoader.GetString("InputDataError"));
                mDialog.Title = App.resourceLoader.GetString("Error");
                await mDialog.ShowAsync();
            }
        }