Exemplo n.º 1
0
        public async Task <IActionResult> Edit([Bind(properties)] PaymentView c)
        {
            if (!ModelState.IsValid)
            {
                return(View(c));
            }
            var o = await payments.GetObject(c.ID);

            o.Data.Amount          = c.Amount;
            o.Data.CurrencyID      = c.CurrencyID;
            o.Data.PaymentMethodID = c.PaymentMethodID;
            o.Data.DateMade        = c.DateMade ?? DateTime.MinValue;
            o.Data.DateDue         = c.DateDue ?? DateTime.MinValue;
            o.Data.ValidTo         = c.ValidTo ?? DateTime.MaxValue;
            await payments.UpdateObject(o);

            return(RedirectToAction("Index"));
        }