예제 #1
0
 public static void ConfigureAppModel(this ModelBuilder builder)
 {
     AppUserProfile.ConfigureFluent(builder);
     AppUserBank.ConfigureFluent(builder);
     AppUserRole.ConfigureFluent(builder);
     AppUserFile.ConfigureFluent(builder);
     Bank.ConfigureFluent(builder);
     Country.ConfigureFluent(builder);
     State.ConfigureFluent(builder);
     LGA.ConfigureFluent(builder);
     Staff.ConfigureFluent(builder);
     Supplier.ConfigureFluent(builder);
     BillPayable.ConfigureFluent(builder);
     BillReceivable.ConfigureFluent(builder);
     Journal.ConfigureFluent(builder);
     JournalLineItem.ConfigureFluent(builder);
     Payment.ConfigureFluent(builder);
     Receipt.ConfigureFluent(builder);
     PayableWorkFlow.ConfigureFluent(builder);
     ReceivableWorkFlow.ConfigureFluent(builder);
     AccountGroup.ConfigureFluent(builder);
     AccountSubType.ConfigureFluent(builder);
     LineItem.ConfigureFluent(builder);
     BankAccount.ConfigureFluent(builder);
     AppData.ConfigureFluent(builder);
 }
예제 #2
0
        public IActionResult SaveStepTwo(JournalView.StepTwoView viewModel)
        {
            var journalModel = HttpContext.Session
                               .GetObjectFromJson <JournalView>("JournalView");

            var journalList =
                JsonConvert.DeserializeObject
                <List <JournalView.JournalListItem> >(viewModel.JournalLineItems);

            int count = _unitOfWork.JournalsRepository.Items.ToList().Count;

            var journal = new Journal
            {
                Code            = ++count,
                TransactionDate = journalModel.StepOne.Date,
                Description     = journalModel.StepOne.Description,
                Economic        = journalModel.StepOne.Economic,
                Fund            = journalModel.StepOne.Fund,
            };

            _unitOfWork.JournalsRepository.Insert(journal);

            foreach (var line in journalList)
            {
                var journalListItem = new JournalLineItem
                {
                    Journal  = journal,
                    Economic = line.Economic,
                    Fund     = line.Fund,
                    Amount   = line.Amount,
                    Type     = line.Type
                };

                _unitOfWork.JournalLineItemsRepository.Insert(journalListItem);
            }

            _unitOfWork.SaveChanges();

            return(RedirectToAction("Confirm"));
        }