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")); }
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)); }