public ActionResult Creat(MoneyViewModel moneyViewModel) { if (ModelState.IsValid) { moneyService.Add(moneyViewModel); moneyService.Save(); return(RedirectToAction("Index")); } return(View("Index", moneyViewModel)); }
public ActionResult MoneyInput(MoneyClass Input) { if (ModelState.IsValid) { _MoneyService.Add(Input); _MoneyService.Save(); return(View()); } return(View(Input)); }
public ActionResult Index([Bind(Include = "Categoryyy,Amounttt,Dateee,Remarkkk")] MyMoneyViewModel booking) { if (ModelState.IsValid) { _MoneyService.Add(booking); _MoneyService.Save(); } return(View()); }
public ActionResult Index([Bind(Include = "Type,Date,Price,Description")] MoneyViewModel model) { /***不知道為什麼model裡面的Type都是None???***/ if (ModelState.IsValid) { _imoneyService.Add(model); _unitOfWork.Commit(); return(RedirectToAction("Index")); } return(View(model)); }
public ActionResult Index([Bind(Include = "Type,Date,Price,Description")] MoneyViewModel model) { ViewData["CategoryItems"] = GetCategoryList(); ViewData["PageItems"] = GetPageDropDownList(); /***不知道為什麼model裡面的Type都是None???***/ if (ModelState.IsValid) { _imoneyService.Add(model); _unitOfWork.Commit(); return(RedirectToAction("Index")); } return(View(model)); }
public ActionResult Add([Bind(Include = "Category,Amount,BillingDate,Memo")] MoneyAddViewModels MoneyAdd) { ViewData["CategoryList"] = new SelectList(DataDict.Category, "key", "value"); if (ModelState.IsValid) { _MoneyService.Add(MoneyAdd); _LogService.Add(MoneyAdd.Category, MoneyAdd.Amount, "Add"); _MoneyService.Save(); //System.Threading.Thread.Sleep(3000); //測試ajax //return View(); return(PartialView("List", _MoneyService.GetDataEF())); //加入ajax } return(View()); }
private Money Add(Money m1, Money m2) { return(MoneyService.Add(m1, m2)); }