示例#1
0
        public IActionResult Create(AccountLedgerGroup accountLedgerGroup)
        {
            if (ModelState.IsValid)
            {
                _work.AccountLedgerGroup.Add(accountLedgerGroup);

                bool isSaved = _work.Save() > 0;

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

            return(Json(false));
        }
示例#2
0
        public IActionResult Edit(AccountLedgerGroup ledgerGroup)
        {
            if (ModelState.IsValid)
            {
                var accountLedgerGroup = _work.AccountLedgerGroup.Get(ledgerGroup.Id);

                accountLedgerGroup.AccountLedgerGroupName = ledgerGroup.AccountLedgerGroupName;

                _work.AccountLedgerGroup.Update(accountLedgerGroup);

                bool isSaved = _work.Save() > 0;

                if (isSaved)
                {
                    return(Json(true));
                }
            }
            return(PartialView("_AccountLedgerGroupEditView"));
        }