public BankAccountsViewModel(INavigation navigation) : base(navigation) { CustomerAccounts = new ObservableRangeCollection <CustomerAccount>(); CustomerAccounts.CollectionChanged += CustomerAccounts_CollectionChanged; CustomerCards = new ObservableRangeCollection <MyCards>(); CustomerTransactions = new ObservableRangeCollection <RefinedTransactions>(); WalletDetails = new WalletDetails(); WalletTransacttions = new ObservableRangeCollection <WalletTransacttion>(); AllTransactionsCommand = new Command(() => { var vm = new AllTransactionsViewModel(Navigation); vm.SelectedAccount = SelectedAccount; var page = new AllTransactionsView(); page.BindingContext = vm; Navigation.PushAsync(page); }); AllWalletTransactionsCommand = new Command(() => { var vm = new WalletAllTransactionPageViewModel(Navigation); vm.WalletNuban = WalletNuban; var page = new WalletAllTransactionPage(); page.BindingContext = vm; Navigation.PushAsync(page); }); SelectedAccount = new CustomerAccount(); ReloadWallet = new Command(async() => await GetCustomerWalletbyPhoneNumber(GlobalStaticFields.Customer.PhoneNumber)); ReloadAccounts = new Command(async() => await GetCustomerAccountsbyPhoneNumber(GlobalStaticFields.Customer.PhoneNumber)); }
private void transaction_button_Click(object sender, EventArgs e) { TransactionController trcon = new TransactionController(); string user_id = "7fa65ff0-4a3e-4cc5-b975-fae5c16b385e"; //string year = DateTime.Now.Year("YY"); string date = DateTime.Now.Year.ToString() + '-' + DateTime.Now.Month.ToString(); //string date; //char[] chars = month.ToCharArray(); //if (chars[0] == '0') //{ // date = year + "-" + chars[1]; //} //else //{ // date = year + "-" + month; //} //trcon.get_transactions_by_month_userid(user_id, month); AllTransactionsView allTransactionsView = new AllTransactionsView(); //Console.WriteLine(date); DataTable dt = new DataTable(); MySqlDataAdapter adapt = trcon.get_transactions_by_month_userid(user_id, date); adapt.Fill(dt); allTransactionsView.dataGridView1.DataSource = dt; allTransactionsView.dataGridView1.Columns[0].Visible = false; allTransactionsView.dataGridView1.Columns[5].Visible = false; allTransactionsView.dataGridView1.Columns[6].Visible = false; allTransactionsView.dataGridView1.Columns[2].HeaderText = "Amount (Rs)"; allTransactionsView.dataGridView1.Columns[7].HeaderText = "Payer or Payee"; allTransactionsView.Show(); allTransactionsView.comboBox2.SelectedValue = DateTime.Now.Month.ToString(); }