예제 #1
0
        void Window_Loaded(object s, RoutedEventArgs e)
        {
            minFinDS = ((FinDemoDataSet_Jan2015)(FindResource("minFinDS")));
            //// Load data into the table TxCore. You can modify this code as needed.
            //FinDemoDataSet_Jan2015TableAdapters.TxCoreTableAdapter minFinDSTxCoreTableAdapter = new FinDemoDataSet_Jan2015TableAdapters.TxCoreTableAdapter();
            //minFinDSTxCoreTableAdapter.Fill(minFinDS.TxCore);

            new FinDemoDataSet_Jan2015TableAdapters.TxCategoryTableAdapter().Fill(minFinDS.TxCategory);
            ((CollectionViewSource)(FindResource("txCategoryViewSource"))).View.MoveCurrentToFirst();

            new FinDemoDataSet_Jan2015TableAdapters.TxMoneySrcTableAdapter().Fill(minFinDS.TxMoneySrc);
            ((CollectionViewSource)(FindResource("txMoneySrcViewSource"))).View.MoveCurrentToFirst();

            new FinDemoDataSet_Jan2015TableAdapters.TxSupplierTableAdapter().Fill(minFinDS.TxSupplier);
            ((CollectionViewSource)(FindResource("txSupplierViewSource"))).View.MoveCurrentToFirst();

            new FinDemoDataSet_Jan2015TableAdapters.TxCoreTableAdapter().Fill(_txCoreTblDbValidationCopy);
            new FinDemoDataSet_Jan2015TableAdapters.ExpenseGroupTableAdapter().Fill(minFinDS.ExpenseGroup);

            txAmountTextBox.Focus();

            //var minFinDSTxCoreSimilarTxsTableAdapter = new MinFin.DataSet.FinDemoDataSet_Jan2015TableAdapters.TxCoreSimilarTxsTableAdapter();
            var txCoreSimilarTxsViewSource = ((System.Windows.Data.CollectionViewSource)(FindResource("txCoreSimilarTxsViewSource")));

            txCoreSimilarTxsViewSource.View.MoveCurrentToFirst();

            //worked in Jan2012: emergencyXmlBackupSave();
        }
예제 #2
0
        void emergencyXmlBackupSave()
        {
            try
            {
                var fsds = new FinDemoDataSet_Jan2015();
                //fsds.ReadXml(@"D:\Users\alex\OneDrive\bak\MinFin\EntryLog.VAIO1.2013.01.09.135826.xml");
                foreach (MinFin.DataSet.FinDemoDataSet_Jan2015.TxCoreRow r in fsds.TxCore.Rows)
                {
                    minFinDS.TxCore.ImportRow(r);
                }

                auditAndSave();
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, "Unable to add a row"); }
        }