Exemplo n.º 1
0
        public IActionResult Edit(AccountSubLedger SubLedger)
        {
            SubLedger.AccountLedgerGroupId = SubLedger.AccountLedgerGroupId == 0 ? null : SubLedger.AccountLedgerGroupId;

            if (ModelState.IsValid)
            {
                var accountSubLedger = _work.AccountSubLedger.Get(SubLedger.Id);

                accountSubLedger.AccountSubLedgerName = SubLedger.AccountSubLedgerName;

                _work.AccountSubLedger.Update(accountSubLedger);

                bool isSaved = _work.Save() > 0;

                if (isSaved)
                {
                    return(Json(true));
                }
            }
            return(PartialView("_AccountSubLedgerEditView"));
        }
Exemplo n.º 2
0
        public IActionResult Create(AccountSubLedger accountSubLedger)
        {
            accountSubLedger.AccountLedgerGroupId = accountSubLedger.AccountLedgerGroupId == 0 ? null : accountSubLedger.AccountLedgerGroupId;

            if (ModelState.IsValid)
            {
                var accountLedger = _work.AccountLedger.Get(accountSubLedger.AccountLedgerId);

                accountSubLedger.DbTrackId = accountLedger.TrackingId;

                _work.AccountSubLedger.Add(accountSubLedger);

                bool isSaved = _work.Save() > 0;

                if (isSaved)
                {
                    return(Json(true));
                }
            }

            return(Json(false));
        }