private void AddFundsButton_Click(object sender, RoutedEventArgs e) { Payment p = MyWallet.Get(SavedPaymentsDropdown.SelectedIndex); if (p != null) { AddFundsWindow win = new AddFundsWindow(p, PaymentInfo); win.Visibility = Visibility.Visible; } }
public JObject MyWalletAmt(int CID) { JObject jObject = new JObject(); var wallet = MyWallet.GetWalletAmt(CID); var used = wallet.Sum(x => x.deductedAmt); var leftamt = wallet.Sum(x => x.CashBkAmt) - used; jObject.Add("Used", used.ToString("0.00")); jObject.Add("LeftAmt", leftamt.ToString("0.00")); return(jObject); }
public ActionResult Credit(MyWallet cre) { using (DatabaseContext db = new DatabaseContext()) { db.MyWallet.Add(cre); db.SaveChanges(); } return(RedirectToAction("Index")); }
private void AddPaymentSourceButton_Click(object sender, RoutedEventArgs e) { Payment p = MyWallet.Get(PaymentSourceDropdown.SelectedIndex); double amount = double.Parse(PaymentAmountInput.Text); Current.AddPayment(new PaymentLine(p, amount)); PaymentAmountInput.Text = ""; TotalFundsAmountLabel.Content = $"${Current.GetTotalFunds()}"; if (TransactionGrid.ItemsSource == null) { TransactionGrid.ItemsSource = Current.Items; PaymentGrid.ItemsSource = Current.Payments; } }
public JArray GetWalletAmt(int CID) { var walletamt = MyWallet.GetWalletAmt(CID); JArray jArray = new JArray(); foreach (var wallet in walletamt) { var leftamt = wallet.CashBkAmt - wallet.deductedAmt; JObject jObject = new JObject(); jObject.Add("Used", wallet.deductedAmt.ToString("0.00")); jObject.Add("LeftAmt", leftamt.ToString("0.00")); jObject.Add("OutLetName", wallet.OutLetName); jObject.Add("IsActive", wallet.isActive); jArray.Add(jObject); } return(jArray); }
private void Button_Click_1(object sender, RoutedEventArgs e) { string text = SavedPaymentsDropdown.Text; MyWallet.Remove(text); }
private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { Payment p = MyWallet.Get(SavedPaymentsDropdown.SelectedIndex); PaymentInfo.Text = p != null?p.ToString() : ""; }