예제 #1
0
        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");
        }
예제 #2
0
 public void AddJournalPayment(JournalPayment journalPayment)
 {
     if (journalPayment!=null) Service.MyMoneyContext.JournalPayments.Add(journalPayment);
     Service.Commit();
 }