public ActionResult CreateTrans(Transaction newTrans) { try { if (ModelState.IsValid) { newTrans.TimeSend = DateTime.UtcNow; if (TransDAO.CreateTrans(newTrans)) { 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(newTrans)); } catch (Exception e) { Console.WriteLine(e.Message); return(View()); throw; } }
public ActionResult DeleteTrans(int id) { try { if (TransDAO.DeleteTrans(id)) { Alert("Delete Transaction Successfully .", NotificationType.success); return(RedirectToAction("ManageTrans")); } else { Alert("Delete Transaction error, cannot find this User!!!", NotificationType.error); return(RedirectToAction("ManageTrans")); } } catch (Exception e) { Alert(e.Message, NotificationType.error); return(RedirectToAction("ManageTrans")); throw; } }
public ActionResult DetailTrans(int id) { var s = TransDAO.GetTransaction(id); return(View(s)); }