Esempio n. 1
0
        public void CreateCashTest()
        {
            var r = GetRandom.Object <CashDbRecord>();
            var o = PaymentObjectFactory.CreateCash(r.ID, r.Amount, r.Currency, r.Memo, r.Payer, r.Payee,
                                                    r.ValidFrom, r.ValidTo);

            Assert.IsInstanceOfType(o, typeof(CashObject));
            testVariables(o.DbRecord, r.ID, r.Amount, r.Currency, r.Memo, r.Payer, r.Payee, r.ValidFrom,
                          r.ValidTo);
        }
Esempio n. 2
0
        CreateCash([Bind(cashProperties)] CashViewModel c)
        {
            if (!ModelState.IsValid)
            {
                return(View(c));
            }
            c.ID = Guid.NewGuid().ToString();
            var o = PaymentObjectFactory.CreateCash(c.ID, c.Amount, c.Currency, c.Memo, c.Payer,
                                                    c.Payee, c.ValidFrom, c.ValidTo);
            await payments.AddObject(o);

            return(RedirectToAction("Index"));
        }