public ActionResult AddNewPayment(JournalPayment journalPayment) { using (var service = GetService()) { if (ModelState.IsValid) { var jp = new JournalPayment() { Amount = journalPayment.Amount, Currency = journalPayment.Currency, DateTime = DateTime.Now, Description = "First", OperationTypeId = 1, PrioritetId = 1 }; service.MyMoneyService.AddJournalPayment(jp); //service.MyMoneyContext.JournalPayments.Add(jp); //service.MyMoneyContext.SaveChanges(); } //service.MyMoneyService.AddJournalPayment(journalPayment); } return RedirectToAction("Index"); }
public void AddJournalPayment(JournalPayment journalPayment) { if (journalPayment!=null) Service.MyMoneyContext.JournalPayments.Add(journalPayment); Service.Commit(); }