Ejemplo n.º 1
0
        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;
            }
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        public ActionResult Credit(MyWallet cre)
        {
            using (DatabaseContext db = new DatabaseContext())
            {
                db.MyWallet.Add(cre);

                db.SaveChanges();
            }


            return(RedirectToAction("Index"));
        }
Ejemplo n.º 4
0
        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;
            }
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            string text = SavedPaymentsDropdown.Text;

            MyWallet.Remove(text);
        }
Ejemplo n.º 7
0
        private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Payment p = MyWallet.Get(SavedPaymentsDropdown.SelectedIndex);

            PaymentInfo.Text = p != null?p.ToString() : "";
        }