示例#1
0
        public IActionResult CreateTransaction(Transaction transaction)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    transaction.TimeSend = DateTime.UtcNow;
                    if (_transactionServices.CreateTransaction(transaction))
                    {
                        Alert("Send eGreeting card successfully.", NotificationType.success);
                        return(RedirectToAction("Index", "Home"));
                    }
                    Alert("Send card failed. Please contact Administrator!", NotificationType.error);
                    return(RedirectToAction("Index", "Home"));
                }
                return(View(transaction));
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                return(View());

                throw;
            }
        }